diff --git a/9c77bf04-fix-virnetserver-refcnt.patch b/9c77bf04-fix-virnetserver-refcnt.patch new file mode 100644 index 0000000..83ca93a --- /dev/null +++ b/9c77bf04-fix-virnetserver-refcnt.patch @@ -0,0 +1,34 @@ +commit 9c77bf04b03ff026bb37212a195070d8983f530d +Author: Hu Tao +Date: Fri Jun 22 11:26:03 2012 +0800 + + fix a bug of ref count in virnetserver.c + + The test of ref count is not protected by lock, which is unsafe because + the ref count may have been changed by other threads during the test. + + This patch fixes this. + +Index: libvirt-0.9.11.4/src/rpc/virnetserver.c +=================================================================== +--- libvirt-0.9.11.4.orig/src/rpc/virnetserver.c ++++ libvirt-0.9.11.4/src/rpc/virnetserver.c +@@ -794,15 +794,16 @@ void virNetServerQuit(virNetServerPtr sr + void virNetServerFree(virNetServerPtr srv) + { + int i; ++ int refs; + + if (!srv) + return; + + virNetServerLock(srv); + VIR_DEBUG("srv=%p refs=%d", srv, srv->refs); +- srv->refs--; ++ refs = --srv->refs; + virNetServerUnlock(srv); +- if (srv->refs > 0) ++ if (refs > 0) + return; + + for (i = 0 ; i < srv->nservices ; i++) diff --git a/libvirt.changes b/libvirt.changes index 8e7ad9e..3bc23d7 100644 --- a/libvirt.changes +++ b/libvirt.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Jun 22 16:26:01 MDT 2012 - jfehlig@suse.com + +- Add upstream patch to fix ref count of virNetServer object + 9c77bf04-fix-virnetserver-refcnt.patch + ------------------------------------------------------------------- Thu Jun 21 11:56:35 MDT 2012 - jfehlig@suse.com diff --git a/libvirt.spec b/libvirt.spec index 39a0823..989e0ed 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -414,6 +414,7 @@ Source99: baselibs.conf Patch0: revert-d8978c90.patch Patch1: 57349ffc-lxc-ctrl.patch Patch2: 0dda594d-libvirtd-shutdown-deadlock.patch +Patch3: 9c77bf04-fix-virnetserver-refcnt.patch # Need to go upstream Patch100: xen-name-for-devid.patch Patch101: clone.patch @@ -552,6 +553,7 @@ Authors: %patch0 -p1 %patch1 -p1 %patch2 -p1 +%patch3 -p1 %patch100 -p1 %patch101 %patch102 -p1