Few switch cases returned failure but didn't report an error. For a
situation when the backingStore type='volume' was not translated the
following error would occur:
$ virsh start VM
error: Failed to start domain VM
error: An error occurred, but the cause is unknown
After this patch:
$ virsh start VM
error: Failed to start domain VM
error: internal error: storage source pool 'tmp' volume 'pull3.qcow2' is not translated
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
src/qemu/qemu_block.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
index 63116ef5f2..0ee10dd770 100644
--- a/src/qemu/qemu_block.c
+++ b/src/qemu/qemu_block.c
@@ -1081,8 +1081,14 @@ qemuBlockStorageSourceGetBackendProps(virStorageSourcePtr src,
break;
case VIR_STORAGE_TYPE_VOLUME:
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("storage source pool '%s' volume '%s' is not translated"),
+ src->srcpool->pool, src->srcpool->volume);
+ return NULL;
+
case VIR_STORAGE_TYPE_NONE:
case VIR_STORAGE_TYPE_LAST:
+ virReportEnumRangeError(virStorageType, actualType);
return NULL;
case VIR_STORAGE_TYPE_NETWORK:
@@ -1141,6 +1147,7 @@ qemuBlockStorageSourceGetBackendProps(virStorageSourcePtr src,
case VIR_STORAGE_NET_PROTOCOL_NONE:
case VIR_STORAGE_NET_PROTOCOL_LAST:
+ virReportEnumRangeError(virStorageNetProtocol, src->protocol);
return NULL;
}
break;
--
2.24.1
On Thu, Feb 06, 2020 at 10:24:31AM +0100, Peter Krempa wrote: > Few switch cases returned failure but didn't report an error. For a > situation when the backingStore type='volume' was not translated the > following error would occur: > > $ virsh start VM > error: Failed to start domain VM > error: An error occurred, but the cause is unknown > > After this patch: > > $ virsh start VM > error: Failed to start domain VM > error: internal error: storage source pool 'tmp' volume 'pull3.qcow2' is not translated > > Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Erik Skultety <eskultet@redhat.com>
On Thu, Feb 06, 2020 at 10:24:31AM +0100, Peter Krempa wrote: >Few switch cases returned failure but didn't report an error. For a >situation when the backingStore type='volume' was not translated the >following error would occur: > > $ virsh start VM > error: Failed to start domain VM > error: An error occurred, but the cause is unknown > >After this patch: > > $ virsh start VM > error: Failed to start domain VM > error: internal error: storage source pool 'tmp' volume 'pull3.qcow2' is not translated > >Signed-off-by: Peter Krempa <pkrempa@redhat.com> >--- > src/qemu/qemu_block.c | 7 +++++++ > 1 file changed, 7 insertions(+) > Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano
© 2016 - 2024 Red Hat, Inc.