aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2010-11-22 12:27:07 -0700
committerEric Blake <eblake@redhat.com>2010-11-23 08:43:00 -0700
commit149c49213799bc0fb1b99ccd3310a932b512bc07 (patch)
treea85a7bebce3e73ee27fb8d8dddbea974a86a0849 /HACKING
parentRename 'remove' param to 'toremove' to avoid clash with stdio.h (diff)
downloadlibvirt-149c49213799bc0fb1b99ccd3310a932b512bc07.tar.gz
libvirt-149c49213799bc0fb1b99ccd3310a932b512bc07.tar.bz2
libvirt-149c49213799bc0fb1b99ccd3310a932b512bc07.zip
libvirtd: fix bug when shrinking number of clients
* daemon/libvirtd.c (qemudRunLoop): Pass allocation size, not current count, to VIR_SHRINK_N. * docs/hacking.html.in: Update doc example. * HACKING: Regenerate.
Diffstat (limited to 'HACKING')
-rw-r--r--HACKING5
1 files changed, 3 insertions, 2 deletions
diff --git a/HACKING b/HACKING
index 35ceb2982..cd7559d58 100644
--- a/HACKING
+++ b/HACKING
@@ -347,13 +347,14 @@ scales better, but requires tracking allocation separately from usage)
-- To trim an array of domains to have one less element:
+- To trim an array of domains from its allocated size down to the actual used
+size:
virDomainPtr domains;
size_t ndomains = x;
size_t ndomains_max = y;
- VIR_SHRINK_N(domains, ndomains_max, 1);
+ VIR_SHRINK_N(domains, ndomains_max, ndomains_max - ndomains);