[libvirt] [PATCH v2 0/1] virsh: fixed handling of sourceless disks in 'domblkinfo' cmd

Pavel Mores posted 1 patch 1 week ago
Test syntax-check passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20191004113509.29243-1-pmores@redhat.com
tools/virsh-domain-monitor.c | 33 ++++++++++++++++++++-------------
1 file changed, 20 insertions(+), 13 deletions(-)

[libvirt] [PATCH v2 0/1] virsh: fixed handling of sourceless disks in 'domblkinfo' cmd

Posted by Pavel Mores 1 week ago
Integrating feedback to the original version.

This changes the approach to fixing the problem - previously, we called
virDomainGetBlockInfo() and if it failed, we mitigated the failure for CDROMs
and floppies specifically.  Now we first check for existence of a <source>
element in the corresponding XML and if we find none, we avoid calling
virDomainGetBlockInfo() altogether as we know it's bound to fail in that case.

The benefit is that whereas the previous fix swallowed all errors concerning
CDROMs and floppies - not just missing <source> - this one only handles
missing <source> specifically and doesn't mask other problems that might come
up.

The patch itself is fairly simple, unfortunately some noise is caused by
additional indentation of code related to the virDomainGetBlockInfo() call.
That code should however be unchanged (apart from reformating a comment to
keep line lengths under 80 chars).

Pavel Mores (1):
  fixed handling of sourceless disks in 'domblkinfo' cmd

 tools/virsh-domain-monitor.c | 33 ++++++++++++++++++++-------------
 1 file changed, 20 insertions(+), 13 deletions(-)

-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list