virStorageSourcePtr chain; /* Reference to the chain the job operates on. */
virStorageSourcePtr mirrorChain; /* reference to 'mirror' part of the job */
+ unsigned int jobflags; /* per job flags */
+ bool jobflagsmissing; /* job flags were not stored */
+
union {
qemuBlockJobPullData pull;
qemuBlockJobCommitData commit;
virBufferEscapeString(&attrBuf, " newstate='%s'", newstate);
if (job->brokentype != QEMU_BLOCKJOB_TYPE_NONE)
virBufferEscapeString(&attrBuf, " brokentype='%s'", qemuBlockjobTypeToString(job->brokentype));
+ if (!job->jobflagsmissing)
+ virBufferAsprintf(&attrBuf, " jobflags='0x%x'", job->jobflags);
virBufferEscapeString(&childBuf, "<errmsg>%s</errmsg>", job->errmsg);
if (job->disk) {
int newstate = -1;
bool invalidData = false;
xmlNodePtr tmp;
+ unsigned long jobflags = 0;
ctxt->node = node;
STRNEQ(mirror, "yes"))
invalidData = true;
+ if (virXPathULongHex("string(./@jobflags)", ctxt, &jobflags) != 0)
+ job->jobflagsmissing = true;
+
if (!disk && !invalidData) {
if ((tmp = virXPathNode("./chains/disk", ctxt)) &&
!(job->chain = qemuDomainObjPrivateXMLParseBlockjobChain(tmp, ctxt, xmlopt)))
job->state = state;
job->newstate = newstate;
+ job->jobflags = jobflags;
job->errmsg = virXPathString("string(./errmsg)", ctxt);
job->invalidData = invalidData;
job->disk = disk;
<allowReboot value='yes'/>
<nodename index='0'/>
<blockjobs active='yes'>
- <blockjob name='backup-vda-libvirt-3-format' type='backup' state='running'>
+ <blockjob name='backup-vda-libvirt-3-format' type='backup' state='running' jobflags='0x0'>
<disk dst='vda'/>
<bitmap name='bitmapname'/>
<store type='file' format='qcow2'>
</source>
</src>
</blockjob>
- <blockjob name='copy-vdd-libvirt-4321-format' type='copy' state='ready' shallownew='yes'>
+ <blockjob name='copy-vdd-libvirt-4321-format' type='copy' state='ready' jobflags='0x0' shallownew='yes'>
<disk dst='vdd'/>
</blockjob>
- <blockjob name='commit-vdc-libvirt-9-format' type='commit' state='running'>
+ <blockjob name='commit-vdc-libvirt-9-format' type='commit' state='running' jobflags='0x0'>
<disk dst='vdc'/>
<base node='libvirt-11-format'/>
<top node='libvirt-9-format'/>
<topparent node='libvirt-2-format'/>
</blockjob>
- <blockjob name='drive-virtio-disk0' type='copy' state='ready'>
+ <blockjob name='drive-virtio-disk0' type='copy' state='ready' jobflags='0x0'>
<disk dst='vda' mirror='yes'/>
</blockjob>
- <blockjob name='create-libvirt-1338-format' type='create' state='running'>
+ <blockjob name='create-libvirt-1338-format' type='create' state='running' jobflags='0xabcd'>
<chains>
<disk type='file' format='qcow2'>
<source file='/create/src1.qcow2' index='1339'>