qemu supports the @allow-write-only-overlay feature since qemu-5.0.
Remove the alternate code paths.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
* to copy data into the backing chain while the top image is being
* copied shallow */
if (reuse && shallow &&
- virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV_SNAPSHOT_ALLOW_WRITE_ONLY) &&
virStorageSourceHasBacking(disk->mirror)) {
if (qemuProcessPrepareHostStorageSourceChain(vm, disk->mirror->backingStore) < 0)
qemuBlockJobData *job,
virDomainAsyncJob asyncJob)
{
- qemuDomainObjPrivate *priv = vm->privateData;
g_autoptr(virStorageSource) mirror = NULL;
VIR_DEBUG("copy job '%s' on VM '%s' aborted", job->name, vm->def->name);
bool reuse = job->jobflags & VIR_DOMAIN_BLOCK_COPY_REUSE_EXT;
/* In the special case of a shallow copy with reused image we don't
- * hotplug the full chain when QEMU_CAPS_BLOCKDEV_SNAPSHOT_ALLOW_WRITE_ONLY
- * is supported. Attempting to delete it would thus result in spurious
- * errors as we'd attempt to blockdev-del images which were not added
- * yet */
+ * hotplug the full chain. Attempting to delete it would thus result in
+ * spurious errors as we'd attempt to blockdev-del images which were
+ * not added yet */
if (reuse && shallow &&
- virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV_SNAPSHOT_ALLOW_WRITE_ONLY) &&
virStorageSourceHasBacking(job->disk->mirror))
g_clear_pointer(&job->disk->mirror->backingStore, virObjectUnref);
}
* level is being copied. To restore this semantics if
* blockdev-reopen is supported defer opening of the backing chain
* of 'mirror' to the pivot step */
- if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV_SNAPSHOT_ALLOW_WRITE_ONLY)) {
- g_autoptr(virStorageSource) terminator = virStorageSourceNew();
+ g_autoptr(virStorageSource) terminator = virStorageSourceNew();
- if (qemuProcessPrepareHostStorageSource(vm, mirror) < 0)
- goto endjob;
-
- if (!(data = qemuBuildStorageSourceChainAttachPrepareBlockdevTop(mirror,
- terminator)))
- goto endjob;
- } else {
- if (qemuProcessPrepareHostStorageSourceChain(vm, mirror) < 0)
- goto endjob;
+ if (qemuProcessPrepareHostStorageSource(vm, mirror) < 0)
+ goto endjob;
- if (!(data = qemuBuildStorageSourceChainAttachPrepareBlockdev(mirror)))
- goto endjob;
- }
+ if (!(data = qemuBuildStorageSourceChainAttachPrepareBlockdevTop(mirror,
+ terminator)))
+ goto endjob;
} else {
if (!(blockNamedNodeData = qemuBlockGetNamedNodeData(vm, VIR_ASYNC_JOB_NONE)))
goto endjob;