提交 cb03fd93 编写于 作者: P Pavel Mores 提交者: Peter Krempa

qemu: block: propagate the delete flag to where it can actually be used

Propagate the delete flag from qemuDomainBlockCommit() (which was just
ignoring it until now) to qemuBlockJobDiskNewCommit() where it can be
stored in the qemuBlockJobCommitData structure which holds information
necessary to finish the job asynchronously.

In the actual qemuBlockJobDiskNewCommit() in this commit, we temporarily
pass a literal 'false' to preserve the current behaviour until the whole
implementation of the feature is in place.
Signed-off-by: NPavel Mores <pmores@redhat.com>
Reviewed-by: NPeter Krempa <pkrempa@redhat.com>
上级 b9a055a4
......@@ -282,7 +282,8 @@ qemuBlockJobDiskNewCommit(virDomainObjPtr vm,
virDomainDiskDefPtr disk,
virStorageSourcePtr topparent,
virStorageSourcePtr top,
virStorageSourcePtr base)
virStorageSourcePtr base,
bool delete_imgs)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
g_autoptr(qemuBlockJobData) job = NULL;
......@@ -305,6 +306,7 @@ qemuBlockJobDiskNewCommit(virDomainObjPtr vm,
job->data.commit.topparent = topparent;
job->data.commit.top = top;
job->data.commit.base = base;
job->data.commit.deleteCommittedImages = delete_imgs;
if (qemuBlockJobRegister(job, vm, disk, true) < 0)
return NULL;
......
......@@ -87,6 +87,7 @@ struct _qemuBlockJobCommitData {
virStorageSourcePtr topparent;
virStorageSourcePtr top;
virStorageSourcePtr base;
bool deleteCommittedImages;
};
......@@ -180,7 +181,8 @@ qemuBlockJobDiskNewCommit(virDomainObjPtr vm,
virDomainDiskDefPtr disk,
virStorageSourcePtr topparent,
virStorageSourcePtr top,
virStorageSourcePtr base);
virStorageSourcePtr base,
bool delete_imgs);
qemuBlockJobDataPtr
qemuBlockJobNewCreate(virDomainObjPtr vm,
......
......@@ -18686,7 +18686,7 @@ qemuDomainBlockCommit(virDomainPtr dom,
goto endjob;
if (!(job = qemuBlockJobDiskNewCommit(vm, disk, top_parent, topSource,
baseSource)))
baseSource, false)))
goto endjob;
disk->mirrorState = VIR_DOMAIN_DISK_MIRROR_STATE_NONE;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册