1. 13 8月, 2012 6 次提交
  2. 12 8月, 2012 1 次提交
  3. 15 6月, 2012 28 次提交
    • P
      qemu: Enable disconnecting SPICE clients without changing password · e6c5ae46
      Peter Krempa 提交于
      Libvirt updates the configuration of SPICE server only when something
      changes. This is unfortunate when the user wants to disconnect a
      existing spice session when the connected attribute is already
      "disconnect".
      
      This patch modifies the conditions for calling the password updater to
      be called when nothing changes, but the connected attribute is already
      "disconnect".
      (cherry picked from commit e0f0131d)
      e6c5ae46
    • P
      qemu: Fix off-by-one error while unescaping monitor strings · 0889bdb8
      Peter Krempa 提交于
      While unescaping the commands the commands passed through to the monitor
      function qemuMonitorUnescapeArg() initialized lenght of the input string
      to strlen()+1 which is fine for alloc but not for iteration of the
      string.
      
      This patch fixes the off-by-one error and drops the pointless check for
      a single trailing slash that is automaticaly handled by the default
      branch of switch.
      (cherry picked from commit 0f4660c8)
      0889bdb8
    • M
      qemu: Don't overwrite security labels · dd85b621
      Michal Privoznik 提交于
      Currently, if qemuProcessStart fail at some point, e.g. because
      domain being started wants a PCI/USB device already assigned to
      a different domain, we jump to cleanup label where qemuProcessStop
      is performed. This unconditionally calls virSecurityManagerRestoreAllLabel
      which is wrong because the other domain is still using those devices.
      
      However, once we successfully label all devices/paths in
      qemuProcessStart() from that point on, we have to perform a rollback
      on failure - that is - we have to virSecurityManagerRestoreAllLabel.
      (cherry picked from commit 86032b22)
      
      Conflicts:
      
      	src/qemu/qemu_process.c
      dd85b621
    • M
      qemuProcessStop: Switch to flags · 9225f9e1
      Michal Privoznik 提交于
      Currently, we are passing only one boolean (migrated) so there is
      no real profit in this. But it creates starting position for
      next patch.
      (cherry picked from commit 69dd7714)
      
      Conflicts:
      
      	src/qemu/qemu_process.c
      9225f9e1
    • G
      Only check for cluster fs if we're using a filesystem · 95ae1a06
      Guido Günther 提交于
      otherwise migration fails for e.g. network filesystems like sheepdog
      with:
      
         error: Invalid relative path 'virt-name': Invalid argument
      
      while we should fail with:
      
          Migration may lead to data corruption if disks use cache != none
      
      References:
      
          http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=676328
          https://www.redhat.com/archives/libvirt-users/2012-May/msg00088.html
      (cherry picked from commit 3ac8fb54)
      95ae1a06
    • L
      Assign correct address type to spapr-vlan and spapr-vty. · 5840d413
      Li Zhang 提交于
      For pseries guest, spapr-vlan and spapr-vty is based
      on spapr-vio address. According to model of network
      device, the address type should be assigned automatically.
      For serial device, serial pty device is recognized as
      spapr-vty device, which is also on spapr-vio.
      
      So this patch is to correct the address type of
      spapr-vlan and spapr-vty, and build correct
      command line of spapr-vty.
      Signed-off-by: NLi Zhang <zhlcindy@linux.vnet.ibm.com>
      Reviewed-by:   Michael Ellerman<michaele@au1.ibm.com>
      (cherry picked from commit 04a319ba)
      5840d413
    • B
      Fix for parallel port passthrough for QEMU · b24a9f3e
      Beat Jörg 提交于
      I came across a bug that the command line generated for passthrough
      of the host parallel port /dev/parport0 by libvirt for QEMU is incorrect.
      
      It currently produces:
      -chardev tty,id=charparallel0,path=/dev/parport0
      -device isa-parallel,chardev=charparallel0,id=parallel0
      
      The first parameter is "tty". It sould be "parport".
      
      If I launch qemu with -chardev parport,... it works as expected.
      
      I have already filled a bug report (
      https://bugzilla.redhat.com/show_bug.cgi?id=823879 ), the topic was
      already on the list some months ago:
      
      https://www.redhat.com/archives/libvirt-users/2011-September/msg00095.htmlSigned-off-by: NEric Blake <eblake@redhat.com>
      (cherry picked from commit 7508338f)
      b24a9f3e
    • L
      qemu: fix netdev alias name assignment wrt type='hostdev' · 5b3c3560
      Laine Stump 提交于
      This patch resolves:
      
         https://bugzilla.redhat.com/show_bug.cgi?id=827519
      
      The problem is that an interface with type='hostdev' will have an
      alias of the form "hostdev%d", while the function that looks through
      existing netdevs to determine the name to use for a new addition will
      fail if there's an existing entry that does not match the form
      "net%d".
      
      This is another of the handful of places that need an exception due to
      the hybrid nature of <interface type='hostdev'> (which is not exactly
      an <interface> or a <hostdev>, but is both at the same time).
      (cherry picked from commit 6734ce7b)
      5b3c3560
    • W
      qemu: avoid closing fd more than once · 4e1e20c3
      Wen Congyang 提交于
      If we migrate to fd, spec->fwdType is not MIGRATION_FWD_DIRECT,
      we will close spec->dest.fd.local in qemuMigrationRun(). So we
      should set spec->dest.fd.local to -1 in qemuMigrationRun().
      
      Bug present since 0.9.5 (commit 32617617).
      (cherry picked from commit b19c236d)
      4e1e20c3
    • W
      avoid closing uninitialized fd · ab73fe59
      Wen Congyang 提交于
      If the system does not support bypass cache, we will close fd,
      but it is uninitialized.
      (cherry picked from commit 0a045f01)
      ab73fe59
    • S
      leak_fix.diff · c82cbf1d
      Stefan Berger 提交于
      ==3240== 23 bytes in 1 blocks are definitely lost in loss record 242 of 744
      ==3240==    at 0x4C2A4CD: malloc (vg_replace_malloc.c:236)
      ==3240==    by 0x8077537: __vasprintf_chk (vasprintf_chk.c:82)
      ==3240==    by 0x509C677: virVasprintf (stdio2.h:199)
      ==3240==    by 0x509C733: virAsprintf (util.c:1912)
      ==3240==    by 0x1906583A: qemudStartup (qemu_driver.c:679)
      ==3240==    by 0x511991D: virStateInitialize (libvirt.c:809)
      ==3240==    by 0x40CD84: daemonRunStateInit (libvirtd.c:751)
      ==3240==    by 0x5098745: virThreadHelper (threads-pthread.c:161)
      ==3240==    by 0x7953D8F: start_thread (pthread_create.c:309)
      ==3240==    by 0x805FF5C: clone (clone.S:115)
      
      (cherry picked from commit 67dd486f)
      c82cbf1d
    • D
      Re-order config options in qemu driver augeas lens · 9096dc1a
      Daniel P. Berrange 提交于
      Currently all the config options are listed under a 'vnc_entry'
      group. Create a bunch of new groups & move options to the
      right place
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      (cherry picked from commit 6c10c04c)
      9096dc1a
    • D
      Fix mistakes in augeas lens · cb724f8d
      Daniel P. Berrange 提交于
      Add nmissing 'host_uuid' entry to libvirtd.conf lens and
      rename spice_passwd to spice_password in qemu.conf lens
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      (cherry picked from commit a9c779ca)
      cb724f8d
    • D
      Standardize whitespace used in example config files · af57c143
      Daniel P. Berrange 提交于
      Instead of doing
      
        # example_config
      
      use
      
        #example_config
      
      so it is possible to programatically uncomment example config
      options, as distinct from their comment/descriptions
      
      Also delete rogue trailing comma not allowed by lens
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      (cherry picked from commit c5c3278e)
      
      (crobinso: Fix spacing to appease tests/daemon-conf, which is
       still in -maint branch)
      af57c143
    • D
      qemu augeas: Add spice_tls/spice_tls_x509_cert_dir · 7fba39bc
      Douglas Schilling Landgraf 提交于
      If vdsm is installed and configured in Fedora 17, we add the following
      items into qemu.conf:
      
      spice_tls=1
      spice_tls_x509_cert_dir="/etc/pki/vdsm/libvirt-spice"
      
      However, after this changes, augtool cannot identify qemu.conf anymore.
      (cherry picked from commit cdd762e4)
      7fba39bc
    • P
      qemu_hotplug: Don't free the PCI device structure after hot-unplug · 3600eec4
      Peter Krempa 提交于
      The pciDevice structure corresponding to the device being hot-unplugged
      was freed after it was "stolen" from activeList. The pointer was still
      used for eg-inactive list. This patch removes the free of the structure
      and frees it only if reset fails on the device.
      (cherry picked from commit db19417f)
      3600eec4
    • D
      Fix potential events deadlock when unref'ing virConnectPtr · fc8700e9
      Daniel P. Berrange 提交于
      When the last reference to a virConnectPtr is released by
      libvirtd, it was possible for a deadlock to occur in the
      virDomainEventState functions. The virDomainEventStatePtr
      holds a reference on virConnectPtr for each registered
      callback. When removing a callback, the virUnrefConnect
      function is run. If this causes the last reference on the
      virConnectPtr to be released, then virReleaseConnect can
      be run, which in turns calls qemudClose. This function has
      a call to virDomainEventStateDeregisterConn which is intended
      to remove all callbacks associated with the virConnectPtr
      instance. This will try to grab a lock on virDomainEventState
      but this lock is already held. Deadlock ensues
      
      Thread 1 (Thread 0x7fcbb526a840 (LWP 23185)):
      
      Since each callback associated with a virConnectPtr holds a
      reference on virConnectPtr, it is impossible for the qemudClose
      method to be invoked while any callbacks are still registered.
      Thus the call to virDomainEventStateDeregisterConn must in fact
      be a no-op. Thus it is possible to just remove all trace of
      virDomainEventStateDeregisterConn and avoid the deadlock.
      
      * src/conf/domain_event.c, src/conf/domain_event.h,
        src/libvirt_private.syms: Delete virDomainEventStateDeregisterConn
      * src/libxl/libxl_driver.c, src/lxc/lxc_driver.c,
        src/qemu/qemu_driver.c, src/uml/uml_driver.c: Remove
        calls to virDomainEventStateDeregisterConn
      (cherry picked from commit 2cb0899e)
      fc8700e9
    • M
      qemu: Don't delete USB device on failed qemuPrepareHostdevUSBDevices · e240feae
      Michal Privoznik 提交于
      If qemuPrepareHostdevUSBDevices fail it will roll back devices added
      to the driver list of used devices. However, if it may fail because
      the device is being used already. But then again - with roll back.
      Therefore don't try to remove a usb device manually if the function
      fail. Although, we want to remove the device if any operation
      performed afterwards fail.
      (cherry picked from commit 9c484e3d)
      e240feae
    • M
      qemu: Rollback on used USB devices · 5b66c62d
      Michal Privoznik 提交于
      One of our latest USB device handling patches
      05abd150 introduced a regression.
      That is, we first create a temporary list of all USB devices that
      are to be used by domain just starting up. Then we iterate over and
      check if a device from the list is in the global list of currently
      assigned devices (activeUsbHostdevs). If not, we add it there and
      continue with next iteration then. But if a device from temporary
      list is either taken already or adding to the activeUsbHostdevs fails,
      we remove all devices in temp list from the activeUsbHostdevs list.
      Therefore, if a device is already taken we remove it from
      activeUsbHostdevs even if we should not. Thus, next time we allow
      the device to be assigned to another domain.
      (cherry picked from commit 2f5fdc88)
      5b66c62d
    • D
      Fix logic for assigning PCI addresses to USB2 companion controllers · 19d30902
      Daniel P. Berrange 提交于
      Currently each USB2 companion controller gets put on a separate
      PCI slot. Not only is this wasteful of PCI slots, but it is not
      in compliance with the spec for USB2 controllers. The master
      echi1 and all companion controllers should be in the same slot,
      with echi1 in function 7, and uhci1-3 in functions 0-2 respectively.
      
      * src/qemu/qemu_command.c: Special case handling of USB2 controllers
        to apply correct pci slot assignment
      * tests/qemuxml2argvdata/qemuxml2argv-usb-ich9-ehci-addr.args,
        tests/qemuxml2argvdata/qemuxml2argv-usb-ich9-ehci-addr.xml: Expand
        test to cover automatic slot assignment
      (cherry picked from commit 1ebd52cb)
      
      Conflicts:
      
      	tests/qemuxml2xmltest.c
      19d30902
    • O
      qemu: Use the CPU index in capabilities to map NUMA node to cpu list. · e88212d5
      Osier Yang 提交于
      On some of the NUMA platforms, the CPU index in each NUMA node
      grows non-consecutive. While on other platforms, it can be inconsecutive,
      E.g.
      
      % numactl --hardware
      available: 4 nodes (0-3)
      node 0 cpus: 0 4 8 12 16 20 24 28
      node 0 size: 131058 MB
      node 0 free: 86531 MB
      node 1 cpus: 1 5 9 13 17 21 25 29
      node 1 size: 131072 MB
      node 1 free: 127070 MB
      node 2 cpus: 2 6 10 14 18 22 26 30
      node 2 size: 131072 MB
      node 2 free: 127758 MB
      node 3 cpus: 3 7 11 15 19 23 27 31
      node 3 size: 131072 MB
      node 3 free: 127226 MB
      node distances:
      node   0   1   2   3
        0:  10  20  20  20
        1:  20  10  20  20
        2:  20  20  10  20
        3:  20  20  20  10
      
      This patch is to fix the problem by using the CPU index in
      caps->host.numaCell[i]->cpus[i] to set the bitmask instead of
      assuming the CPU index of the NUMA nodes are always sequential.
      (cherry picked from commit d1bdeca8)
      e88212d5
    • L
      Assign spapr-vio bus address to ibmvscsi controller · d8a1c6b7
      Li Zhang 提交于
      For pseries guest, the default controller model is
      ibmvscsi controller, this controller only can work
      on spapr-vio address.
      
      This patch is to assign spapr-vio address type to
      ibmvscsi controller and correct vscsi test case.
      Signed-off-by: NLi Zhang <zhlcindy@linux.vnet.ibm.com>
      (cherry picked from commit bb725ac1)
      d8a1c6b7
    • P
      qemu: Don't skip detection of virtual cpu's on non KVM targets · ecd9a50b
      Peter Krempa 提交于
      This patch lifts the limit of calling thread detection code only on KVM
      guests. With upstream qemu the thread mappings are reported also on
      non-KVM machines.
      
      QEMU adopted the thread_id information from the kvm branch.
      
      To remain compatible with older upstream versions of qemu the check is
      attempted but the failure to detect threads (or even run the monitor
      command - on older versions without SMP support) is treated non-fatal
      and the code reports one vCPU with pid of the hypervisor (in same
      fashion this was done on non-KVM guests).
      (cherry picked from commit c8335269)
      ecd9a50b
    • P
      qemu: Re-detect virtual cpu threads after cpu hot (un)plug. · 6ef9ea9b
      Peter Krempa 提交于
      After a cpu hotplug the qemu driver did not refresh information about
      virtual processors used by qemu and their corresponding threads. This
      patch forces a re-detection as is done on start of QEMU.
      
      This ensures that correct information is reported by the
      virDomainGetVcpus API and "virsh vcpuinfo".
      
      A failure to obtain the thread<->vcpu mapping is treated non-fatal and
      the mapping is not updated in a case of failure as not all versions of
      QEMU report this in the info cpus command.
      (cherry picked from commit 3163682b)
      6ef9ea9b
    • P
      qemu: Refactor qemuDomainSetVcpusFlags · a0be049f
      Peter Krempa 提交于
      This patch changes a switch statement into ifs when handling live vs.
      configuration modifications getting rid of redundant code in case when
      both live and persistent configuration gets changed.
      (cherry picked from commit e99ad93d)
      a0be049f
    • G
      usb: fix crash when failing to attach a second usb device · 48b9eb2d
      Guannan Ren 提交于
      when failing to attach another usb device to a domain for some reason
      which has one use device attached before, the libvirtd crashed.
      The crash is caused by null-pointer dereference error in invoking
      usbDeviceListSteal passed in NULL value usb variable.
      commit 05abd150 introduces the bug.
      (cherry picked from commit ab5fb8f3)
      48b9eb2d
    • E
      qemu: fix build when !HAVE_NUMACTL · d8978c90
      Eric Blake 提交于
      Commit 97010eb1 forgot to change the other side of an #ifdef.
      
      * src/qemu/qemu_process.c (qemuProcessInitNumaMemoryPolicy): Add
      argument.
      (cherry picked from commit 5c650b98)
      d8978c90
    • E
      snapshot: allow block devices past cgroup · 1d3218ab
      Eric Blake 提交于
      It turns out that when cgroups are enabled, the use of a block device
      for a snapshot target was failing with EPERM due to libvirt failing
      to add the block device to the cgroup whitelist.  See also
      https://bugzilla.redhat.com/show_bug.cgi?id=810200
      
      * src/qemu/qemu_driver.c
      (qemuDomainSnapshotCreateSingleDiskActive)
      (qemuDomainSnapshotUndoSingleDiskActive): Account for cgroup.
      (qemuDomainSnapshotCreateDiskActive): Update caller.
      (cherry picked from commit 8be304ec)
      1d3218ab
  4. 14 6月, 2012 5 次提交
    • G
      qemu: call usb search function for hostdev initialization and hotplug · d617c987
      Guannan Ren 提交于
      src/qemu/qemu_hostdev.c:
      refactor qemuPrepareHostdevUSBDevices function, make it focus on
      adding usb device to activeUsbHostdevs after check. After that,
      the usb hotplug function qemuDomainAttachHostDevice also could use
      it.
      expand qemuPrepareHostUSBDevices to perform the usb search,
      rollback on failure.
      
      src/qemu/qemu_hotplug.c:
      If there are multiple usb devices available with same vendorID and productID,
      but with different value of "bus, device", we give an error to let user
      use <address> to specify the desired one.
      (cherry picked from commit 05abd150)
      d617c987
    • G
      usb: create functions to search usb device accurately · 18c14916
      Guannan Ren 提交于
      usbFindDevice():get usb device according to
                      idVendor, idProduct, bus, device
                      it is the exact match of the four parameters
      
      usbFindDeviceByBus():get usb device according to bus, device
                        it returns only one usb device same as usbFindDevice
      
      usbFindDeviceByVendor():get usb device according to idVendor,idProduct
                           it probably returns multiple usb devices.
      
      usbDeviceSearch(): a helper function to do the actual search
      (cherry picked from commit 9914477e)
      18c14916
    • J
      qemu: Emit compatible XML when migrating a domain · f6936215
      Jiri Denemark 提交于
      When we added the default USB controller into domain XML, we efficiently
      broke migration to older versions of libvirt that didn't support USB
      controllers at all (0.9.4 and earlier) even for domains that don't use
      anything that the older libvirt can't provide. We still want to present
      the default USB controller in any XML seen by a user/app but we can
      safely remove it from the domain XML used during migration. If we are
      migrating to a new enough libvirt, it will add the controller XML back,
      while older libvirt won't be confused with it although it will still
      tell qemu to create the controller.
      
      Similar approach can be used in the future whenever we find out we
      always enabled some kind of device without properly advertising it in
      domain XML.
      (cherry picked from commit 409b5f54)
      f6936215
    • J
      qemu: Don't use virDomainDefFormat* directly · 68563e7a
      Jiri Denemark 提交于
      Always use appropriate qemuDomain{,Def}Format wrapper since it may do
      some additional magic based on the flags.
      (cherry picked from commit cd603008)
      68563e7a
    • E
      qemu: reject blockiotune if qemu too old · b5f86fc0
      Eric Blake 提交于
      Commit 4c82f09e added a capability check for qemu per-device io
      throttling, but only applied it to domain startup.  As mentioned
      in the previous commit (98cec052), the user can still get an 'internal
      error' message during a hotplug attempt, when the monitor command
      doesn't exist.  It is confusing to allow tuning on inactive domains
      only to then be rejected when starting the domain.
      
      * src/qemu/qemu_driver.c (qemuDomainSetBlockIoTune): Reject
      offline tuning if online can't match it.
      (cherry picked from commit 13f9a193)
      b5f86fc0