1. 12 6月, 2012 3 次提交
    • M
      qemu: Don't overwrite security labels · 86032b22
      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.
      86032b22
    • M
      qemuProcessStop: Switch to flags · 69dd7714
      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.
      69dd7714
    • E
      snapshot: implement new APIs for qemu · e3559a6e
      Eric Blake 提交于
      The two APIs are rather trivial; based on bits and pieces of other
      existing APIs.  It leaves the door open for future extension to
      qemu to report snapshots without metadata based on reading qcow2
      internal snapshot names.
      
      * src/qemu/qemu_driver.c (qemuDomainSnapshotIsCurrent)
      (qemuDomainSnapshotHasMetadata): New functions.
      e3559a6e
  2. 09 6月, 2012 1 次提交
  3. 08 6月, 2012 1 次提交
    • L
      Assign correct address type to spapr-vlan and spapr-vty. · 04a319ba
      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>
      04a319ba
  4. 07 6月, 2012 1 次提交
    • M
      qemu: better detection of crashed domains · bda2f17d
      Martin Kletzander 提交于
      When libvirtd is started and there is an unusable/not-connectable
      leftover from earlier started machine, it's more reasonable to say
      that the machine "crashed" if we know it was started with
      "-no-shutdown".
      This patch fixes that and also changes the other result (when machine
      was started without "-no-shutdown") to "unknown", because the previous
      "failed" reason means (according to include/libvirt/libvirt.h.in:174),
      that the machine failed to start.
      bda2f17d
  5. 05 6月, 2012 1 次提交
  6. 02 6月, 2012 2 次提交
    • M
      qemu: move -name arg to be 1st in "ps x" output · 195fa214
      Marti Raudsepp 提交于
      Currently, monitoring QEMU virtual machines with standard Unix
      sysadmin tools is harder than it has to be. The QEMU command line is
      often miles long and mostly redundant, it's hard to tell which process
      is which.
      
      This patch reorders the QEMU -name argument to be the first, so it's
      immediately visible in "ps x", htop and "atop -c" output.
      195fa214
    • L
      qemu: fix netdev alias name assignment wrt type='hostdev' · 6734ce7b
      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).
      6734ce7b
  7. 31 5月, 2012 2 次提交
    • W
      qemu: avoid closing fd more than once · b19c236d
      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).
      b19c236d
    • W
      avoid closing uninitialized fd · 0a045f01
      Wen Congyang 提交于
      If the system does not support bypass cache, we will close fd,
      but it is uninitialized.
      0a045f01
  8. 29 5月, 2012 1 次提交
    • S
      leak_fix.diff · 67dd486f
      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)
      67dd486f
  9. 28 5月, 2012 5 次提交
  10. 25 5月, 2012 1 次提交
  11. 24 5月, 2012 1 次提交
    • D
      Split QEMU dtrace probes into separate file · a4e45a06
      Daniel P. Berrange 提交于
      When building as driver modules, it is not possible for the QEMU
      driver module to reference the DTrace/SystemTAP probes linked into
      the main libvirt.so. Thus we need to move the QEMU probes into a
      separate file 'libvirt_qemu_probes.d'. Also rename the existing
      file from 'probes.d' to 'libvirt_probes.d' while we're at it
      
      * daemon/Makefile.am, src/internal.h: Include libvirt_probes.h
        instead of probes.h
      * src/Makefile.am: Add rules for libvirt_qemu_probes.d
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor_json.c,
        src/qemu/qemu_monitor_text.c: Include libvirt_qemu_probes.h
      * src/libvirt_probes.d: Rename from probes.d
      * src/libvirt_qemu_probes.d: QEMU specific probes formerly
        in probes.d
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      a4e45a06
  12. 23 5月, 2012 1 次提交
    • P
      qemu_hotplug: Don't free the PCI device structure after hot-unplug · db19417f
      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.
      db19417f
  13. 22 5月, 2012 1 次提交
    • D
      Fix potential events deadlock when unref'ing virConnectPtr · 2cb0899e
      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
      2cb0899e
  14. 18 5月, 2012 3 次提交
  15. 17 5月, 2012 1 次提交
    • M
      qemu: Don't delete USB device on failed qemuPrepareHostdevUSBDevices · 9c484e3d
      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.
      9c484e3d
  16. 16 5月, 2012 4 次提交
    • M
      qemu: Rollback on used USB devices · 2f5fdc88
      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.
      2f5fdc88
    • D
      Pass the virt driver name into security drivers · 73580c60
      Daniel Walsh 提交于
      To allow the security drivers to apply different configuration
      information per hypervisor, pass the virtualization driver name
      into the security manager constructor.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      73580c60
    • J
      qemu: Add support for -no-user-config · 63b42436
      Jiri Denemark 提交于
      Thanks to this new option we are now able to use modern CPU models (such
      as Westmere) defined in external configuration file.
      
      The qemu-1.1{,-device} data files for qemuhelptest are filled in with
      qemu-1.1-rc2 output for now. I will update those files with real
      qemu-1.1 output once it is released.
      63b42436
    • D
      Fix logic for assigning PCI addresses to USB2 companion controllers · 1ebd52cb
      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
      1ebd52cb
  17. 15 5月, 2012 3 次提交
    • O
      qemu: Set memory policy using cgroup if placement is auto · be9f6ecb
      Osier Yang 提交于
      Like for 'static' placement, when the memory policy mode is
      'strict', set the memory policy by writing the advisory nodeset
      returned from numad to cgroup file cpuset.mems,
      be9f6ecb
    • O
      qemu: Use the CPU index in capabilities to map NUMA node to cpu list. · d1bdeca8
      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.
      d1bdeca8
    • L
      Assign spapr-vio bus address to ibmvscsi controller · bb725ac1
      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>
      bb725ac1
  18. 14 5月, 2012 2 次提交
    • E
      build: really silence the 32-bit warning · 5f89c860
      Eric Blake 提交于
      Commit cdce2f42 tried to silence a compiler warning on 32-bit builds,
      but the gcc shipped with RHEL 5 is old enough that the type conversion
      via multiplication by 1 was insufficient for the task.
      
      * src/qemu/qemu_monitor.c (qemuMonitorBlockJob): Previous attempt
      didn't get past all gcc versions.
      5f89c860
    • W
      Use XDG Base Directories instead of storing in home directory · 32a9aac2
      William Jon McCann 提交于
      As defined in:
      http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
      
      This offers a number of advantages:
       * Allows sharing a home directory between different machines, or
      sessions (eg. using NFS)
       * Cleanly separates cache, runtime (eg. sockets), or app data from
      user settings
       * Supports performing smart or selective migration of settings
      between different OS versions
       * Supports reseting settings without breaking things
       * Makes it possible to clear cache data to make room when the disk
      is filling up
       * Allows us to write a robust and efficient backup solution
       * Allows an admin flexibility to change where data and settings are stored
       * Dramatically reduces the complexity and incoherence of the
      system for administrators
      32a9aac2
  19. 11 5月, 2012 4 次提交
    • P
      qemu: Don't skip detection of virtual cpu's on non KVM targets · c8335269
      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).
      c8335269
    • P
      qemu: Re-detect virtual cpu threads after cpu hot (un)plug. · 3163682b
      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.
      3163682b
    • P
      qemu: Refactor qemuDomainSetVcpusFlags · e99ad93d
      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.
      e99ad93d
    • G
      usb: fix crash when failing to attach a second usb device · ab5fb8f3
      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.
      ab5fb8f3
  20. 10 5月, 2012 1 次提交
  21. 09 5月, 2012 1 次提交