1. 21 2月, 2013 6 次提交
    • M
      qemu: Run lzop with '--ignore-warn' · 0eeedf52
      Michal Privoznik 提交于
      Currently, if lzop decompression binary produces a warning, it
      doesn't exit with zero status but 2 instead. Terrifying, but
      true. However, warnings may be ignored using '--ignore-warn'
      command line argument.  Moreover, in which case, the exit status
      will be zero.
      0eeedf52
    • O
      qemu: Remove the shared disk entry if the operation is ejecting or updating · d0172d2b
      Osier Yang 提交于
      For both AttachDevice and UpdateDevice APIs, if the disk device
      is 'cdrom' or 'floppy', the operations could be ejecting, updating,
      and inserting. For either ejecting or updating, the shared disk
      entry of the original disk src has to be removed, because it's
      not useful anymore.
      
      And since the original disk def will be changed, new disk def passed
      as argument will be free'ed in qemuDomainChangeEjectableMedia, so
      we need to copy the orignal disk def before
      qemuDomainChangeEjectableMedia, to use it for qemuRemoveSharedDisk.
      d0172d2b
    • O
      qemu: Move the shared disk adding and sgio setting prior to attaching · 0db7ff59
      Osier Yang 提交于
      The disk def could be free'ed by qemuDomainChangeEjectableMedia,
      which can thus cause crash if we reference the disk pointer. On
      the other hand, we have to remove the added shared disk entry from
      the table on error codepath.
      0db7ff59
    • O
      qemu: Record names of domain which uses the shared disk in hash table · a4504ac1
      Osier Yang 提交于
      The hash entry is changed from "ref" to {ref, @domains}. With this, the
      caller can simply call qemuRemoveSharedDisk, without afraid of removing
      the entry belongs to other domains. qemuProcessStart will obviously
      benifit from it on error codepath (which calls qemuProcessStop to do
      the cleanup).
      a4504ac1
    • O
      qemu: Merge qemuCheckSharedDisk into qemuAddSharedDisk · 371df778
      Osier Yang 提交于
      Based on moving various checking into qemuAddSharedDisk, this
      avoids the caller using it in wrong ways. Also this adds two
      new checking for qemuCheckSharedDisk (disk device not 'lun'
      and kernel doesn't support unpriv_sgio simply returns 0).
      371df778
    • O
      qemu: Add checking in helpers for sgio setting · dab878a8
      Osier Yang 提交于
      This moves the various checking into the helpers, to avoid the
      callers missing the checking.
      dab878a8
  2. 19 2月, 2013 1 次提交
  3. 13 2月, 2013 1 次提交
    • D
      Remove qemuDriverLock from almost everywhere · a9e97e0c
      Daniel P. Berrange 提交于
      With the majority of fields in the virQEMUDriverPtr struct
      now immutable or self-locking, there is no need for practically
      any methods to be using the QEMU driver lock. Only a handful
      of helper APIs in qemu_conf.c now need it
      a9e97e0c
  4. 11 2月, 2013 2 次提交
  5. 08 2月, 2013 4 次提交
  6. 06 2月, 2013 7 次提交
    • D
      Initialize qemuImageBinary path at startup · 0f5e3f13
      Daniel P. Berrange 提交于
      0f5e3f13
    • D
      Protect USB/PCI device list access in QEMU with dedicated locks · 011cf7ad
      Daniel P. Berrange 提交于
      Currently the activePciHostdevs, inactivePciHostdevsd and
      activeUsbHostdevs lists are all implicitly protected by the
      QEMU driver lock. Now that the lists all inherit from the
      virObjectLockable, we can make the locking explicit, removing
      the dependency on the QEMU driver lock for correctness.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      011cf7ad
    • D
      Convert virPCIDeviceList and virUSBDeviceList into virObjectLockable · 0f9ef558
      Daniel P. Berrange 提交于
      To allow modifications to the lists to be synchronized, convert
      virPCIDeviceList and virUSBDeviceList into virObjectLockable
      classes. The locking, however, will not be self-contained. The
      users of these classes will have to call virObjectLock/Unlock
      in the critical regions.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      0f9ef558
    • D
      Rename all USB device functions to have a standard name prefix · 77c3015f
      Daniel P. Berrange 提交于
      Rename all the usbDeviceXXX and usbXXXDevice APIs to have a
      fixed virUSBDevice name prefix
      77c3015f
    • D
      Rename all PCI device functions to have a standard name prefix · 20253560
      Daniel P. Berrange 提交于
      Rename all the pciDeviceXXX and pciXXXDevice APIs to have a
      fixed virPCIDevice name prefix
      20253560
    • D
      Remove pointless 'qemuVersion' field from virQEMUDriverPtr · b46f7f4a
      Daniel P. Berrange 提交于
      The QEMU driver struct has a 'qemuVersion' field that was previously
      used to cache the version lookup from capabilities. With the recent
      QEMU capabilities rewrite the caching happens at a lower level so
      this field is pointless. Removing it avoids worries about locking
      when updating it.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      b46f7f4a
    • D
      Merge virDomainObjListIsDuplicate into virDomainObjListAdd · eea87129
      Daniel P. Berrange 提交于
      The duplicate VM checking should be done atomically with
      virDomainObjListAdd, so shoud not be a separate function.
      Instead just use flags to indicate what kind of checks are
      required.
      
      This pair, used in virDomainCreateXML:
      
         if (virDomainObjListIsDuplicate(privconn->domains, def, 1) < 0)
           goto cleanup;
         if (!(dom = virDomainObjListAdd(privconn->domains,
                                         privconn->caps,
                                         def, false)))
           goto cleanup;
      
      Changes to
      
         if (!(dom = virDomainObjListAdd(privconn->domains,
                                         privconn->caps,
                                         def,
                                         VIR_DOMAIN_OBJ_LIST_ADD_CHECK_LIVE,
                                         NULL)))
           goto cleanup;
      
      This pair, used in virDomainRestoreFlags:
      
         if (virDomainObjListIsDuplicate(privconn->domains, def, 1) < 0)
           goto cleanup;
         if (!(dom = virDomainObjListAdd(privconn->domains,
                                         privconn->caps,
                                         def, true)))
           goto cleanup;
      
      Changes to
      
         if (!(dom = virDomainObjListAdd(privconn->domains,
                                         privconn->caps,
                                         def,
                                         VIR_DOMAIN_OBJ_LIST_ADD_LIVE |
                                         VIR_DOMAIN_OBJ_LIST_ADD_CHECK_LIVE,
                                         NULL)))
           goto cleanup;
      
      This pair, used in virDomainDefineXML:
      
         if (virDomainObjListIsDuplicate(privconn->domains, def, 0) < 0)
           goto cleanup;
         if (!(dom = virDomainObjListAdd(privconn->domains,
                                         privconn->caps,
                                         def, false)))
           goto cleanup;
      
      Changes to
      
         if (!(dom = virDomainObjListAdd(privconn->domains,
                                         privconn->caps,
                                         def,
                                         0, NULL)))
           goto cleanup;
      eea87129
  7. 05 2月, 2013 4 次提交
    • D
      Turn virDomainObjList into an opaque virObject · 37abd471
      Daniel P. Berrange 提交于
      As a step towards making virDomainObjList thread-safe turn it
      into an opaque virObject, preventing any direct access to its
      internals.
      
      As part of this a new method virDomainObjListForEach is
      introduced to replace all existing usage of virHashForEach
      37abd471
    • D
      Rename all domain list APIs to have virDomainObjList prefix · 4f6ed6c3
      Daniel P. Berrange 提交于
      The APIs names for accessing the domain list object are
      very inconsistent. Rename them all to have a standard
      virDomainObjList prefix.
      4f6ed6c3
    • D
      Introduce a virQEMUDriverConfigPtr object · b090aa7d
      Daniel P. Berrange 提交于
      Currently the virQEMUDriverPtr struct contains an wide variety
      of data with varying access needs. Move all the static config
      data into a dedicated virQEMUDriverConfigPtr object. The only
      locking requirement is to hold the driver lock, while obtaining
      an instance of virQEMUDriverConfigPtr. Once a reference is held
      on the config object, it can be used completely lockless since
      it is immutable.
      
      NB, not all APIs correctly hold the driver lock while getting
      a reference to the config object in this patch. This is safe
      for now since the config is never updated on the fly. Later
      patches will address this fully.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      b090aa7d
    • M
      qemu: Catch stderr of image decompression binary · cc6c425f
      Michal Privoznik 提交于
      If a decompression binary prints something to stderr, currently
      it is discarded. However, it can contain useful data from
      debugging POV, so we should catch it.
      cc6c425f
  8. 29 1月, 2013 1 次提交
  9. 25 1月, 2013 4 次提交
  10. 24 1月, 2013 2 次提交
  11. 22 1月, 2013 1 次提交
  12. 21 1月, 2013 2 次提交
  13. 18 1月, 2013 3 次提交
    • D
      Fix race condition when destroying guests · 81621f3e
      Daniel P. Berrange 提交于
      When running virDomainDestroy, we need to make sure that no other
      background thread cleans up the domain while we're doing our work.
      This can happen if we release the domain object while in the
      middle of work, because the monitor might detect EOF in this window.
      For this reason we have a 'beingDestroyed' flag to stop the monitor
      from doing its normal cleanup. Unfortunately this flag was only
      being used to protect qemuDomainBeginJob, and not qemuProcessKill
      
      This left open a race condition where either libvirtd could crash,
      or alternatively report bogus error messages about the domain already
      having been destroyed to the caller
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      81621f3e
    • P
      qemu: Simplify condition with already extracted flag · 5c13ed4f
      Peter Krempa 提交于
      5c13ed4f
    • V
      qemu: Double mutex unlock in qemuDomainModifyDeviceFlags · 56fd5134
      Viktor Mihajlovski 提交于
      The driver mutex was unlocked in qemuDomainModifyDeviceFlags before
      entering qemuDomainObjBeginJobWithDriver where it will be unlocked once
      more leaving it in an undefined state. The result was that two
      threads were simultaneously looking up the domain hash table during
      multiple parallel device attach/detach operations.
      Luckily this triggered a virHashIterationError.
      Signed-off-by: NViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
      56fd5134
  14. 16 1月, 2013 2 次提交