* daemon/libvirtd.c (qemudRunLoop): Pass allocation size, not
current count, to VIR_SHRINK_N.
* docs/hacking.html.in: Update doc example.
* HACKING: Regenerate.
-- 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);
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,
+ server->nclients_max - server->nclients);
goto reprocess;
}
}
</pre>
</li>
- <li><p>To trim an array of domains to have one less element:</p>
+ <li><p>To trim an array of domains from its allocated size down
+ to the actual used size:</p>
<pre>
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);
</pre></li>
<li><p>To free an array of domains:</p>