1. 28 2月, 2013 3 次提交
    • D
      Avoid spamming logs with cgroups warnings · 279336c5
      Daniel P. Berrange 提交于
      The code for putting the emulator threads in a separate cgroup
      would spam the logs with warnings
      
      2013-02-27 16:08:26.731+0000: 29624: warning : virCgroupMoveTask:887 : no vm cgroup in controller 3
      2013-02-27 16:08:26.731+0000: 29624: warning : virCgroupMoveTask:887 : no vm cgroup in controller 4
      2013-02-27 16:08:26.732+0000: 29624: warning : virCgroupMoveTask:887 : no vm cgroup in controller 6
      
      This is because it has only created child cgroups for 3 of the
      controllers, but was trying to move the processes from all the
      controllers. The fix is to only try to move threads in the
      controllers we actually created. Also remove the warning and
      make it return a hard error to avoid such lazy callers in the
      future.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      279336c5
    • D
      Fix autodestroy of QEMU guests · b4a124ef
      Daniel P. Berrange 提交于
      The virQEMUCloseCallbacksRunOne method was passing a uuid string
      to virDomainObjListFindByUUID, when it actually expected to get
      a raw uuid buffer. This was not caught by the compiler because
      the method was using a 'void *uuid' instead of first casting
      it to the expected type.
      
      This regression was accidentally caused by refactoring in
      
        commit 568a6cda
        Author: Jiri Denemark <jdenemar@redhat.com>
        Date:   Fri Feb 15 15:11:47 2013 +0100
      
          qemu: Avoid deadlock in autodestroy
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      b4a124ef
    • E
      qemu: -numa doesn't (yet) support disjoint range · 25dc8ba0
      Eric Blake 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=896092 mentions that
      qemu 1.4 and earlier only accept a simple start-stop range for
      the cpu=... argument of -numa.  Libvirt would attempt to use
      -numa cpu=1,3 for a disjoint range, which did not work as intended.
      
      Upstream qemu will be adding a new syntax for disjoint cpu ranges
      in 1.5; but the design for that syntax is still under discussion
      at the time of this patch.  So for libvirt 1.0.3, it is safest to
      just reject attempts to build an invalid qemu command line; in the
      future, we can add a capability bit and translate to the final
      accepted design for selecting a disjoint cpu range in numa.
      
      * src/qemu/qemu_command.c (qemuBuildNumaArgStr): Reject disjoint
      ranges.
      25dc8ba0
  2. 27 2月, 2013 1 次提交
    • D
      Fix crash changing CDROM media · 02b90972
      Daniel P. Berrange 提交于
      This change tried to fix a crash with changing CDROM media but
      failed to actually do so
      
        commit d0172d2b
        Author: Osier Yang <jyang@redhat.com>
        Date:   Tue Feb 19 20:27:45 2013 +0800
      
          qemu: Remove the shared disk entry if the operation is ejecting or updating
      
      It was still accessing disk->src, when the entire 'disk' object
      has been free'd already. Even if it weren't free'd, accessing
      the 'src' value of virDomainDiskDef is not allowed without
      first validating disk->type is file or block. Just remove the
      broken code entirely.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      02b90972
  3. 26 2月, 2013 4 次提交
    • P
      qemu: do not set unpriv_sgio if neither supported nor requested · 45dc3f17
      Paolo Bonzini 提交于
      Currently we call virSetDeviceUnprivSGIO with val == 0 if a block device
      has an sgio attribute.  But for sgio='filtered', we know that a
      kernel with no unpriv_sgio support will always behave as the user
      wanted.  In this case, there is no need to call the function and
      report a (bogus) error.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      45dc3f17
    • E
      qemu: minor monitor lock cleanups · 6abd5ea1
      Eric Blake 提交于
      If virCondInit fails (okay, so that's unlikely), then we end up
      attempting a virObjectUnlock() on the cleanup path, even though
      we don't hold a lock.  This is not guaranteed to be safe.  While
      at it, I noticed a couple places where we were referencing mon->fd
      outside locks.
      
      * src/qemu/qemu_monitor.c (qemuMonitorOpenInternal): Minimize lock
      duration.  mon->watch doesn't need clean up on error.
      (qemuMonitorGetBlockExtent, qemuMonitorBlockResize): Don't
      dereference fd outside of lock.
      6abd5ea1
    • E
      qemu: don't override earlier json error · 29424d1a
      Eric Blake 提交于
      I built without yajl support, and noticed a strange failure message
      in qemumonitorjsontest:
      
      2013-02-22 16:12:37.503+0000: 19812: error : virJSONValueToString:1119 : internal error No JSON parser implementation is available
      2013-02-22 16:12:37.503+0000: 19812: error : qemuMonitorJSONCommandWithFd:253 : out of memory
      
      While a later patch will fix the test to skip when json is not present,
      this patch avoids overriding the more useful error message from
      virJSONValueToString returning NULL.
      
      * src/qemu/qemu_monitor_json.c (qemuMonitorJSONCommandWithFd):
      Don't override message.
      (qemuMonitorJSONCheckError): Don't print NULL.
      * src/qemu/qemu_agent.c (qemuAgentCommand): Don't override message.
      (qemuAgentCheckError): Don't print NULL.
      (qemuAgentArbitraryCommand): Properly fail on OOM.
      29424d1a
    • P
      qemu: Refactor qemuDomainSetMemoryParameters · 19c6ad9a
      Peter Krempa 提交于
      The new TypedParam helper APIs allow to simplify this function
      significantly.
      
      This patch integrates the fix in 75e5bec9
      by correctly ordering the setting functions instead of reordering the
      parameters.
      19c6ad9a
  4. 25 2月, 2013 2 次提交
    • P
      qemu: Implement support for EGD backend for virtio-rng · 820019fc
      Peter Krempa 提交于
      This patch adds a new capability bit QEMU_CAPS_OBJECT_RNG_EGD and code
      to support the egd backend for the VirtIO RNG device.
      
      The device is added by 3 qemu command line options:
      -chardev socket,id=charrng0,host=1.2.3.4,port=1234 (communication
                                                          backend)
      -object rng-egd,chardev=charrng0,id=rng0 (RNG protocol client)
      -device virtio-rng-pci,rng=rng0,bus=pci.0,addr=0x4 (the RNG device)
      820019fc
    • P
      qemu: Implement support for default 'random' backend for virtio-rng · 234a5560
      Peter Krempa 提交于
      This patch implements support for the virtio-rng-pci device and the
      rng-random backend in qemu.
      
      Two capabilities bits are added to track support for those:
      
      QEMU_CAPS_DEVICE_VIRTIO_RNG - for the device support and
      QEMU_CAPS_OBJECT_RNG_RANDOM - for the backend support.
      
      qemu is invoked with these additional parameters if the device is
      enabled:
      
      -object rng-random,id=rng0,filename=/test/phile (to add the backend)
      -device virtio-rng-pci,rng=rng0,bus=pci.0,addr=0x4 (to add the device)
      234a5560
  5. 23 2月, 2013 13 次提交
  6. 22 2月, 2013 1 次提交
  7. 21 2月, 2013 13 次提交
  8. 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