qemu: domain: Assume QEMU_CAPS_BLOCKDEV for the domain private code

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2022-07-21 16:06:33 +02:00
parent fcc231dc79
commit 6695162c76
8 changed files with 15 additions and 12 deletions

View File

@ -2175,8 +2175,7 @@ qemuDomainObjPrivateXMLFormatBlockjobs(virBuffer *buf,
virBufferAsprintf(&attrBuf, " active='%s'",
virTristateBoolTypeToString(virTristateBoolFromBool(bj)));
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV) &&
virHashForEachSorted(priv->blockjobs,
if (virHashForEachSorted(priv->blockjobs,
qemuDomainObjPrivateXMLFormatBlockjobIterator,
&iterdata) < 0)
return -1;
@ -2396,8 +2395,7 @@ qemuDomainObjPrivateXMLFormat(virBuffer *buf,
qemuDomainObjPrivateXMLFormatPR(buf, priv);
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV))
virBufferAsprintf(buf, "<nodename index='%llu'/>\n", priv->nodenameindex);
virBufferAsprintf(buf, "<nodename index='%llu'/>\n", priv->nodenameindex);
virBufferAsprintf(buf, "<fdset index='%u'/>\n", priv->fdsetindex);
@ -2825,15 +2823,13 @@ qemuDomainObjPrivateXMLParseBlockjobs(virDomainObj *vm,
(tmp = virTristateBoolTypeFromString(active)) > 0)
priv->reconnectBlockjobs = tmp;
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV)) {
if ((nnodes = virXPathNodeSet("./blockjobs/blockjob", ctxt, &nodes)) < 0)
return -1;
if ((nnodes = virXPathNodeSet("./blockjobs/blockjob", ctxt, &nodes)) < 0)
return -1;
for (i = 0; i < nnodes; i++) {
if (qemuDomainObjPrivateXMLParseBlockjobData(vm, nodes[i], ctxt,
priv->driver->xmlopt) < 0)
return -1;
}
for (i = 0; i < nnodes; i++) {
if (qemuDomainObjPrivateXMLParseBlockjobData(vm, nodes[i], ctxt,
priv->driver->xmlopt) < 0)
return -1;
}
return 0;

View File

@ -22,6 +22,7 @@
<libDir path='/tmp'/>
<channelTargetDir path='/tmp/channel'/>
<allowReboot value='yes'/>
<nodename index='0'/>
<fdset index='0'/>
<blockjobs active='yes'/>
<agentTimeout>-2</agentTimeout>

View File

@ -256,6 +256,7 @@
<channelTargetDir path='/var/lib/libvirt/qemu/channel/target/domain-1-nest'/>
<chardevStdioLogd/>
<allowReboot value='yes'/>
<nodename index='0'/>
<fdset index='0'/>
<blockjobs active='no'/>
<agentTimeout>-2</agentTimeout>

View File

@ -259,6 +259,7 @@
<channelTargetDir path='/var/lib/libvirt/qemu/channel/target/domain-4-upstream'/>
<chardevStdioLogd/>
<allowReboot value='yes'/>
<nodename index='0'/>
<fdset index='0'/>
<blockjobs active='no'/>
<agentTimeout>-2</agentTimeout>

View File

@ -288,6 +288,7 @@
<channelTargetDir path='/var/lib/libvirt/qemu/channel/target/domain-3-upstream'/>
<chardevStdioLogd/>
<allowReboot value='yes'/>
<nodename index='0'/>
<fdset index='0'/>
<blockjobs active='no'/>
<agentTimeout>-2</agentTimeout>

View File

@ -270,6 +270,7 @@
<channelTargetDir path='/var/lib/libvirt/qemu/channel/target/domain-7-nest'/>
<chardevStdioLogd/>
<allowReboot value='yes'/>
<nodename index='0'/>
<fdset index='0'/>
<blockjobs active='no'/>
<agentTimeout>-2</agentTimeout>

View File

@ -258,6 +258,7 @@
<channelTargetDir path='/var/lib/libvirt/qemu/channel/target/domain-1-upstream'/>
<chardevStdioLogd/>
<allowReboot value='yes'/>
<nodename index='0'/>
<fdset index='0'/>
<blockjobs active='no'/>
<agentTimeout>-2</agentTimeout>

View File

@ -308,6 +308,7 @@
<libDir path='/tmp'/>
<channelTargetDir path='/tmp/channel'/>
<allowReboot value='yes'/>
<nodename index='0'/>
<fdset index='0'/>
<blockjobs active='no'/>
<agentTimeout>-2</agentTimeout>