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: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
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;
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;