1. 31 10月, 2013 8 次提交
  2. 30 10月, 2013 8 次提交
    • D
      Fix race condition reconnecting to vms & loading configs · f26701f5
      Daniel P. Berrange 提交于
      The following sequence
      
       1. Define a persistent QMEU guest
       2. Start the QEMU guest
       3. Stop libvirtd
       4. Kill the QEMU process
       5. Start libvirtd
       6. List persistent guests
      
      At the last step, the previously running persistent guest
      will be missing. This is because of a race condition in the
      QEMU driver startup code. It does
      
       1. Load all VM state files
       2. Spawn thread to reconnect to each VM
       3. Load all VM config files
      
      Only at the end of step 3, does the 'virDomainObjPtr' get
      marked as "persistent". There is therefore a window where
      the thread reconnecting to the VM will remove the persistent
      VM from the list.
      
      The easy fix is to simply switch the order of steps 2 & 3.
      
      In addition to this though, we must only attempt to reconnect
      to a VM which had a non-zero PID loaded from its state file.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      f26701f5
    • D
      Fix leak of objects when reconnecting to QEMU instances · 54a24112
      Daniel P. Berrange 提交于
      The 'error' cleanup block in qemuProcessReconnect() had a
      'return' statement in the middle of it. This caused a leak
      of virConnectPtr & virQEMUDriverConfigPtr instances. This
      was identified because netcf recently started checking its
      refcount in libvirtd shutdown:
      
      netcfStateCleanup:109 : internal error: Attempt to close netcf state driver with open connections
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      54a24112
    • D
      Don't update dom->persistent without lock held · b260a77e
      Daniel P. Berrange 提交于
      virDomainObjListLoadAllConfigs sets dom->persistent after
      having released its lock on the domain object. This exposes
      a possible race condition.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      b260a77e
    • C
      docs: fix typos in formatnwfilter · d70840f6
      Chen Hanxiao 提交于
      s/initated/initiated
      Signed-off-by: NChen Hanxiao <chenhanxiao@cn.fujitsu.com>
      d70840f6
    • D
      MacOS: Re-add support for QEMU backend · 915c6936
      Doug Goldstein 提交于
      The QEMU backend was disabled on Mac OS X without a reason in the code
      and due to refactors its difficult to understand when/why it was
      disabled. With QEMU being supported on Mac OS X there is no reason to
      disable QEMU on this platform.
      915c6936
    • J
      Add '+' to uid/gid printing for label processing · aa42bb17
      John Ferlan 提交于
      To ensure proper processing by virGetUserID() and virGetGroupID()
      of a uid/gid add a "+" prior to the uid/gid to denote it's really
      a uid/gid for the label.
      aa42bb17
    • E
      storage: fix incorrect typedef · 8e7f57a7
      Eric Blake 提交于
      The rbd code had a confusing typedef ending in Ptr that was not
      actually a pointer, which made the rest of the code harder to
      read.  This fixes things to actually pass by pointer rather than
      by copy.
      
      * src/storage/storage_backend_rbd.c (virStorageBackendStatePtr):
      Fix typedef.
      (virStorageBackendRBDOpenRADOSConn)
      (virStorageBackendRBDCloseRADOSConn)
      (volStorageBackendRBDRefreshVolInfo)
      (virStorageBackendRBDRefreshPool, virStorageBackendRBDDeleteVol)
      (virStorageBackendRBDCreateVol, virStorageBackendRBDRefreshVol)
      (virStorageBackendRBDResizeVol): Fix fallout.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      8e7f57a7
    • P
      apparmor: Fix typo in function name in driver struct initialization · 8e362a89
      Peter Krempa 提交于
      Commit 64a68a4a introduced a typo in the initialization of the apparmor
      driver structure breaking the build with apparmor enabled.
      8e362a89
  3. 29 10月, 2013 8 次提交
  4. 28 10月, 2013 1 次提交
  5. 25 10月, 2013 1 次提交
  6. 24 10月, 2013 5 次提交
    • J
      Avoid Coverity DEADCODE warning · ab479c90
      John Ferlan 提交于
      Commit '922b7fda' resulted in two DEADCODE warnings from Coverity in
      remoteDispatchAuthPolkit and virAccessDriverPolkitFormatProcess.
      Commit '604ae657' modified the daemon.c code to remove the deadcode
      issue, but did not do so for viracessdriverpolkit.c. This just mimics
      the same changes
      ab479c90
    • E
      virsh: undocument --shareable (--mode already covers it) · f919cf69
      Eric Blake 提交于
      Commit e962a579 added 'attach-disk --shareable', even though we
      already had 'attach-disk --mode=shareable'.  Worse, if the user
      types 'attach-disk --mode=readonly --shareable', we create
      non-sensical XML.  The best solution is just to undocument the
      duplicate spelling, by having it fall back to the preferred
      spelling.
      
      * tools/virsh-domain.c (cmdAttachDisk): Let alias handling fix our
      mistake in exposing a second spelling for an existing option.
      * tools/virsh.pod: Fix documentation.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      f919cf69
    • E
      virsh: allow alias to expand to opt=value pair · 2b172a8e
      Eric Blake 提交于
      We want to treat 'attach-disk --shareable' as an undocumented
      alias for 'attach-disk --mode=shareable'.  By improving our
      alias handling, we can allow all such --bool -> --opt=value
      replacements, and guarantee up front that the alias is not
      mixed with its replacement.
      
      * tools/virsh.c (vshCmddefOptParse, vshCmddefGetOption): Add
      support for expanding bool alias to --opt=value.
      (opts_echo): Add another alias to test it.
      * tests/virshtest.c (mymain): Test it.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      2b172a8e
    • M
      libxl: Fix possible invalid read · 394d6e0a
      Martin Kletzander 提交于
      According to the following valgrind output, there seems to be a
      invalid limit for the iterator (captured on Fedora 19):
      
      ==3945== Invalid read of size 1
      ==3945==    at 0x1E1FA410: libxlVmStart (libxl_driver.c:475)
      ==3945==    by 0x1E1FAD9A: libxlDomainCreateWithFlags (libxl_driver.c:2633)
      ==3945==    by 0x5187D46: virDomainCreate (libvirt.c:9439)
      ==3945==    by 0x13BAA6: remoteDispatchDomainCreateHelper (remote_dispatch.h:2910)
      ==3945==    by 0x51DE5B9: virNetServerProgramDispatch (virnetserverprogram.c:435)
      ==3945==    by 0x51D93E7: virNetServerHandleJob (virnetserver.c:165)
      ==3945==    by 0x50F5BF4: virThreadPoolWorker (virthreadpool.c:144)
      ==3945==    by 0x50F5670: virThreadHelper (virthreadpthread.c:161)
      ==3945==    by 0x8046C52: start_thread (pthread_create.c:308)
      ==3945==    by 0x8758E1C: clone (clone.S:113)
      ==3945==  Address 0x23424d81 is 0 bytes after a block of size 1 alloc'd
      ==3945==    at 0x4A08121: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
      ==3945==    by 0x50B1F8C: virAllocN (viralloc.c:189)
      ==3945==    by 0x1E1FA3CA: libxlVmStart (libxl_driver.c:468)
      ==3945==    by 0x1E1FAD9A: libxlDomainCreateWithFlags (libxl_driver.c:2633)
      ==3945==    by 0x5187D46: virDomainCreate (libvirt.c:9439)
      ==3945==    by 0x13BAA6: remoteDispatchDomainCreateHelper (remote_dispatch.h:2910)
      ==3945==    by 0x51DE5B9: virNetServerProgramDispatch (virnetserverprogram.c:435)
      ==3945==    by 0x51D93E7: virNetServerHandleJob (virnetserver.c:165)
      ==3945==    by 0x50F5BF4: virThreadPoolWorker (virthreadpool.c:144)
      ==3945==    by 0x50F5670: virThreadHelper (virthreadpthread.c:161)
      ==3945==    by 0x8046C52: start_thread (pthread_create.c:308)
      ==3945==    by 0x8758E1C: clone (clone.S:113)
      ==3945==
      
      Related: https://bugzilla.redhat.com/show_bug.cgi?id=1013045Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      394d6e0a
    • E
      virsh: fix doc typos · 0410eb22
      Eric Blake 提交于
      Reported in https://bugzilla.redhat.com/show_bug.cgi?id=1022872
      
      * tools/virsh.pod: s/COMMMANDS/COMMANDS/
      Signed-off-by: NEric Blake <eblake@redhat.com>
      0410eb22
  7. 23 10月, 2013 4 次提交
  8. 22 10月, 2013 5 次提交
    • D
      rpc: Retrieve peer PID via new getsockopt() for Mac · e24aec62
      Doug Goldstein 提交于
      While LOCAL_PEERCRED on the BSDs does not return the pid information of
      the peer, Mac OS X 10.8 added LOCAL_PEERPID to retrieve the pid so we
      should use that when its available to get that information.
      e24aec62
    • E
      maint: typo fixes · 160a70fe
      Eric Blake 提交于
      * ChangeLog-old: s/guarentee/guarantee/
      Signed-off-by: NEric Blake <eblake@redhat.com>
      160a70fe
    • J
      build: fix build of virt-login-shell on systems with older gnutls · 843bdb2f
      Jim Fehlig 提交于
      On systems where gnutls uses libgcrypt, I'm seeing the following
      build failure
      
      libvirt.c:314: error: variable 'virTLSThreadImpl' has initializer but incomplete type
      libvirt.c:319: error: 'GCRY_THREAD_OPTION_PTHREAD' undeclared here (not in a function)
      ...
      
      Fix by undefining WITH_GNUTLS_GCRYPT in config-post.h
      843bdb2f
    • M
      Get rid of shadowed booleans · e3e9d3b1
      Michal Privoznik 提交于
      There are still two places where we are using 1bit width unsigned
      integer to store a boolean. There's no real need for this and these
      occurrences can be replaced with 'bool'.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      e3e9d3b1
    • J
      build: fix linking virt-login-shell · 5a0ea4b7
      Jim Fehlig 提交于
      After commit 3e2f27e1, I've noticed build failures of virt-login-shell
      when libapparmor-devel is installed on the build host
      
      CCLD     virt-login-shell
      ../src/.libs/libvirt-setuid-rpc-client.a(libvirt_setuid_rpc_client_la-vircommand.o):
      In function `virExec':
      /home/jfehlig/virt/upstream/libvirt/src/util/vircommand.c:653: undefined
      reference to `aa_change_profile'
      collect2: error: ld returned 1 exit status
      
      I was about to commit an easy fix under the build-breaker rule
      (build-fix-1.patch), but thought to extend the notion of SECDRIVER_LIBS
      to SECDRIVER_CFLAGS, and use both throughout src/Makefile.am where it
      makes sense (build-fix-2.patch).
      
      Should I just stick with the simple fix, or is something along the lines
      of patch 2 preferred?
      
      Regards,
      Jim
      
      >From a0f35945f3127ab70d051101037e821b1759b4bb Mon Sep 17 00:00:00 2001
      From: Jim Fehlig <jfehlig@suse.com>
      Date: Mon, 21 Oct 2013 15:30:02 -0600
      Subject: [PATCH] build: fix virt-login-shell build with apparmor
      
      With libapparmor-devel installed, virt-login-shell fails to link
      
      CCLD     virt-login-shell
      ../src/.libs/libvirt-setuid-rpc-client.a(libvirt_setuid_rpc_client_la-vircommand.o): In function `virExec':
      /home/jfehlig/virt/upstream/libvirt/src/util/vircommand.c:653: undefined reference to `aa_change_profile'
      collect2: error: ld returned 1 exit status
      
      Fix by linking libvirt_setuid_rpc_client with previously determined
      SECDRIVER_LIBS in src/Makefile.am.  While at it, introduce SECDRIVER_CFLAGS
      and use both throughout src/Makefile.am where it makes sense.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      5a0ea4b7