1. 18 4月, 2012 7 次提交
    • D
      util: only register callbacks for CREATE operations in virnetdevmacvlan.c · f6146c35
      D. Herrendoerfer 提交于
      Currently upon a migration a callback is created when a 802.1qbg link
      is set to PREASSOCIATE, this should not happen because this is a no-op
      on most switches, and does not lead to an ASSOCIATE state.  This patch
      only creates callbacks when CREATE or RESTORE is requested.  Migration
      and libvirtd restart scenarios are already handled elsewhere.
      Signed-off-by: ND. Herrendoerfer <d.herrendoerfer@herrendoerfer.name>
      f6146c35
    • S
      Fix a memory leak · 25fce290
      Stefan Berger 提交于
      The below patch fixes the following memory leak.
      
      ==20624== 24 bytes in 2 blocks are definitely lost in loss record 532 of 1,867
      ==20624==    at 0x4A05E46: malloc (vg_replace_malloc.c:195)
      ==20624==    by 0x38EC27FC01: strdup (strdup.c:43)
      ==20624==    by 0x4EB6BA3: virDomainChrSourceDefCopy (domain_conf.c:1122)
      ==20624==    by 0x495D76: qemuProcessFindCharDevicePTYs (qemu_process.c:1497)
      ==20624==    by 0x498321: qemuProcessWaitForMonitor (qemu_process.c:1258)
      ==20624==    by 0x49B5F9: qemuProcessStart (qemu_process.c:3652)
      ==20624==    by 0x468B5C: qemuDomainObjStart (qemu_driver.c:4753)
      ==20624==    by 0x469171: qemuDomainStartWithFlags (qemu_driver.c:4810)
      ==20624==    by 0x4F21735: virDomainCreate (libvirt.c:8153)
      ==20624==    by 0x4302BF: remoteDispatchDomainCreateHelper (remote_dispatch.h:852)
      ==20624==    by 0x4F72C14: virNetServerProgramDispatch (virnetserverprogram.c:416)
      ==20624==    by 0x4F6D690: virNetServerHandleJob (virnetserver.c:164)
      ==20624==    by 0x4E8F43D: virThreadPoolWorker (threadpool.c:144)
      ==20624==    by 0x4E8EAB5: virThreadHelper (threads-pthread.c:161)
      ==20624==    by 0x38EC606CCA: start_thread (pthread_create.c:301)
      ==20624==    by 0x38EC2E0C2C: clone (clone.S:115) 
      25fce290
    • E
      blockjob: add virsh blockpull --wait · 3b96a892
      Eric Blake 提交于
      I'm tired of shell-scripting to wait for completion of a block pull,
      when virsh can be taught to do the same.  I couldn't quite reuse
      vshWatchJob, as this is not a case of a long-running command where
      a second thread must be used to probe job status (at least, not unless
      I make virsh start doing blocking waits for an event to fire), but it
      served as inspiration for my simpler single-threaded loop.  There is
      up to a half-second delay between sending SIGINT and the job being
      aborted, but I didn't think it worth the complexity of a second thread
      and use of poll() just to minimize that delay.
      
      * tools/virsh.c (cmdBlockPull): Add new options to wait for
      completion.
      (blockJobImpl): Add argument.
      (cmdBlockJob): Adjust caller.
      * tools/virsh.pod (blockjob): Document new mode.
      3b96a892
    • E
      qemu: use consistent error when qemu binary is too old · 6fb8a64d
      Eric Blake 提交于
      Most of our errors complaining about an inability to support a
      particular action due to qemu limitations used CONFIG_UNSUPPORTED,
      but we had a few outliers.  Reported by Jiri Denemark.
      
      * src/qemu/qemu_command.c (qemuBuildDriveDevStr): Prefer
      CONFIG_UNSUPPORTED.
      * src/qemu/qemu_driver.c (qemuDomainReboot)
      (qemuDomainBlockJobImpl): Likewise.
      * src/qemu/qemu_hotplug.c (qemuDomainAttachPciControllerDevice):
      Likewise.
      * src/qemu/qemu_monitor.c (qemuMonitorTransaction)
      (qemuMonitorBlockJob, qemuMonitorSystemWakeup): Likewise.
      6fb8a64d
    • E
      virsh: minor syntactic cleanups · 4f06777e
      Eric Blake 提交于
      No semantic change.
      
      * tools/virsh.c: Fix some spacing issues, {} usage, long lines,
      and redundant ().
      4f06777e
    • J
      vbox: avoid provoking assertions in VBoxSVC · 78345c68
      Jean-Baptiste Rouault 提交于
      Passing a NULL pointer to IMachine::delete virtualbox API
      causes VBoxSVC to raise an assertion. This patch passes
      an empty array instead.
      78345c68
    • O
      docs: Improve the schema for fs device · 7adeac67
      Osier Yang 提交于
      <filesystemtgt> is redundant, as every group uses it; <address>
      shouldn't be in <filesystemtgt> in case of the meaning could be
      "filesystemtarget"; The elements <address>, <alias>, <target>,
      ... should be interleaved.
      7adeac67
  2. 17 4月, 2012 10 次提交
    • O
      conf: Do not parse cpuset only if the placement is auto · 74e772dd
      Osier Yang 提交于
      So that a domain xml which doesn't have "placement" specified, but
      "cpuset" is specified, could be parsed. And in this case, the
      "placement" mode will be set as "static".
      74e772dd
    • O
      tests: Update read-bufsiz to delete the UUID of vm XML · 79568df0
      Osier Yang 提交于
      Since now we have fixed domain UUID for test driver, defining
      a domain with different name but same UUID doesn't work any
      more. This patch delete the UUID from the dumped XML so that
      it could be generated.
      79568df0
    • O
      test: Set the fixed uuid for the default XMLs · 4010217e
      Osier Yang 提交于
      The objects (domain, pool, network, etc) for testing are defined/
      started each time when opening a connect to test driver, and thus
      the UUID for the objects will be generated each time, with different
      values. e.g.
      
      % for i in {1..3}; do ./tools/virsh --connect \
        test:///default dumpxml test | grep uuid; done
        <uuid>a1b6ee1f-97de-f0ee-617a-0cdb74947df5</uuid>
        <uuid>ee68d7d2-3eb9-593e-2769-797ce1f4c4aa</uuid>
        <uuid>fecb1d3a-918a-8412-e534-76192cf32b18</uuid>
      
      It's the potential bug which can cause operations like below to fail:
      
      $ virsh -c test:///default dumpxml test > test.xml
      
      [ Some modificatons, though it's not supported, but it should work ]
      
      $ virsh -c test:///default define test.xml
      
      This patch set fixed UUID for objects which support it. (domain,
      pool, network).
      4010217e
    • O
      qemu: Split ide-drive into ide-cd and ide-hd · a4cda054
      Osier Yang 提交于
      A "ide-drive" device can be either a hard disk or a CD-ROM,
      if there is ",media=cdrom" specified for the backend, it's
      a CD-ROM, otherwise it's a hard disk.
      
      Upstream qemu splitted "ide-drive" into "ide-hd" and "ide-cd"
      since commit 1f56e32, and ",media=cdrom" is not required for
      ide-cd anymore. "ide-drive" is still supported for backwards
      compatibility, but no doubt we should go foward.
      a4cda054
    • O
      qemu: Split scsi-disk into into scsi-hd and scsi-cd · 02e8d0cf
      Osier Yang 提交于
      A "scsi-disk" device can be either a hard disk or a CD-ROM,
      if there is ",media=cdrom" specified for the backend, it's
      a CD-ROM, otherwise it's a hard disk.
      
      But upstream qemu splitted "scsi-disk" into "scsi-hd" and
      "scsi-cd" since commit b443ae, and ",media=cdrom" is not
      required for scsi-cd anymore. "scsi-disk" is still supported
      for backwards compatibility, but no doubt we should go
      foward.
      02e8d0cf
    • J
      Do not enforce source type of console[0] · dde91ab9
      Jan Kiszka 提交于
      If console[0] is an alias for serial[0], do not enforce the former to
      have a PTY source type. This breaks serial consoles on stdio and makes
      no sense.
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      dde91ab9
    • S
      xen: do not use ioemu type for any emulated NIC · 10c31135
      Stefan Bader 提交于
      When using the xm/xend stack to manage instances there is a bug
      that causes the emulated interfaces to be unusable when the vif
      config contains type=ioemu.
      
      The current code already has a special quirk to not use this
      keyword if no specific model is given for the emulated NIC
      (defaulting to rtl8139).
      Essentially it works because regardless of the type argument,i
      the Xen stack always creates emulated and paravirt interfaces and
      lets the guest decide which one to use. So neither xl nor xm stack
      actually require the type keyword for emulated NICs.
      Signed-off-by: NStefan Bader <stefan.bader@canonical.com>
      10c31135
    • O
      openvz: Correct the comments for new node APIs · bfc22645
      Osier Yang 提交于
      It should be 0.9.12 instead of 0.9.11
      bfc22645
    • C
      docs: fix 'omitted' typo in <cputune> doc · 684f3ebb
      Christophe Fergeau 提交于
      'omitted' was mispelt 'commited' twice. One of the sentences with
      the typo was also missing an 'is' ('each VCPU *is* pinned to all...')
      which I added in this commit while I was at it.
      684f3ebb
    • C
      3e0513af
  3. 16 4月, 2012 8 次提交
  4. 15 4月, 2012 1 次提交
  5. 14 4月, 2012 1 次提交
    • P
      virnetdev: Check for defined IFLA_VF_* · d7451bdd
      Philipp Hahn 提交于
      The linux-2.6.32 kernel header does not yet define IFLA_VF_MAX and others,
      which breaks compiling a new libvirt on old systems like Debian Squeeze.
      
      (I also have to add --without-macvtap --disable-werror --without-virtualport to
       ./configure to get it to compile.)
      Signed-off-by: NPhilipp Hahn <hahn@univention.de>
      d7451bdd
  6. 13 4月, 2012 6 次提交
  7. 12 4月, 2012 7 次提交
    • M
      qemuOpenFile: Don't force chown on NFS · b1256816
      Michal Privoznik 提交于
      If dynamic_ownership is off and we are creating a file on NFS
      we force chown. This will fail as chown/chmod are not supported
      on NFS. However, with no dynamic_ownership we are not required
      to do any chown.
      b1256816
    • A
      daemon: Plug memory leaks · d0eaf4b1
      Alex Jia 提交于
      * daemon/libvirtd-config.c (daemonConfigFree): fix memory leaks.
      
      How to reproduce?
      
      % make && make -C tests check TESTS=libvirtdconftest
      % cd tests && valgrind -v --leak-check=full ./libvirtdconftest
      
      actual result:
      
      ==11008== 185 bytes in 5 blocks are definitely lost in loss record 3 of 5
      ==11008==    at 0x4A05FDE: malloc (vg_replace_malloc.c:236)
      ==11008==    by 0x39CF07F6E1: strdup (strdup.c:43)
      ==11008==    by 0x406626: daemonConfigLoadOptions (libvirtd-config.c:438)
      ==11008==    by 0x406800: daemonConfigLoadData (libvirtd-config.c:492)
      ==11008==    by 0x403CCF: testCorrupt (libvirtdconftest.c:110)
      ==11008==    by 0x404FAD: virtTestRun (testutils.c:145)
      ==11008==    by 0x403A34: mymain (libvirtdconftest.c:219)
      ==11008==    by 0x404687: virtTestMain (testutils.c:700)
      ==11008==    by 0x39CF01ECDC: (below main) (libc-start.c:226)
      ==11008==
      ==11008== LEAK SUMMARY:
      ==11008==    definitely lost: 185 bytes in 5 blocks
      Signed-off-by: NAlex Jia <ajia@redhat.com>
      d0eaf4b1
    • E
      blockjob: allow for fast-finishing job · a9d3495e
      Eric Blake 提交于
      In my testing, I was able to provoke an odd block pull failure:
      
      $ virsh blockpull dom vda --bandwidth 10000
      error: Requested operation is not valid: No active operation on device: drive-virtio-disk0
      
      merely by using gdb to artifically wait to do the block job set speed
      until after the pull had already finished.  But in reality, that should
      be a success, since the pull finished before we had a chance to set
      speed.  Furthermore, using a double job lock is not only annoying, but
      a bug in itself - if you do parallel virDomainBlockRebase, and hit
      the race window just right, the first call grabs the VM job to start
      a fast block job, then the second call grabs the VM job to start
      a long-running job with unspecified speed, then the first call finally
      regrabs the VM job and sets the speed, which ends up running the
      second job under the speed from the first call.  By consolidating
      things into a single job, we avoid opening that race, as well as reduce
      the time between starting the job and changing the speed, for less
      likelihood of the speed change happening after block job completion
      in the first place.
      
      * src/qemu/qemu_monitor.h (BLOCK_JOB_CMD): Add new mode.
      * src/qemu/qemu_driver.c (qemuDomainBlockRebase): Move secondary
      job call...
      (qemuDomainBlockJobImpl): ...here, for fewer locks.
      * src/qemu/qemu_monitor_json.c (qemuMonitorJSONBlockJob): Change
      return value on new internal mode.
      a9d3495e
    • E
      blockjob: wire up qemu async virDomainBlockJobAbort · a91ce852
      Eric Blake 提交于
      Without the VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC flag, libvirt will internally
      poll using qemu's "query-block-jobs" API and will not return until the
      operation has been completed.  API users are advised that this operation
      is unbounded and further interaction with the domain during this period
      may block.  Future patches may refactor things to allow other queries in
      parallel with this polling.  For older qemu, we synthesize the cancellation
      event, since qemu won't generate it.
      
      The choice of polling duration copies from the code in qemu_migration.c.
      Signed-off-by: NAdam Litke <agl@us.ibm.com>
      Cc: Stefan Hajnoczi <stefanha@gmail.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      a91ce852
    • E
      blockjob: optimize JSON event handler lookup · ecb39e9d
      Eric Blake 提交于
      Probably in the noise, but this will let us scale more efficiently
      as we learn to recognize even more qemu events.
      
      * src/qemu/qemu_monitor_json.c (eventHandlers): Sort.
      (qemuMonitorEventCompare): New helper function.
      (qemuMonitorJSONIOProcessEvent): Optimize event lookup.
      ecb39e9d
    • A
      blockjob: add API for async virDomainBlockJobAbort · a696f8b7
      Adam Litke 提交于
      Block job cancellation can take a while.  Now that upstream qemu 1.1
      has asynchronous block cancellation, we want to expose that to the user.
      Therefore, the following updates are made to the virDomainBlockJob API:
      
      A new block job event type VIR_DOMAIN_BLOCK_JOB_CANCELED is managed by
      libvirt.  Regardless of the flags used with virDomainBlockJobAbort, this
      event will be raised: 1. when using synchronous block_job_cancel (the
      event will be synthesized by libvirt), and 2. whenever it is received
      from qemu (via asynchronous block-job-cancel).  Note that the event
      may be detected by libvirt even before the virDomainBlockJobAbort
      completes (always true when it is synthesized, but also possible if
      cancellation was fast).
      
      A new extension flag VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC is added to the
      virDomainBlockJobAbort API.  When enabled, this function will allow
      (but not require) asynchronous operation (ie, it returns as soon as
      possible, which might be before the job has actually been canceled).
      When the API is used in this mode, it is the responsibility of the
      caller to wait for a VIR_DOMAIN_BLOCK_JOB_CANCELED event or poll via
      the virDomainGetBlockJobInfo API to check the cancellation status.
      
      This patch also exposes the new flag through virsh, and makes virsh
      slightly easier to use (--async implies --abort, and lack of any options
      implies --info), although it leaves the qemu implementation for later
      patches.
      Signed-off-by: NAdam Litke <agl@us.ibm.com>
      Cc: Stefan Hajnoczi <stefanha@gmail.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      a696f8b7
    • E
      blockjob: add qemu capabilities related to block pull jobs · 2b085f5b
      Eric Blake 提交于
      RHEL 6.2 was released with an early version of block jobs, which only
      worked on the qed file format, where the commands were spelled with
      underscore (contrary to QMP style), and where 'block_job_cancel' was
      synchronous and did not trigger an event.
      
      The upcoming qemu 1.1 release has fixed these short-comings [1][2]:
      the commands now work on multiple file types, are spelled with dash,
      and 'block-job-cancel' is asynchronous and emits an event upon conclusion.
      
      [1]qemu commit 370521a1d6f5537ea7271c119f3fbb7b0fa57063
      [2]https://lists.gnu.org/archive/html/qemu-devel/2012-04/msg01248.html
      
      This patch recognizes the new spellings, and fixes virDomainBlockRebase
      to give a graceful error when talking to a too-old qemu on a partial
      rebase attempt.  Fixes for the new semantics will come later.  This
      patch also removes a bogus ATTRIBUTE_NONNULL mistakenly added in
      commit 10ec36e2.
      
      * src/qemu/qemu_capabilities.h (QEMU_CAPS_BLOCKJOB_SYNC)
      (QEMU_CAPS_BLOCKJOB_ASYNC): New bits.
      * src/qemu/qemu_capabilities.c (qemuCaps): Name them.
      * src/qemu/qemu_monitor_json.c (qemuMonitorJSONCheckCommands): Set
      them.
      (qemuMonitorJSONBlockJob): Manage both command names.
      (qemuMonitorJSONDiskSnapshot): Minor formatting fix.
      * src/qemu/qemu_monitor.h (qemuMonitorBlockJob): Alter signature.
      * src/qemu/qemu_monitor_json.h (qemuMonitorJSONBlockJob): Likewise.
      * src/qemu/qemu_monitor.c (qemuMonitorBlockJob): Pass through
      capability bit.
      * src/qemu/qemu_driver.c (qemuDomainBlockJobImpl): Update callers.
      2b085f5b