1. 21 11月, 2013 1 次提交
    • E
      maint: fix comma style issues: nwfilter · f5690336
      Eric Blake 提交于
      Most of our code base uses space after comma but not before;
      fix the remaining uses before adding a syntax check.
      
      * src/nwfilter/nwfilter_ebiptables_driver.c: Consistently use
      commas.
      * src/nwfilter/nwfilter_gentech_driver.c: Likewise.
      * src/nwfilter/nwfilter_learnipaddr.c: Likewise.
      * src/conf/nwfilter_conf.c: Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      f5690336
  2. 20 11月, 2013 10 次提交
  3. 19 11月, 2013 7 次提交
  4. 18 11月, 2013 5 次提交
    • D
      Avoid async signal safety problem in glibc's setxid · 3563c51d
      Daniel P. Berrange 提交于
      The glibc setxid is supposed to be async signal safe, but
      libc developers confirm that it is not. This causes a problem
      when libvirt_lxc starts the FUSE thread and then runs clone()
      to start the container. If the clone() was done before the
      FUSE thread has completely started up, then the container
      will hang in setxid after clone().
      
      The fix is to avoid creating any threads until after the
      container has been clone()'d. By avoiding any threads in
      the parent, the child is no longer required to run in an
      async signal safe context, and we thus avoid the glibc
      bug.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      3563c51d
    • J
      Return -1 in virPortAllocatorAcquire if all ports are used · 8c41794a
      Ján Tomko 提交于
      Report the error in virPortAllocatorAcquire instead
      of doing it in every caller.
      
      The error contains the port range name instead of the intended
      use for the port, e.g.:
      Unable to find an unused port in range 'display' (65534-65535)
      instead of:
      Unable to find an unused port for SPICE
      
      This also adds error reporting when the QEMU driver could not
      find an unused port for VNC, VNC WebSockets or NBD migration.
      8c41794a
    • J
      Add a name to virPortAllocator · d16d90fd
      Ján Tomko 提交于
      This allows its error messages to be more specific.
      d16d90fd
    • J
      Don't release spice port twice when no TLS port is available · 28ea39a0
      Ján Tomko 提交于
      Introduced by 7b4a6304.
      28ea39a0
    • J
      Properly unref a connection with a close callback · e68432e4
      Ján Tomko 提交于
      The connection pointer in the closeCallback data was never
      initialized, making the unref in remoteClientCloseFunc a no-op.
      
      This fixes the following leak in virsh when the daemon closes
      the connection unexpectedly:
      
      1,179 (288 direct, 891 indirect) bytes in 1 blocks are
         definitely lost in loss record 745 of 792
        at 0x4C2A6D0: calloc (in vgpreload_memcheck-amd64-linux.so)
        by 0x4E9643D: virAllocVar (viralloc.c:558)
        by 0x4ED2425: virObjectNew (virobject.c:190)
        by 0x4F675AC: virGetConnect (datatypes.c:116)
        by 0x4F6EA06: do_open (libvirt.c:1136)
        by 0x4F71017: virConnectOpenAuth (libvirt.c:1481)
        by 0x129FFA: vshReconnect (virsh.c:337)
        by 0x128310: main (virsh.c:2470)
      e68432e4
  5. 15 11月, 2013 9 次提交
    • E
      docs: improve job info details · 6385283a
      Eric Blake 提交于
      Noticed while revieweing the patches for qemu's new migration state.
      
      * include/libvirt/libvirt.h.in (_virDomainJobInfo): Fix typo,
      grammar.
      * src/libvirt.c (virDomainGetJobInfo): Add cross reference.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      6385283a
    • C
      docs: fix a typo in formatnwfilter.html.in · 18037b5f
      Chen Hanxiao 提交于
      s/insallations/installations/
      Signed-off-by: NChen Hanxiao <chenhanxiao@cn.fujitsu.com>
      18037b5f
    • M
      Fix migration with QEMU 1.6 · d35ae414
      Michael Avdienko 提交于
      QEMU 1.6.0 introduced new migration status: setup
      Libvirt does not expect such string in QMP and refuses to migrate with error
      "unexpected migration status in setup"
      
      This patch fixes it.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      d35ae414
    • J
      qemu: Call qemuSetupHostdevCGroup later during hotplug · 05e149f9
      Jiri Denemark 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1025108
      
      So far qemuSetupHostdevCGroup was called very early during hotplug, even
      before we knew the device we were about to hotplug was actually
      available. By calling the function later, we make sure QEMU won't be
      allowed to access devices used by other domains.
      
      Another important effect of this change is that hopluging USB devices
      specified by vendor and product (but not by their USB address) works
      again. This was broken since v1.0.5-171-g7d763aca, when the call to
      qemuFindHostdevUSBDevice was moved after the call to
      qemuSetupHostdevCGroup, which then used an uninitialized USB address.
      05e149f9
    • M
      qemuMonitorIO: Don't use @mon after it's unrefed · f417ad07
      Michal Privoznik 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1018267
      
      The aim of virObject refing and urefing is to tell where the object is
      to be used and when is no longer needed. Hence any object shouldn't be
      used after it has been unrefed, as we might be the last to hold the
      reference. The better way is to call virObjectUnref() *after* the last
      object usage. In this specific case, the monitor EOF handler was called
      after the qemuMonitorIO called virObjectUnref. Not only that @mon was
      disposed (which is not used in the handler anyway) but the @mon->vm
      which is causing a SIGSEGV:
      
      2013-11-15 10:17:54.425+0000: 20110: error : qemuMonitorIO:688 : internal error: early end of file from monitor: possible problem:
      qemu-kvm: -incoming tcp:01.01.01.0:49152: Failed to bind socket: Cannot assign requested address
      
      Program received signal SIGSEGV, Segmentation fault.
      qemuProcessHandleMonitorEOF (mon=<optimized out>, vm=0x7fb728004170) at qemu/qemu_process.c:299
      299         if (priv->beingDestroyed) {
      (gdb) p *priv
      Cannot access memory at address 0x0
      (gdb) p vm
      $1 = (virDomainObj *) 0x7fb728004170
      (gdb) p *vm
      $2 = {parent = {parent = {magic = 3735928559, refs = 0, klass = 0xdeadbeef}, lock = {lock = {__data = {__lock = 2, __count = 0, __owner = 20110, __nusers = 1, __kind = 0, __spins = 0, __list = {__prev = 0x0,
                  __next = 0x0}}, __size = "\002\000\000\000\000\000\000\000\216N\000\000\001", '\000' <repeats 26 times>, __align = 2}}}, pid = 0, state = {state = 0, reason = 0}, autostart = 0, persistent = 0,
        updated = 0, def = 0x0, newDef = 0x0, snapshots = 0x0, current_snapshot = 0x0, hasManagedSave = false, privateData = 0x0, privateDataFreeFunc = 0x0, taint = 304}
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      f417ad07
    • M
      qemuProcessReconnectHelper: Don't create joinable thread · 3367c21d
      Michal Privoznik 提交于
      In the qemuProcessReconnectHelper() a new thread that does all the
      interesting work is spawned. The rationale is to not block the daemon
      startup process in case of unresponsive qemu. However, the thread
      handler is a local variable which gets lost once the control goes out of
      scope. Hence the thread gets leaked. We can avoid this if the thread
      isn't made joinable.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      3367c21d
    • M
      virDomainEventCallbackListFree: Don't leak @list->callbacks · ea13a759
      Michal Privoznik 提交于
      The @list->callbacks is an array that is inflated whenever a new event
      is added, e.g. via virDomainEventCallbackListAddID(). However, when we
      are freeing the array, we free the items within it but forgot to
      actually free it.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      ea13a759
    • M
      virPCIDeviceBindToStub: Remove unused @oldDriverPath and @oldDriverName · a5936755
      Michal Privoznik 提交于
      These two chunks had to be part of df4283a5. But for some unclear
      reason, the weren't. Anyway, these two variables are not used anywhere
      within function. They're initialized to NULL and then VIR_FREE()-d. And
      there's no reason do do two NOPs, right?
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      a5936755
    • M
  6. 14 11月, 2013 1 次提交
    • E
      storage: fix RNG validation of gluster via netfs · 887dd362
      Eric Blake 提交于
      While trying to compare netfs against my new gluster pool, I
      discovered two things:
      
      virt-xml-validate chokes on valid xml produced by 'virsh pool-dumpxml'
      [yet another reason that ALL patches that add new xml should be adding
      corresponding tests]
      
      When using glusterfs FUSE mounts, you cannot access a subdirectory
      of a gluster volume.  The recommended workaround in the gluster
      community is to mount the volume to an intermediate location, then
      bind-mount the desired subdirectory to the final location.  Maybe
      we should teach libvirt to do bind-mounting, but for now I chose to
      just document the limitation.
      
      * docs/storage.html.in: Improve documentation.
      * docs/schemas/storagepool.rng (sourcefmtnetfs): Allow all
      formats, and drop redundant info-vendor.
      * tests/storagepoolxml2xmltest.c (mymain): New test.
      * tests/storagepoolxml2xmlin/pool-netfs-gluster.xml: New file.
      * tests/storagepoolxml2xmlout/pool-netfs-gluster.xml: Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      887dd362
  7. 13 11月, 2013 7 次提交
    • P
      virsh-secret: Unify list column alignment · 8d7800a5
      Peter Krempa 提交于
      Before:
      
      $ virsh secret-list
      UUID                                 Usage
      -----------------------------------------------------------
      0a81f5b2-8403-7b23-c8d6-21ccc2f80d6f volume /var/lib/libvirt/images/puppyname.img
      0a81f5b2-8403-7b23-c8d6-2deadbeefd6f Unused
      
      After:
      
      $ virsh secret-list
       UUID                                  Usage
      --------------------------------------------------------------------------------
       0a81f5b2-8403-7b23-c8d6-21ccc2f80d6f  volume /var/lib/libvirt/images/puppyname.img
       0a81f5b2-8403-7b23-c8d6-2deadbeefd6f  Unused
      8d7800a5
    • P
      virsh-interface: Unify list column alignment · 8cb426a2
      Peter Krempa 提交于
      Before:
      
      $ virsh iface-list
      Name                 State      MAC Address
      --------------------------------------------
      br0                  active     f0:de:f1:dc:b8:b0
      virbr2               active     52:54:00:61:78:0c
      
      After:
      
      $ virsh iface-list
       Name                 State      MAC Address
      ---------------------------------------------------
       br0                  active     f0:de:f1:dc:b8:b0
       virbr2               active     52:54:00:61:78:0c
      8cb426a2
    • P
      virsh-nwfilter: Unify list command column alignment · 75fe29e2
      Peter Krempa 提交于
      Before:
      $ virsh nwfilter-list
      UUID                                  Name
      ----------------------------------------------------------------
      651d902c-165c-4bcc-8d73-41319af1e6bc  allow-arp
      9ae11362-df6b-407f-8864-3bdf5125bf77  allow-dhcp
      53b5a9ed-7d46-480f-a201-6d8a503d6533  allow-dhcp-server
      
      After:
      $ virsh nwfilter-list
       UUID                                  Name
      ------------------------------------------------------------------
       651d902c-165c-4bcc-8d73-41319af1e6bc  allow-arp
       9ae11362-df6b-407f-8864-3bdf5125bf77  allow-dhcp
       53b5a9ed-7d46-480f-a201-6d8a503d6533  allow-dhcp-server
      75fe29e2
    • P
      virsh-pool: Unify spacing of listing function · 96f4b5eb
      Peter Krempa 提交于
      Change the alignment to match the domain listing function.
      
      Before:
      
      $ virsh pool-list
      Name                 State      Autostart
      -----------------------------------------
      boot-scratch         active     no
      default              active     no
      glusterpool          active     no
      
      $ virsh pool-list --details
      Name          State    Autostart  Persistent    Capacity  Allocation  Available
      -------------------------------------------------------------------------------
      boot-scratch  running  no         yes         117.99 GiB  101.40 GiB  16.60 GiB
      default       running  no         yes         117.99 GiB  101.40 GiB  16.60 GiB
      glusterpool   running  no         yes          29.40 GiB   44.23 MiB  29.36 GiB
      
      After:
      
      $ virsh pool-list
       Name                 State      Autostart
      -------------------------------------------
       boot-scratch         active     no
       default              active     no
       glusterpool          active     no
      
      $ virsh pool-list --details
       Name          State    Autostart  Persistent    Capacity  Allocation  Available
      ---------------------------------------------------------------------------------
       boot-scratch  running  no         yes         117.99 GiB  101.40 GiB  16.60 GiB
       default       running  no         yes         117.99 GiB  101.40 GiB  16.60 GiB
       glusterpool   running  no         yes          29.40 GiB   44.23 MiB  29.36 GiB
      96f4b5eb
    • J
      Disable nwfilter driver when running unprivileged · b7829f95
      Ján Tomko 提交于
      When opening a new connection to the driver, nwfilterOpen
      only succeeds if the driverState has been allocated.
      
      Move the privilege check in driver initialization before
      the state allocation to disable the driver.
      
      This changes the nwfilter-define error from:
      error: cannot create config directory (null): Bad address
      To:
      this function is not supported by the connection driver:
      virNWFilterDefineXML
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1029266
      b7829f95
    • J
      libxl: Fix Xen 4.4 libxlVmStart logic · 7d58c7fc
      Jason Andryuk 提交于
      ifdef LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS hides a multi-line body
      for a brace-less else.  Add braces to ensure proper logic is applied.
      
      Without this fix, new domains cannot be started.  Both
      libxl_domain_create_new and libxl_domain_create_restore are called when
      starting a new domain leading to this error:
      libxl: error: libxl.c:324:libxl__domain_rename: domain with name "guest" already exists.
      libxl: error: libxl_create.c:800:initiate_domain_create: cannot make domain: -6
      7d58c7fc
    • P
      qemu: Check for presence of device and properities when getting CPUID · 84f69602
      Peter Krempa 提交于
      The QOM path in qemu that contains the CPUID registers of a running VM
      may not be present (introduced in QEMU 1.5).
      
      Since commit d94b7817 we have a regression with QEMU that don't
      support reporting of the CPUID register state via the monitor as the
      process startup code expects the path to exist.
      
      This patch adds code that checks with the monitor if the requested path
      already exists and uses it only in this case.
      84f69602