mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
qemu_domain: Add niothreadpids and iothreadpids
Add new 'niothreadpids' and 'iothreadpids' to mimic the 'ncpupids' and 'vcpupids' that already exist.
This commit is contained in:
parent
3abb95cad4
commit
586905512a
@ -425,6 +425,7 @@ qemuDomainObjPrivateFree(void *data)
|
||||
virDomainChrSourceDefFree(priv->monConfig);
|
||||
qemuDomainObjFreeJob(priv);
|
||||
VIR_FREE(priv->vcpupids);
|
||||
VIR_FREE(priv->iothreadpids);
|
||||
VIR_FREE(priv->lockState);
|
||||
VIR_FREE(priv->origname);
|
||||
|
||||
@ -483,6 +484,18 @@ qemuDomainObjPrivateXMLFormat(virBufferPtr buf, void *data)
|
||||
virBufferAddLit(buf, "</vcpus>\n");
|
||||
}
|
||||
|
||||
if (priv->niothreadpids) {
|
||||
size_t i;
|
||||
virBufferAddLit(buf, "<iothreads>\n");
|
||||
virBufferAdjustIndent(buf, 2);
|
||||
for (i = 0; i < priv->niothreadpids; i++) {
|
||||
virBufferAsprintf(buf, "<iothread pid='%d'/>\n",
|
||||
priv->iothreadpids[i]);
|
||||
}
|
||||
virBufferAdjustIndent(buf, -2);
|
||||
virBufferAddLit(buf, "</iothreads>\n");
|
||||
}
|
||||
|
||||
if (priv->qemuCaps) {
|
||||
size_t i;
|
||||
virBufferAddLit(buf, "<qemuCaps>\n");
|
||||
@ -606,6 +619,29 @@ qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, void *data)
|
||||
VIR_FREE(nodes);
|
||||
}
|
||||
|
||||
n = virXPathNodeSet("./iothreads/iothread", ctxt, &nodes);
|
||||
if (n < 0)
|
||||
goto error;
|
||||
if (n) {
|
||||
priv->niothreadpids = n;
|
||||
if (VIR_REALLOC_N(priv->iothreadpids, priv->niothreadpids) < 0)
|
||||
goto error;
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
char *pidstr = virXMLPropString(nodes[i], "pid");
|
||||
if (!pidstr)
|
||||
goto error;
|
||||
|
||||
if (virStrToLong_i(pidstr, NULL, 10,
|
||||
&(priv->iothreadpids[i])) < 0) {
|
||||
VIR_FREE(pidstr);
|
||||
goto error;
|
||||
}
|
||||
VIR_FREE(pidstr);
|
||||
}
|
||||
VIR_FREE(nodes);
|
||||
}
|
||||
|
||||
if ((n = virXPathNodeSet("./qemuCaps/flag", ctxt, &nodes)) < 0) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s", _("failed to parse qemu capabilities flags"));
|
||||
|
@ -154,6 +154,9 @@ struct _qemuDomainObjPrivate {
|
||||
int nvcpupids;
|
||||
int *vcpupids;
|
||||
|
||||
int niothreadpids;
|
||||
int *iothreadpids;
|
||||
|
||||
virDomainPCIAddressSetPtr pciaddrs;
|
||||
virDomainCCWAddressSetPtr ccwaddrs;
|
||||
int persistentAddrs;
|
||||
|
Loading…
Reference in New Issue
Block a user