From b06a24927cfcc55eed6d1cc1ac6abf89d7869c88 Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Thu, 10 Nov 2022 15:35:54 +0100 Subject: [PATCH] USB: print_usbdevice_full: error out on invalid configuration should not happen normally, but an inattentive user of that function may forget to check the validity of the parsed device, so err on the safe side here Signed-off-by: Dominik Csapak --- PVE/QemuServer/USB.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PVE/QemuServer/USB.pm b/PVE/QemuServer/USB.pm index 3c8da2c0..b669c919 100644 --- a/PVE/QemuServer/USB.pm +++ b/PVE/QemuServer/USB.pm @@ -120,6 +120,8 @@ sub print_usbdevice_full { $usbdevice .= ",vendorid=0x$device->{vendorid},productid=0x$device->{productid}"; } elsif (defined($device->{hostbus}) && defined($device->{hostport})) { $usbdevice .= ",hostbus=$device->{hostbus},hostport=$device->{hostport}"; + } else { + die "no usb id or path given\n"; } $usbdevice .= ",id=$deviceid";