]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemuBuildHostNetProps: Report proper errors for unhandled interface types
authorPeter Krempa <pkrempa@redhat.com>
Mon, 6 Mar 2023 08:18:51 +0000 (09:18 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 6 Mar 2023 12:35:52 +0000 (13:35 +0100)
commitf3a73384092f798261d99bf1ce099c8ea6cc91a9
tree244da72651da835711b0431062db7c2860afbb29
parent83a78633a73ee5f3bd251fe3af03587ec629fcc6
qemuBuildHostNetProps: Report proper errors for unhandled interface types

VIR_DOMAIN_NET_TYPE_NULL and VIR_DOMAIN_NET_TYPE_VDS are not implemented
for the qemu driver but the formatter code in 'qemuBuildHostNetProps'
didn't report an error for them and didn't even return from the function
when they were encountered.

This caused a crash in 'virJSONValueObjectAppendStringPrintf' which
does not tolerate NULL JSON object to append to when the unsupported
devices were used.

Properly report error when unhandled devices are encountered. This also
includes the case for VIR_DOMAIN_NET_TYPE_HOSTDEV, but that code path
should never be reached.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2175582
Fixes: bac6b266fb6a / 6457619d186
Fixes: 0225483adce
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_command.c