提交 10d62782 编写于 作者: P Peter Krempa

qemuBlockStorageSourceCreateFormat: Force write access when formatting images

We need qemu to be able to write the newly created images so that it can
format them to the specified storage format.

Force write access by relabelling the images when formatting.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 20939b03
......@@ -2671,6 +2671,12 @@ qemuBlockStorageSourceCreate(virDomainObjPtr vm,
return -1;
}
/* grant write access to read-only images during formatting */
if (src->readonly &&
qemuDomainStorageSourceAccessAllow(priv->driver, vm, src, false,
false, true) < 0)
return -1;
if (qemuDomainObjEnterMonitorAsync(priv->driver, vm, asyncJob) < 0)
goto cleanup;
......@@ -2697,6 +2703,12 @@ qemuBlockStorageSourceCreate(virDomainObjPtr vm,
asyncJob) < 0)
goto cleanup;
/* revoke write access to read-only images during formatting */
if (src->readonly &&
qemuDomainStorageSourceAccessAllow(priv->driver, vm, src, true,
false, true) < 0)
goto cleanup;
if (qemuDomainObjEnterMonitorAsync(priv->driver, vm, asyncJob) < 0)
goto cleanup;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册