1. 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
  2. 11 2月, 2013 2 次提交
  3. 08 2月, 2013 4 次提交
  4. 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
  5. 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
  6. 29 1月, 2013 1 次提交
  7. 25 1月, 2013 4 次提交
  8. 24 1月, 2013 2 次提交
  9. 22 1月, 2013 1 次提交
  10. 21 1月, 2013 2 次提交
  11. 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
  12. 16 1月, 2013 3 次提交
  13. 11 1月, 2013 2 次提交
  14. 08 1月, 2013 1 次提交
  15. 07 1月, 2013 3 次提交
    • O
      qemu: Check if the shared disk's cdbfilter conflicts with others · 1279e421
      Osier Yang 提交于
      This prevents domain starting and disk attaching if the shared disk's
      setting conflicts with other active domain(s), E.g. A domain with
      "sgio" set as "filtered", however, another active domain is using
      it set as "unfiltered".
      1279e421
    • O
      qemu: set unpriv_sgio when starting domain and attaching disk · 278f87c4
      Osier Yang 提交于
      This ignores the default "filtered" if unpriv_sgio is not supported
      by kernel, but for explicit request "filtered", it error out for
      domain starting.
      278f87c4
    • O
      qemu: Add a hash table for the shared disks · d7ead3e1
      Osier Yang 提交于
      This introduces a hash table for qemu driver, to store the shared
      disk's info as (@major:minor, @ref_count). @ref_count is the number
      of domains which shares the disk.
      
      Since we only care about if the disk support unprivileged SG_IO
      commands, and the SG_IO commands only make sense for block disk,
      this patch only manages (add/remove hash entry) the shared disk for
      block disk.
      
      * src/qemu/qemu_conf.h: (Add member 'sharedDisks' of type
                               virHashTablePtr; Declare helpers
                               qemuGetSharedDiskKey, qemuAddSharedDisk
                               and qemuRemoveSharedDisk)
      * src/qemu/qemu_conf.c (Implement the 3 helpers)
      * src/qemu/qemu_process.c (Update 'sharedDisks' when domain
                                 starting and shutdown)
      * src/qemu/qemu_driver.c (Update 'sharedDisks' when attaching
                                or detaching disk).
      d7ead3e1