1. 15 6月, 2012 40 次提交
    • E
      build: silence warning from autoconf · 37b07d90
      Eric Blake 提交于
      Autoconf 2.60 and later insist on using ${datarootdir}, rather than
      the derived ${datadir} (although the latter defaults to the former,
      it is possible to set configure arguments so that they differ):
      
      config.status: creating libvirt.pc
      config.status: WARNING:  'libvirt.pc.in' seems to ignore the --datarootdir setting
      
      This patch follows the autoconf manual's suggestions for how to
      support 2.59 (RHEL 5) and newer simultaneously.
      
      * libvirt.pc.in (datarootdir): Define, so ${datadir} will not ignore
      datarootdir when using newer autoconf.
      (cherry picked from commit aabf77aa)
      37b07d90
    • M
      virCommand: Extend debug message for handshake · b3f0d2ec
      Michal Privoznik 提交于
      Currently, we are logging only one side of pipes we
      create in virCommandRequireHandshake(); This is enough
      in cases where pipe2() returns two consecutive FDs. However,
      it is not guaranteed and it may return any FDs.
      Therefore, it's wise to log the other ends as well.
      (cherry picked from commit 7454849e)
      b3f0d2ec
    • M
      lxc: return correct number of CPUs · 0089a205
      Martin Kletzander 提交于
      When getting number of CPUs the host has assigned, there was always
      number "1" returned. Even though all lxc domains with no pinning
      launched by libvirt run on all pCPUs (by default, no matter what's the
      number), we should at least return the same number as the user
      specified when creating the domain.
      (cherry picked from commit 87dfdb0b)
      0089a205
    • D
      examples: add consolecallback example python script · dfa15484
      Dave Allan 提交于
      A while back I wrote the attached code to demonstrate how to use
      events and serial console to create a serial console that stays up
      even when the VM is down.  It might need some work, as I am not
      terribly strong with Python.
      
      * examples/python/consolecallback.py: New file.
      * examples/python/Makefile.am (EXTRA_DIST): Ship it.
      (cherry picked from commit ffc9f7ab)
      dfa15484
    • 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
    • M
      docs: typo in acceleration element · da5eb7f1
      Martin Kletzander 提交于
      "accel3d" was specified twice, the second one is obviously "accel2d"
      (also from the text down below.
      (cherry picked from commit 94618eb6)
      da5eb7f1
    • 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
      Fix check for socket existance / daemon spawn · eb6ef1f5
      Daniel P. Berrange 提交于
      When you try to connect to a socket in the abstract namespace,
      the error will be ECONNREFUSED for a non-listening daemon. With
      the non-abstract namespace though, you instead get ENOENT. Add
      a check for this extra errno when auto-spawning the daemon
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      (cherry picked from commit 54c4d9d9)
      eb6ef1f5
    • D
      Remove last usage of PATH_MAX and ban its future use · b4bbe640
      Daniel P. Berrange 提交于
      Remove a number of pointless checks against PATH_MAX and
      add a syntax-check rule to prevent its use in future
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      (cherry picked from commit ebbcc026)
      b4bbe640
    • J
      maint: avoid new automake warning about AM_PROG_CC_STDC · 0f031d18
      Jim Meyering 提交于
      * configure.ac (AM_PROG_CC_STDC): Stop using this macro.
      It provokes warnings from newer automake and is superseded by
      autoconf's AC_PROG_CC, which we're already using.
      (cherry picked from commit 0d07aa51)
      0f031d18
    • D
      Improve docs about compiling libvirt from GIT · 99f07394
      Daniel P. Berrange 提交于
      Add a note about setting the LIBVIRT_DRIVER_DIR env variable,
      explain --system and fix example to use --disable-werror
      (cherry picked from commit 4878a331)
      99f07394
    • E
      tests: run valgrind on real executables, not libtool wrappers · 52ab82bd
      Eric Blake 提交于
      * tests/Makefile.am (valgrind): Use libtool's ability to bypass
      libtool wrappers when running valgrind.
      (cherry picked from commit 428fc2bf)
      52ab82bd
    • 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
    • E
      tests: back to short test names · e39afdb8
      Eric Blake 提交于
      With the switch to modules by default, I was getting super long
      test output:
      
      TEST: /home/remote/eblake/libvirt/tests/.libs/lt-interfacexml2xmltest
      
      compared to the former:
      
      TEST: interfacexml2xmltest
      
      * tests/testutils.c (virtTestMain): Trim off libtool goop.
      (cherry picked from commit ee407255)
      e39afdb8
    • D
      Add parsing for VIR_ENUM_IMPL & VIR_ENUM_DECL in apibuild.py · 3e416ba9
      Daniel P. Berrange 提交于
      The apibuild.py parser needs to be able to parse & ignore
      any VIR_ENUM_IMPL/VIR_ENUM_DECL macros in the source. Add
      some special case code to deal with this rather than trying
      to figure out a generic syntax for parsing macros.
      
      * apibuild.py: Special case  VIR_ENUM_IMPL & VIR_ENUM_DECL
      (cherry picked from commit 45b43a8c)
      3e416ba9
    • D
      Add stub impl of virNetlinkEventServiceLocalPid for Win32 · f44e18ed
      Daniel P. Berrange 提交于
      The libvirt_private.syms file exports virNetlinkEventServiceLocalPid
      so there needs to be a no-op stub for Win32 to avoid linker errors
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      (cherry picked from commit 2d191e8e)
      f44e18ed
    • D
      Fix dep from libvirt-lock-sanlock RPM · 328d7da1
      Daniel P. Berrange 提交于
      The libvirt-lock-sanlock RPM requires libvirtd, so its RPM dep
      should be on libvirt-daemon, not libvirt
      (cherry picked from commit aad1625d)
      328d7da1
    • D
      Remove more bogus systemd service dependencies · 158e70fc
      Daniel P. Berrange 提交于
      Adding syslog.target is obsolete, avahi.target does not
      exist and dbus.target is also obsolete
      Reported-by: NLennart Poettering <lpoetter@redhat.com>
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      (cherry picked from commit 4c7973e1)
      158e70fc
    • J
      Revert "rpc: Discard non-blocking calls only when necessary" · d4d87744
      Jiri Denemark 提交于
      This reverts commit b1e374a7, which was
      rather bad since I failed to consider all sides of the issue. The main
      things I didn't consider properly are:
      
      - a thread which sends a non-blocking call waits for the thread with
        the buck to process the call
      - the code doesn't expect non-blocking calls to remain in the queue
        unless they were already partially sent
      
      Thus, the reverted patch actually breaks more than what it fixes and
      clients (which may even be libvirtd during p2p migrations) will likely
      end up in a deadlock.
      (cherry picked from commit 63643f67)
      d4d87744
    • 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
    • E
      build: fix unused variable after last patch · 67f55786
      Eric Blake 提交于
      The previous commit (2cb0899e) left a dead variable behind.
      
      * src/libxl/libxl_driver.c (libxlClose): Drop dead variable.
      (cherry picked from commit b8e6021e)
      67f55786
    • 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
    • J
      Fix build when configuring with polkit0 · c82da022
      Jim Fehlig 提交于
      Commit 2223ea98 removed the only use of 'server' param in
      remoteDispatchAuthPolkit().  Mark the parameter with ATTRIBUTE_UNUSED
      to fix the build when configuring with polkit0.
      (cherry picked from commit 651d7124)
      c82da022
    • E
      build: fix virnetlink on glibc 2.11 · 50f508ef
      Eric Blake 提交于
      We were being lazy - virnetlink.c was getting uint32_t as a
      side-effect from glibc 2.14's <unistd.h>, but older glibc 2.11
      does not provide uint32_t from <unistd.h>.  In fact, POSIX states
      that <unistd.h> need only provide intptr_t, not all of <stdint.h>,
      so the bug really is ours.  Reported by Jonathan Alescio.
      
      * src/util/virnetlink.h: Include <stdint.h>.
      (cherry picked from commit e8314e78)
      50f508ef
    • 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
      Reject any non-option command line arguments · f9ff5827
      Daniel P. Berrange 提交于
      Due to a bug in editing /etc/sysconfig/libvirtd, VDSM was causing
      libvirt processes to run with the following command line args
      
         /usr/sbin/libvirtd --listen '#' 'by vdsm'
      
      While it correctly rejects any invalid option flags, libvirtd
      was not rejecting any non-option command line arguments
      
      * daemon/libvirtd.c: Reject non-option argv
      (cherry picked from commit 51bcb09f)
      f9ff5827
    • D
      Remove bogus udev.target dep from libvirtd unit · 50b594e4
      Daniel P. Berrange 提交于
      There is no 'udev.target' unit in systemd (only 'udev.service')
      yet libvirtd's unit file had a dep on one. There's no compelling
      reason for a dep on udev, so remove it altogether.
      Reported-by: NAvi Kivity <avi@redhat.com>
      (cherry picked from commit 6cfc3f8f)
      50b594e4
    • D
      Set a sensible default master start port for ehci companion controllers · 6b184ba1
      Daniel P. Berrange 提交于
      The uhci1, uhci2, uhci3 companion controllers for ehci1 must
      have a master start port set. Since this value is predictable
      we should set it automatically if the app does not supply it
      (cherry picked from commit 03b804a2)
      
      (crobinso: Drop an element that wasn't backported to -maint branch.)
      6b184ba1
    • 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
    • D
      Fix virDomainDeviceInfoIsSet() to check all struct fields · 73cfdbff
      Daniel P. Berrange 提交于
      The virDomainDeviceInfoIsSet API was only checking if an
      address or alias was set in the struct. Thus if only a
      rom bar setting / filename, boot index, or USB master
      value was set, they could be accidentally dropped when
      formatting XML
      (cherry picked from commit 2c195fdb)
      73cfdbff
    • D
      Allow stack traces to be included with log messages · 9a42097b
      Daniel P. Berrange 提交于
      Sometimes it is useful to see the callpath for log messages.
      This change enhances the log filter syntax so that stack traces
      can be show by setting '1:+NAME' instead of '1:NAME'.
      
      This results in output like:
      
      2012-05-09 14:18:45.136+0000: 13314: debug : virInitialize:414 : register drivers
      /home/berrange/src/virt/libvirt/src/.libs/libvirt.so.0(virInitialize+0xd6)[0x7f89188ebe86]
      /home/berrange/src/virt/libvirt/tools/.libs/lt-virsh[0x431921]
      /lib64/libc.so.6(__libc_start_main+0xf5)[0x3a21e21735]
      /home/berrange/src/virt/libvirt/tools/.libs/lt-virsh[0x40a279]
      
      2012-05-09 14:18:45.136+0000: 13314: debug : virRegisterDriver:775 : driver=0x7f8918d02760 name=Test
      /home/berrange/src/virt/libvirt/src/.libs/libvirt.so.0(virRegisterDriver+0x6b)[0x7f89188ec717]
      /home/berrange/src/virt/libvirt/src/.libs/libvirt.so.0(+0x11b3ad)[0x7f891891e3ad]
      /home/berrange/src/virt/libvirt/src/.libs/libvirt.so.0(virInitialize+0xf3)[0x7f89188ebea3]
      /home/berrange/src/virt/libvirt/tools/.libs/lt-virsh[0x431921]
      /lib64/libc.so.6(__libc_start_main+0xf5)[0x3a21e21735]
      /home/berrange/src/virt/libvirt/tools/.libs/lt-virsh[0x40a279]
      
      * docs/logging.html.in: Document new syntax
      * configure.ac: Check for execinfo.h
      * src/util/logging.c, src/util/logging.h: Add support for
        stack traces
      * tests/testutils.c: Adapt to API change
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      (cherry picked from commit 54856395)
      9a42097b
    • D
      Add bundled(gnulib) to RPM specfile · 7f756f51
      Daniel P. Berrange 提交于
      According to Fedora guidelines, because we bundle gnulib we
      need to add a virtual Provides: bundled(gnulib).
      
      https://fedoraproject.org/wiki/Packaging:No_Bundled_Libraries#Requirement_if_you_bundle
      (cherry picked from commit 3247b63b)
      7f756f51
    • O
      libvirt-guests: Remove LISTFILE if it's empty when stopping service · 3291646d
      Osier Yang 提交于
      $LISTFILE is created even no domain is running, and the empty
      $LISTFILE could cause improper service status.
      
          stopped ,with saved guests
      
      Which is not right, as there is no domain was saved.
      (cherry picked from commit c086af6b)
      3291646d
    • 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
    • M
      esx: Fix memory leaks in error paths related to transferred ownership · 856a23c2
      Matthias Bolte 提交于
      Appending an item to a list transfers ownership of that item to the
      list owner. But an error can occur in between item allocation and
      appending it to the list. In this case the item has to be freed
      explicitly. This was not done in some special cases resulting in
      possible memory leaks.
      
      Reported by Coverity.
      (cherry picked from commit 3b9a1295)
      856a23c2
    • 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