diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c index 27b02cb410..5cada391be 100644 --- a/src/storage/storage_backend.c +++ b/src/storage/storage_backend.c @@ -887,7 +887,7 @@ virStorageBackendCreateQemuImgCmd(virConnectPtr conn, * backing store, not really sure what use it serves though, and it * may cause issues with lvm. Untested essentially. */ - if (inputvol && + if (inputvol && inputvol->target.backingStore && STRNEQ_NULLABLE(inputvol->target.backingStore->path, vol->target.backingStore->path)) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", diff --git a/tests/storagevolxml2argvdata/qcow2-convert-nobacking.argv b/tests/storagevolxml2argvdata/qcow2-convert-nobacking.argv new file mode 100644 index 0000000000..fd1f4c078e --- /dev/null +++ b/tests/storagevolxml2argvdata/qcow2-convert-nobacking.argv @@ -0,0 +1,2 @@ +qemu-img convert -f raw -O qcow2 -o encryption=on \ +/var/lib/libvirt/images/sparse.img /var/lib/libvirt/images/OtherDemo.img diff --git a/tests/storagevolxml2argvtest.c b/tests/storagevolxml2argvtest.c index 2a45f6f3ca..f9d2d2dd32 100644 --- a/tests/storagevolxml2argvtest.c +++ b/tests/storagevolxml2argvtest.c @@ -235,6 +235,9 @@ mymain(void) DO_TEST("pool-dir", "vol-qcow2-nobacking", "pool-dir", "vol-file", "qcow2-nobacking-convert-prealloc", flags, FMT_OPTIONS); + DO_TEST_FAIL("pool-dir", "vol-qcow2", + "pool-dir", "vol-file", + "qcow2-convert-nobacking", 0, FMT_OPTIONS); DO_TEST_FAIL("pool-dir", "vol-qcow2", "pool-dir", "vol-file", "qcow2-convert-prealloc", flags, FMT_OPTIONS);