提交 2b41c862 编写于 作者: P Peter Krempa

qemu: Disallow pivot of shared disks to unsupported storage

Pivoting to a unsupported storage type might break the assumption that
shared disks will not corrupt metadata.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1511480
上级 9b2fbfa6
...@@ -16501,6 +16501,16 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver, ...@@ -16501,6 +16501,16 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver,
goto cleanup; goto cleanup;
} }
/* When pivoting to a shareable disk we need to make sure that the disk can
* be safely shared, since block copy might have changed the format. */
if (disk->src->shared && !disk->src->readonly &&
!qemuBlockStorageSourceSupportsConcurrentAccess(disk->mirror)) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("can't pivot a shared disk to a storage volume not "
"supporting sharing"));
goto cleanup;
}
/* For active commit, the mirror is part of the already labeled /* For active commit, the mirror is part of the already labeled
* chain. For blockcopy, we previously labeled only the top-level * chain. For blockcopy, we previously labeled only the top-level
* image; but if the user is reusing an external image that * image; but if the user is reusing an external image that
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册