mirror of
https://github.com/libvirt/libvirt.git
synced 2026-09-03 20:53:04 -05:00
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.
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user