diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c index 27b02cb410f8e9cc24a286478319273c07ee8041..5cada391be14a8801619178545068ea3c51bd9ee 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 0000000000000000000000000000000000000000..fd1f4c078eff9850694a38c33be4a1645ec59a69 --- /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 2a45f6f3cab250892232e3e775fc155a7cd4d0ad..f9d2d2dd3216e7aff75ed8a827e693b1d9e9a07a 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);