diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 767790bfc06f5407a83d863ce8dd9e58de5edc38..27926c7670eb4389ae56954903dbf6d0b1a24183 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -2586,6 +2586,8 @@ qemuDomainObjPrivateXMLFormatBlockjobIterator(void *payload,
virBufferAsprintf(&childBuf, "\n", job->data.commit.top->nodeformat);
if (job->data.commit.topparent)
virBufferAsprintf(&childBuf, "\n", job->data.commit.topparent->nodeformat);
+ if (job->data.commit.deleteCommittedImages)
+ virBufferAddLit(&childBuf, "\n");
break;
case QEMU_BLOCKJOB_TYPE_CREATE:
@@ -3185,6 +3187,8 @@ qemuDomainObjPrivateXMLParseBlockjobDataSpecific(qemuBlockJobDataPtr job,
"string(./base/@node)",
&job->data.commit.base,
ctxt);
+ if (virXPathNode("./deleteCommittedImages", ctxt))
+ job->data.commit.deleteCommittedImages = true;
if (!job->data.commit.top ||
!job->data.commit.base)
goto broken;
diff --git a/tests/qemustatusxml2xmldata/blockjob-blockdev-in.xml b/tests/qemustatusxml2xmldata/blockjob-blockdev-in.xml
index 67ab099bd99fd59a75b9d86359adf9acfa9f4ba5..b5d62fd4aba8b537e0c8a18ef581306f4636a016 100644
--- a/tests/qemustatusxml2xmldata/blockjob-blockdev-in.xml
+++ b/tests/qemustatusxml2xmldata/blockjob-blockdev-in.xml
@@ -242,6 +242,7 @@
+