[PATCH 0/4] Storage volume (crash) fixes

Patch 1/4 should go into this release, the rest can wait. Peter Krempa (4): storageBackendProbeTarget: Check return value of virStorageSourceNewFromBacking storageBackendProbeTarget: Don't fail if backing store can't be parsed virStorageVolDefFormat: Extract formatting of source extents virStorageVolDefFormat: Don't format empty <source> src/conf/storage_conf.c | 59 +++++++++++-------- src/storage/storage_util.c | 5 +- .../storagevolxml2xmlout/vol-file-backing.xml | 2 - tests/storagevolxml2xmlout/vol-file-iso.xml | 2 - .../storagevolxml2xmlout/vol-file-naming.xml | 2 - tests/storagevolxml2xmlout/vol-file.xml | 2 - .../vol-gluster-dir-neg-uid.xml | 2 - .../storagevolxml2xmlout/vol-gluster-dir.xml | 2 - .../vol-logical-backing.xml | 2 - tests/storagevolxml2xmlout/vol-logical.xml | 2 - .../storagevolxml2xmlout/vol-luks-cipher.xml | 2 - tests/storagevolxml2xmlout/vol-luks.xml | 2 - tests/storagevolxml2xmlout/vol-partition.xml | 2 - .../vol-qcow2-0.10-lazy.xml | 2 - tests/storagevolxml2xmlout/vol-qcow2-1.1.xml | 2 - .../vol-qcow2-encryption.xml | 2 - tests/storagevolxml2xmlout/vol-qcow2-lazy.xml | 2 - tests/storagevolxml2xmlout/vol-qcow2-luks.xml | 2 - .../vol-qcow2-nobacking.xml | 2 - .../vol-qcow2-nocapacity.xml | 2 - tests/storagevolxml2xmlout/vol-qcow2.xml | 2 - tests/storagevolxml2xmlout/vol-sheepdog.xml | 2 - 22 files changed, 35 insertions(+), 69 deletions(-) -- 2.29.2

Commit bc3a78f61a2aaac3 errorneously removed the return value check from virStorageSourceNewFromBacking. In cases when we e.g. can't parse the backing store string this leads to a crash: #0 virStorageSourceGetActualType (def=0x0) at ../../../libvirt/src/conf/storage_source_conf.c:1014 #1 0x00007ffff7cee4f9 in virStorageSourceIsLocalStorage (src=<optimized out>) at ../../../libvirt/src/conf/storage_source_conf.c:1026 #2 0x00007ffff455c97c in storageBackendProbeTarget (encryption=0x7fff9c122ce8, target=0x7fff9c122c68) at ../../../libvirt/src/storage/storage_util.c:3443 #3 virStorageBackendRefreshVolTargetUpdate (vol=0x7fff9c122c30) at ../../../libvirt/src/storage/storage_util.c:3519 #4 0x00007ffff455cdc0 in virStorageBackendRefreshLocal (pool=0x7fff9c010ea0) at ../../../libvirt/src/storage/storage_util.c:3593 #5 0x00007ffff454f0a1 in storagePoolRefreshImpl (backend=backend@entry=0x7ffff4711180 <virStorageBackendDirectory>, obj=obj@entry=0x7fff9c010ea0, stateFile=stateFile@entry=0x7fff9c111a90 "/var/run/libvirt/storage/tmp.xml") at ../../../libvirt/src/storage/storage_driver.c:103 #6 0x00007ffff4550ea5 in storagePoolUpdateStateCallback (obj=0x7fff9c010ea0, opaque=<optimized out>) at ../../../libvirt/src/storage/storage_driver.c:165 #7 0x00007ffff7cefef4 in virStoragePoolObjListForEachCb (payload=<optimized out>, name=<optimized out>, opaque=0x7fffc8a489c0) at ../../../libvirt/src/conf/virstorageobj.c:435 #8 0x00007ffff7c03195 in virHashForEachSafe (table=<optimized out>, iter=iter@entry=0x7ffff7cefec0 <virStoragePoolObjListForEachCb>, opaque=opaque@entry=0x7fffc8a489c0) at ../../../libvirt/src/util/virhash.c:414 #9 0x00007ffff7cf0520 in virStoragePoolObjListForEach (pools=<optimized out>, iter=iter@entry=0x7ffff4550e10 <storagePoolUpdateStateCallback>, opaque=opaque@entry=0x0) at ../../../libvirt/src/conf/virstorageobj.c:468 #10 0x00007ffff454f43a in storagePoolUpdateAllState () at ../../../libvirt/src/storage/storage_driver.c:184 #11 storageStateInitialize (privileged=<optimized out>, root=<optimized out>, callback=<optimized out>, opaque=<optimized out>) at ../../../libvirt/src/storage/storage_driver.c:315 #12 0x00007ffff7e10c04 in virStateInitialize (opaque=0x555555621820, callback=0x55555557b1d0 <daemonInhibitCallback>, root=0x0, mandatory=<optimized out>, privileged=true) at ../../../libvirt/src/libvirt.c:656 #13 virStateInitialize (privileged=<optimized out>, mandatory=mandatory@entry=false, root=root@entry=0x0, callback=callback@entry=0x55555557b1d0 <daemonInhibitCallback>, opaque=opaque@entry=0x555555621820) at ../../../libvirt/src/libvirt.c:638 #14 0x000055555557b230 in daemonRunStateInit (opaque=0x555555621820) at ../../../libvirt/src/remote/remote_daemon.c:605 #15 0x00007ffff7c46bb5 in virThreadHelper (data=<optimized out>) at ../../../libvirt/src/util/virthread.c:233 #16 0x00007ffff6e453f9 in start_thread () at /lib64/libpthread.so.0 #17 0x00007ffff766fb53 in clone () at /lib64/libc.so An invalid image can be easily created by: $ qemu-img create -f qcow2 -F qcow2 -b 'json:{' -u img.qcow2 10M Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/storage/storage_util.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c index b5adb05826..e71715f908 100644 --- a/src/storage/storage_util.c +++ b/src/storage/storage_util.c @@ -3435,7 +3435,8 @@ storageBackendProbeTarget(virStorageSourcePtr target, return -1; if (meta->backingStoreRaw) { - virStorageSourceNewFromBacking(meta, &target->backingStore); + if (virStorageSourceNewFromBacking(meta, &target->backingStore) < 0) + return -1; /* XXX: Remote storage doesn't play nicely with volumes backed by * remote storage. To avoid trouble, just fake the backing store is RAW -- 2.29.2

When the backing store of the image can't be parsed virStorageSourceNewFromBacking returns -1. storageBackendProbeTarget then also fails which makes the pool refresh fail or even the storage pool becomes inactive after (re)start of libvirtd. In situations when we can't access the backing store via network we just report the backing store string, thus we can do the same thing for unparsable backing store to prevent the pool from going offline. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/storage/storage_util.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c index e71715f908..db2c7a18bf 100644 --- a/src/storage/storage_util.c +++ b/src/storage/storage_util.c @@ -3435,13 +3435,11 @@ storageBackendProbeTarget(virStorageSourcePtr target, return -1; if (meta->backingStoreRaw) { - if (virStorageSourceNewFromBacking(meta, &target->backingStore) < 0) - return -1; - /* XXX: Remote storage doesn't play nicely with volumes backed by * remote storage. To avoid trouble, just fake the backing store is RAW * and put the string from the metadata as the path of the target. */ - if (!virStorageSourceIsLocalStorage(target->backingStore)) { + if (virStorageSourceNewFromBacking(meta, &target->backingStore) < 0 || + !virStorageSourceIsLocalStorage(target->backingStore)) { virObjectUnref(target->backingStore); target->backingStore = virStorageSourceNew(); -- 2.29.2

Move the extent formatting code into virStorageVolDefFormatSourceExtents. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/conf/storage_conf.c | 53 +++++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index 0f515c7cbb..1bc27ff194 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -1643,6 +1643,34 @@ virStorageVolTargetDefFormat(virStorageVolOptionsPtr options, } +static void +virStorageVolDefFormatSourceExtents(virBufferPtr buf, + virStorageVolDefPtr def) +{ + size_t i; + const char *thispath = NULL; + for (i = 0; i < def->source.nextent; i++) { + if (thispath == NULL || + STRNEQ(thispath, def->source.extents[i].path)) { + if (thispath != NULL) + virBufferAddLit(buf, "</device>\n"); + + virBufferEscapeString(buf, "<device path='%s'>\n", + def->source.extents[i].path); + } + + virBufferAdjustIndent(buf, 2); + virBufferAsprintf(buf, "<extent start='%llu' end='%llu'/>\n", + def->source.extents[i].start, + def->source.extents[i].end); + virBufferAdjustIndent(buf, -2); + thispath = def->source.extents[i].path; + } + if (thispath != NULL) + virBufferAddLit(buf, "</device>\n"); +} + + char * virStorageVolDefFormat(virStoragePoolDefPtr pool, virStorageVolDefPtr def) @@ -1663,29 +1691,8 @@ virStorageVolDefFormat(virStoragePoolDefPtr pool, virBufferAddLit(&buf, "<source>\n"); virBufferAdjustIndent(&buf, 2); - if (def->source.nextent) { - size_t i; - const char *thispath = NULL; - for (i = 0; i < def->source.nextent; i++) { - if (thispath == NULL || - STRNEQ(thispath, def->source.extents[i].path)) { - if (thispath != NULL) - virBufferAddLit(&buf, "</device>\n"); - - virBufferEscapeString(&buf, "<device path='%s'>\n", - def->source.extents[i].path); - } - - virBufferAdjustIndent(&buf, 2); - virBufferAsprintf(&buf, "<extent start='%llu' end='%llu'/>\n", - def->source.extents[i].start, - def->source.extents[i].end); - virBufferAdjustIndent(&buf, -2); - thispath = def->source.extents[i].path; - } - if (thispath != NULL) - virBufferAddLit(&buf, "</device>\n"); - } + if (def->source.nextent) + virStorageVolDefFormatSourceExtents(&buf, def); virBufferAdjustIndent(&buf, -2); virBufferAddLit(&buf, "</source>\n"); -- 2.29.2

On 2/25/21 2:26 PM, Peter Krempa wrote:
Move the extent formatting code into virStorageVolDefFormatSourceExtents.
Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/conf/storage_conf.c | 53 +++++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 23 deletions(-)
diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index 0f515c7cbb..1bc27ff194 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -1643,6 +1643,34 @@ virStorageVolTargetDefFormat(virStorageVolOptionsPtr options, }
+static void +virStorageVolDefFormatSourceExtents(virBufferPtr buf, + virStorageVolDefPtr def) +{ + size_t i; + const char *thispath = NULL;
Insert an empty line here, please.
+ for (i = 0; i < def->source.nextent; i++) { + if (thispath == NULL || + STRNEQ(thispath, def->source.extents[i].path)) { + if (thispath != NULL) + virBufferAddLit(buf, "</device>\n"); + + virBufferEscapeString(buf, "<device path='%s'>\n", + def->source.extents[i].path); + } + + virBufferAdjustIndent(buf, 2); + virBufferAsprintf(buf, "<extent start='%llu' end='%llu'/>\n", + def->source.extents[i].start, + def->source.extents[i].end); + virBufferAdjustIndent(buf, -2); + thispath = def->source.extents[i].path; + } + if (thispath != NULL) + virBufferAddLit(buf, "</device>\n"); +} +
Michal

If there are no source extents the volume XML has an empty <source> element. Remove it if there's nothing in it by using virXMLFormatElement. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/conf/storage_conf.c | 10 +++++----- tests/storagevolxml2xmlout/vol-file-backing.xml | 2 -- tests/storagevolxml2xmlout/vol-file-iso.xml | 2 -- tests/storagevolxml2xmlout/vol-file-naming.xml | 2 -- tests/storagevolxml2xmlout/vol-file.xml | 2 -- tests/storagevolxml2xmlout/vol-gluster-dir-neg-uid.xml | 2 -- tests/storagevolxml2xmlout/vol-gluster-dir.xml | 2 -- tests/storagevolxml2xmlout/vol-logical-backing.xml | 2 -- tests/storagevolxml2xmlout/vol-logical.xml | 2 -- tests/storagevolxml2xmlout/vol-luks-cipher.xml | 2 -- tests/storagevolxml2xmlout/vol-luks.xml | 2 -- tests/storagevolxml2xmlout/vol-partition.xml | 2 -- tests/storagevolxml2xmlout/vol-qcow2-0.10-lazy.xml | 2 -- tests/storagevolxml2xmlout/vol-qcow2-1.1.xml | 2 -- tests/storagevolxml2xmlout/vol-qcow2-encryption.xml | 2 -- tests/storagevolxml2xmlout/vol-qcow2-lazy.xml | 2 -- tests/storagevolxml2xmlout/vol-qcow2-luks.xml | 2 -- tests/storagevolxml2xmlout/vol-qcow2-nobacking.xml | 2 -- tests/storagevolxml2xmlout/vol-qcow2-nocapacity.xml | 2 -- tests/storagevolxml2xmlout/vol-qcow2.xml | 2 -- tests/storagevolxml2xmlout/vol-sheepdog.xml | 2 -- 21 files changed, 5 insertions(+), 45 deletions(-) diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index 1bc27ff194..c840bc4b4f 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -1677,6 +1677,7 @@ virStorageVolDefFormat(virStoragePoolDefPtr pool, { virStorageVolOptionsPtr options; g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; + g_auto(virBuffer) sourceChildBuf = VIR_BUFFER_INITIALIZER; options = virStorageVolOptionsForPoolType(pool->type); if (options == NULL) @@ -1688,14 +1689,13 @@ virStorageVolDefFormat(virStoragePoolDefPtr pool, virBufferEscapeString(&buf, "<name>%s</name>\n", def->name); virBufferEscapeString(&buf, "<key>%s</key>\n", def->key); - virBufferAddLit(&buf, "<source>\n"); - virBufferAdjustIndent(&buf, 2); + + virBufferSetIndent(&sourceChildBuf, virBufferGetIndent(&buf) + 2); if (def->source.nextent) - virStorageVolDefFormatSourceExtents(&buf, def); + virStorageVolDefFormatSourceExtents(&sourceChildBuf, def); - virBufferAdjustIndent(&buf, -2); - virBufferAddLit(&buf, "</source>\n"); + virXMLFormatElement(&buf, "source", NULL, &sourceChildBuf); virBufferAsprintf(&buf, "<capacity unit='bytes'>%llu</capacity>\n", def->target.capacity); diff --git a/tests/storagevolxml2xmlout/vol-file-backing.xml b/tests/storagevolxml2xmlout/vol-file-backing.xml index cd33bee523..e4180a8a00 100644 --- a/tests/storagevolxml2xmlout/vol-file-backing.xml +++ b/tests/storagevolxml2xmlout/vol-file-backing.xml @@ -1,8 +1,6 @@ <volume type='file'> <name>sparse.img</name> <key>/var/lib/libvirt/images/sparse.img</key> - <source> - </source> <capacity unit='bytes'>10000000000</capacity> <allocation unit='bytes'>0</allocation> <target> diff --git a/tests/storagevolxml2xmlout/vol-file-iso.xml b/tests/storagevolxml2xmlout/vol-file-iso.xml index 9783124b34..955bafd453 100644 --- a/tests/storagevolxml2xmlout/vol-file-iso.xml +++ b/tests/storagevolxml2xmlout/vol-file-iso.xml @@ -1,7 +1,5 @@ <volume type='file'> <name>test.iso</name> - <source> - </source> <capacity unit='bytes'>1048576</capacity> <allocation unit='bytes'>1048576</allocation> <target> diff --git a/tests/storagevolxml2xmlout/vol-file-naming.xml b/tests/storagevolxml2xmlout/vol-file-naming.xml index e515502af1..d1b1c1d2ba 100644 --- a/tests/storagevolxml2xmlout/vol-file-naming.xml +++ b/tests/storagevolxml2xmlout/vol-file-naming.xml @@ -1,7 +1,5 @@ <volume type='file'> <name><sparse>.img</name> - <source> - </source> <capacity unit='bytes'>1099511627776</capacity> <allocation unit='bytes'>0</allocation> <target> diff --git a/tests/storagevolxml2xmlout/vol-file.xml b/tests/storagevolxml2xmlout/vol-file.xml index 2923188e65..884cf73797 100644 --- a/tests/storagevolxml2xmlout/vol-file.xml +++ b/tests/storagevolxml2xmlout/vol-file.xml @@ -1,7 +1,5 @@ <volume type='file'> <name>sparse.img</name> - <source> - </source> <capacity unit='bytes'>1099511627776</capacity> <allocation unit='bytes'>0</allocation> <target> diff --git a/tests/storagevolxml2xmlout/vol-gluster-dir-neg-uid.xml b/tests/storagevolxml2xmlout/vol-gluster-dir-neg-uid.xml index 0af0be179d..8dd0f7472f 100644 --- a/tests/storagevolxml2xmlout/vol-gluster-dir-neg-uid.xml +++ b/tests/storagevolxml2xmlout/vol-gluster-dir-neg-uid.xml @@ -1,8 +1,6 @@ <volume type='netdir'> <name>dir</name> <key>vol/dir</key> - <source> - </source> <capacity unit='bytes'>0</capacity> <allocation unit='bytes'>0</allocation> <target> diff --git a/tests/storagevolxml2xmlout/vol-gluster-dir.xml b/tests/storagevolxml2xmlout/vol-gluster-dir.xml index d4222489ec..fa01f98938 100644 --- a/tests/storagevolxml2xmlout/vol-gluster-dir.xml +++ b/tests/storagevolxml2xmlout/vol-gluster-dir.xml @@ -1,8 +1,6 @@ <volume type='netdir'> <name>dir</name> <key>vol/dir</key> - <source> - </source> <capacity unit='bytes'>0</capacity> <allocation unit='bytes'>0</allocation> <target> diff --git a/tests/storagevolxml2xmlout/vol-logical-backing.xml b/tests/storagevolxml2xmlout/vol-logical-backing.xml index 07fe27767d..7200f32f7f 100644 --- a/tests/storagevolxml2xmlout/vol-logical-backing.xml +++ b/tests/storagevolxml2xmlout/vol-logical-backing.xml @@ -1,8 +1,6 @@ <volume type='block'> <name>Swap</name> <key>r4xkCv-MQhr-WKIT-R66x-Epn2-e8hG-1Z5gY0</key> - <source> - </source> <capacity unit='bytes'>2080374784</capacity> <allocation unit='bytes'>2080374784</allocation> <target> diff --git a/tests/storagevolxml2xmlout/vol-logical.xml b/tests/storagevolxml2xmlout/vol-logical.xml index 0df5cc0864..ddaf0e24f5 100644 --- a/tests/storagevolxml2xmlout/vol-logical.xml +++ b/tests/storagevolxml2xmlout/vol-logical.xml @@ -1,8 +1,6 @@ <volume type='block'> <name>Swap</name> <key>r4xkCv-MQhr-WKIT-R66x-Epn2-e8hG-1Z5gY0</key> - <source> - </source> <capacity unit='bytes'>2080374784</capacity> <allocation unit='bytes'>2080374784</allocation> <target> diff --git a/tests/storagevolxml2xmlout/vol-luks-cipher.xml b/tests/storagevolxml2xmlout/vol-luks-cipher.xml index 2b58850aaf..fd99793612 100644 --- a/tests/storagevolxml2xmlout/vol-luks-cipher.xml +++ b/tests/storagevolxml2xmlout/vol-luks-cipher.xml @@ -1,8 +1,6 @@ <volume type='file'> <name>LuksDemo.img</name> <key>/var/lib/libvirt/images/LuksDemo.img</key> - <source> - </source> <capacity unit='bytes'>5368709120</capacity> <allocation unit='bytes'>294912</allocation> <target> diff --git a/tests/storagevolxml2xmlout/vol-luks.xml b/tests/storagevolxml2xmlout/vol-luks.xml index 599b3c5c4d..c011d4cc62 100644 --- a/tests/storagevolxml2xmlout/vol-luks.xml +++ b/tests/storagevolxml2xmlout/vol-luks.xml @@ -1,8 +1,6 @@ <volume type='file'> <name>LuksDemo.img</name> <key>/var/lib/libvirt/images/LuksDemo.img</key> - <source> - </source> <capacity unit='bytes'>5368709120</capacity> <allocation unit='bytes'>294912</allocation> <target> diff --git a/tests/storagevolxml2xmlout/vol-partition.xml b/tests/storagevolxml2xmlout/vol-partition.xml index 147899edb1..dd9793fbb4 100644 --- a/tests/storagevolxml2xmlout/vol-partition.xml +++ b/tests/storagevolxml2xmlout/vol-partition.xml @@ -1,8 +1,6 @@ <volume type='block'> <name>sda1</name> <key>/dev/sda1</key> - <source> - </source> <capacity unit='bytes'>106896384</capacity> <allocation unit='bytes'>106896384</allocation> <target> diff --git a/tests/storagevolxml2xmlout/vol-qcow2-0.10-lazy.xml b/tests/storagevolxml2xmlout/vol-qcow2-0.10-lazy.xml index 9b666ad5bc..afcd330e2d 100644 --- a/tests/storagevolxml2xmlout/vol-qcow2-0.10-lazy.xml +++ b/tests/storagevolxml2xmlout/vol-qcow2-0.10-lazy.xml @@ -1,8 +1,6 @@ <volume type='file'> <name>OtherDemo.img</name> <key>/var/lib/libvirt/images/OtherDemo.img</key> - <source> - </source> <capacity unit='bytes'>5368709120</capacity> <allocation unit='bytes'>294912</allocation> <target> diff --git a/tests/storagevolxml2xmlout/vol-qcow2-1.1.xml b/tests/storagevolxml2xmlout/vol-qcow2-1.1.xml index c033f5bd57..634b0a409a 100644 --- a/tests/storagevolxml2xmlout/vol-qcow2-1.1.xml +++ b/tests/storagevolxml2xmlout/vol-qcow2-1.1.xml @@ -1,8 +1,6 @@ <volume type='file'> <name>OtherDemo.img</name> <key>/var/lib/libvirt/images/OtherDemo.img</key> - <source> - </source> <capacity unit='bytes'>5368709120</capacity> <allocation unit='bytes'>294912</allocation> <target> diff --git a/tests/storagevolxml2xmlout/vol-qcow2-encryption.xml b/tests/storagevolxml2xmlout/vol-qcow2-encryption.xml index 31dc57873c..837adf41b1 100644 --- a/tests/storagevolxml2xmlout/vol-qcow2-encryption.xml +++ b/tests/storagevolxml2xmlout/vol-qcow2-encryption.xml @@ -1,8 +1,6 @@ <volume type='file'> <name>OtherDemo.img</name> <key>/var/lib/libvirt/images/OtherDemo.img</key> - <source> - </source> <capacity unit='bytes'>5368709120</capacity> <allocation unit='bytes'>294912</allocation> <target> diff --git a/tests/storagevolxml2xmlout/vol-qcow2-lazy.xml b/tests/storagevolxml2xmlout/vol-qcow2-lazy.xml index ee79e26050..fc6b7542d8 100644 --- a/tests/storagevolxml2xmlout/vol-qcow2-lazy.xml +++ b/tests/storagevolxml2xmlout/vol-qcow2-lazy.xml @@ -1,8 +1,6 @@ <volume type='file'> <name>OtherDemo.img</name> <key>/var/lib/libvirt/images/OtherDemo.img</key> - <source> - </source> <capacity unit='bytes'>5368709120</capacity> <allocation unit='bytes'>294912</allocation> <target> diff --git a/tests/storagevolxml2xmlout/vol-qcow2-luks.xml b/tests/storagevolxml2xmlout/vol-qcow2-luks.xml index 2e2b7ce125..78edc4239c 100644 --- a/tests/storagevolxml2xmlout/vol-qcow2-luks.xml +++ b/tests/storagevolxml2xmlout/vol-qcow2-luks.xml @@ -1,8 +1,6 @@ <volume type='file'> <name>OtherDemoLuks.img</name> <key>/var/lib/libvirt/images/OtherDemoLuks.img</key> - <source> - </source> <capacity unit='bytes'>5368709120</capacity> <allocation unit='bytes'>294912</allocation> <target> diff --git a/tests/storagevolxml2xmlout/vol-qcow2-nobacking.xml b/tests/storagevolxml2xmlout/vol-qcow2-nobacking.xml index e8281e3b50..7600e25cc1 100644 --- a/tests/storagevolxml2xmlout/vol-qcow2-nobacking.xml +++ b/tests/storagevolxml2xmlout/vol-qcow2-nobacking.xml @@ -1,8 +1,6 @@ <volume type='file'> <name>OtherDemo.img</name> <key>/var/lib/libvirt/images/OtherDemo.img</key> - <source> - </source> <capacity unit='bytes'>5368709120</capacity> <allocation unit='bytes'>294912</allocation> <target> diff --git a/tests/storagevolxml2xmlout/vol-qcow2-nocapacity.xml b/tests/storagevolxml2xmlout/vol-qcow2-nocapacity.xml index dbf9003213..a83adb8176 100644 --- a/tests/storagevolxml2xmlout/vol-qcow2-nocapacity.xml +++ b/tests/storagevolxml2xmlout/vol-qcow2-nocapacity.xml @@ -1,8 +1,6 @@ <volume type='file'> <name>OtherDemo.img</name> <key>/var/lib/libvirt/images/OtherDemo.img</key> - <source> - </source> <capacity unit='bytes'>0</capacity> <allocation unit='bytes'>0</allocation> <target> diff --git a/tests/storagevolxml2xmlout/vol-qcow2.xml b/tests/storagevolxml2xmlout/vol-qcow2.xml index a7d612135f..8c942d4b78 100644 --- a/tests/storagevolxml2xmlout/vol-qcow2.xml +++ b/tests/storagevolxml2xmlout/vol-qcow2.xml @@ -1,8 +1,6 @@ <volume type='file'> <name>OtherDemo.img</name> <key>/var/lib/libvirt/images/OtherDemo.img</key> - <source> - </source> <capacity unit='bytes'>5368709120</capacity> <allocation unit='bytes'>294912</allocation> <target> diff --git a/tests/storagevolxml2xmlout/vol-sheepdog.xml b/tests/storagevolxml2xmlout/vol-sheepdog.xml index d6e920bb81..47fb8eb418 100644 --- a/tests/storagevolxml2xmlout/vol-sheepdog.xml +++ b/tests/storagevolxml2xmlout/vol-sheepdog.xml @@ -1,7 +1,5 @@ <volume type='network'> <name>test2</name> - <source> - </source> <capacity unit='bytes'>1024</capacity> <allocation unit='bytes'>0</allocation> <target> -- 2.29.2

On 2/25/21 2:26 PM, Peter Krempa wrote:
Patch 1/4 should go into this release, the rest can wait.
Peter Krempa (4): storageBackendProbeTarget: Check return value of virStorageSourceNewFromBacking storageBackendProbeTarget: Don't fail if backing store can't be parsed virStorageVolDefFormat: Extract formatting of source extents virStorageVolDefFormat: Don't format empty <source>
src/conf/storage_conf.c | 59 +++++++++++-------- src/storage/storage_util.c | 5 +- .../storagevolxml2xmlout/vol-file-backing.xml | 2 - tests/storagevolxml2xmlout/vol-file-iso.xml | 2 - .../storagevolxml2xmlout/vol-file-naming.xml | 2 - tests/storagevolxml2xmlout/vol-file.xml | 2 - .../vol-gluster-dir-neg-uid.xml | 2 - .../storagevolxml2xmlout/vol-gluster-dir.xml | 2 - .../vol-logical-backing.xml | 2 - tests/storagevolxml2xmlout/vol-logical.xml | 2 - .../storagevolxml2xmlout/vol-luks-cipher.xml | 2 - tests/storagevolxml2xmlout/vol-luks.xml | 2 - tests/storagevolxml2xmlout/vol-partition.xml | 2 - .../vol-qcow2-0.10-lazy.xml | 2 - tests/storagevolxml2xmlout/vol-qcow2-1.1.xml | 2 - .../vol-qcow2-encryption.xml | 2 - tests/storagevolxml2xmlout/vol-qcow2-lazy.xml | 2 - tests/storagevolxml2xmlout/vol-qcow2-luks.xml | 2 - .../vol-qcow2-nobacking.xml | 2 - .../vol-qcow2-nocapacity.xml | 2 - tests/storagevolxml2xmlout/vol-qcow2.xml | 2 - tests/storagevolxml2xmlout/vol-sheepdog.xml | 2 - 22 files changed, 35 insertions(+), 69 deletions(-)
Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Michal
participants (2)
-
Michal Privoznik
-
Peter Krempa