[PATCH] libvirtd: fix bug when shrinking number of clients

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* daemon/libvirtd.c (qemudRunLoop): Pass allocation size, not
current count, to VIR_SHRINK_N.
---

Found the cause of the crash; when the first loop completed, it was
freeing the array but not reflecting that in the allocation count;
the second time then saw the non-zero allocation count and didn't
think it had to allocate anything.

 daemon/libvirtd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c
index e544c48..7f75096 100644
--- a/daemon/libvirtd.c
+++ b/daemon/libvirtd.c
@@ -2362,2 +2362,2 @@ static void *qemudRunLoop(void *opaque) {
                             server->clients + i + 1,
                             sizeof (*server->clients) * (server->nclients - i));

-                VIR_SHRINK_N(server->clients, server->nclients, 0);
+                VIR_SHRINK_N(server->clients, server->nclients_max, 1);
                 goto reprocess;
             }
         }
-- 
1.7.3.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]