1. 21 2月, 2013 12 次提交
    • J
      qemu: Avoid deadlock in autodestroy · 568a6cda
      Jiri Denemark 提交于
      Since closeCallbacks were turned into virObjectLockable, we can no
      longer call virQEMUCloseCallbacks APIs from within a registered close
      callback.
      568a6cda
    • J
      qemu: Turn closeCallbacks into virObjectLockable · 3898ba7f
      Jiri Denemark 提交于
      To avoid having to hold the qemu driver lock while iterating through
      close callbacks and calling them. This fixes a real deadlock when a
      domain which is being migrated from another host gets autodestoyed as a
      result of broken connection to the other host.
      3898ba7f
    • G
      qemu: fix an off-by-one error in qemuDomainGetPercpuStats · 09183163
      Guannan Ren 提交于
      The max value of number of cpus to compute(id) should not
      be equal or greater than max cpu number.
      The bug ocurrs when id value is equal to max cpu number which
      leads to the off-by-one error in the following for loop.
      
       # virsh  cpu-stats guest --start 1
       error: Failed to virDomainGetCPUStats()
      
       error: internal error cpuacct parse error
      09183163
    • O
      qemu: Fix the memory leak · 5c9034bf
      Osier Yang 提交于
      Found by John Ferlan (coverity script)
      5c9034bf
    • J
      Remove a couple of misplaced VIR_FREE · 2bff35d5
      John Ferlan 提交于
      2bff35d5
    • 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
      d0e4b762
    • 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. 20 2月, 2013 3 次提交
    • J
      qemu: Do not ignore mandatory features in migration cookie · 69660042
      Jiri Denemark 提交于
      Due to "feature"/"features" nasty typo, any features marked as mandatory
      by one side of a migration are silently considered optional by the other
      side. The following is the code that formats mandatory features in
      migration cookie:
      
          for (i = 0 ; i < QEMU_MIGRATION_COOKIE_FLAG_LAST ; i++) {
              if (mig->flagsMandatory & (1 << i))
                  virBufferAsprintf(buf, "  <feature name='%s'/>\n",
                                    qemuMigrationCookieFlagTypeToString(i));
          }
      69660042
    • J
      qemu: switch PCI address alocation to use virDevicePCIAddress · bc28e56b
      Ján Tomko 提交于
      Some functions were using virDomainDeviceInfo where virDevicePCIAddress
      would suffice. Some were only using integers for slots and functions,
      assuming the bus numbers are always 0.
      
      Switch from virDomainDeviceInfoPtr to virDevicePCIAddressPtr:
      qemuPCIAddressAsString
      qemuDomainPCIAddressCheckSlot
      qemuDomainPCIAddressReserveAddr
      qemuDomainPCIAddressReleaseAddr
      
      Switch from int slot to virDevicePCIAddressPtr:
      qemuDomainPCIAddressReserveSlot
      qemuDomainPCIAddressReleaseSlot
      qemuDomainPCIAddressGetNextSlot
      
      Deleted functions (they would take the same parameters
      as ReserveAddr/ReleaseAddr do now.)
      qemuDomainPCIAddressReserveFunction
      qemuDomainPCIAddressReleaseFunction
      bc28e56b
    • J
      qemu: Use atomic ops for driver->nactive · 5d6f6367
      Jiri Denemark 提交于
      5d6f6367
  3. 19 2月, 2013 2 次提交
  4. 14 2月, 2013 2 次提交
    • L
      qemu: let virCommand set child process security labels/uid/gid · 0345c728
      Laine Stump 提交于
      The qemu driver had been calling virSecurityManagerSetProcessLabel()
      from a "pre-exec hook" function that is run after the child is forked,
      but before exec'ing qemu. This is problematic because the uid and gid
      of the child are set by the security driver, but capabilities are
      dropped by virCommand - such separation doesn't work; the two
      operations must be done together or the capabilities do not transfer
      properly to the child process.
      
      This patch switches to using virSecurityManagerSetChildProcessLabel(),
      which is called prior to virCommandRun() (rather than being called
      *during* virCommandrun() by the hook function), and doesn't set the
      UID/GID/security label directly, but instead merely informs virCommand
      what it should set them all to when the time is appropriate.
      
      This lets virCommand choose to do the uid/gid and caps dropping all at
      the same time if it wants (it does *want* to, but isn't doing so yet;
      that's for an upcoming patch).
      0345c728
    • L
      qemu: replace exec hook with virCommandSetUID/GID in qemuCaps* · 6a8ecc37
      Laine Stump 提交于
      Setting the uid/gid of the child process was the only thing done by
      the hook function in this case, and that can now be done more simply
      with virCommandSetUID/GID.
      6a8ecc37
  5. 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
  6. 12 2月, 2013 1 次提交
    • D
      Fix potential deadlock across fork() in QEMU driver · 61b52d2e
      Daniel P. Berrange 提交于
      The hook scripts used by virCommand must be careful wrt
      accessing any mutexes that may have been held by other
      threads in the parent process. With the recent refactoring
      there are 2 potential flaws lurking, which will become real
      deadlock bugs once the global QEMU driver lock is removed.
      
      Remove use of the QEMU driver lock from the hook function
      by passing in the 'virQEMUDriverConfigPtr' instance directly.
      
      Add functions to the virSecurityManager to be invoked before
      and after fork, to ensure the mutex is held by the current
      thread. This allows it to be safely used in the hook script
      in the child process.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      61b52d2e
  7. 11 2月, 2013 3 次提交
  8. 09 2月, 2013 1 次提交
  9. 08 2月, 2013 7 次提交
  10. 06 2月, 2013 8 次提交