qemu-server/PVE
Dominik Csapak 844b55fb89 fix #2510: hostpci: always check if device exists
if the user set a device as hostpci with the 'shorthand' syntax:

hostpciX: 00:12

we ignored it on starting and showcmd and continued.
Since the user explicitly wanted to passthrough a device, we now check
if there is actually a device with that id

for explicitly configured devices (00:12.1), we did not check if it exists,
but the kvm call failed with a non-obvious error message

now we always call 'lspci' from SysFSTools to check if it actually exists,
and fail if not. With this, we can drop the workaround for adding
'0000' if no domain was given, since lspci does it already for us

this fixes #2510, an issue with using mediated devices where the users did not have
the domain in the config, since we forgot to add the default domain there

the only issue with this patch is that it changes the behaviour of
'showcmd' slightly, as in now, we die if the device was explicitly
given, but did not exists (we showed the commandline, now we fail)

this also slightly changes the commandline for qemu (adding always
the domain), which is not a problem since we cannot live migrate
or snapshot such vms, but we have to adapt the tests

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-12-09 11:30:14 +01:00
..
API2 api: allow to clear vmstate actively 2019-11-30 18:22:38 +01:00
CLI refactor: create QemuServer::Monitor for high-level QMP access 2019-11-20 16:29:23 +01:00
QemuServer mon_cmd: add explicit return 2019-11-30 17:24:55 +01:00
VZDump vzdump: log QGA FS freeze/thaw try in task log 2019-11-27 20:20:30 +01:00
Makefile buildsys: use $(MAKE) instead of make 2019-09-24 18:06:16 +02:00
QemuConfig.pm refactor: extract QEMU machine related helpers to package 2019-11-20 16:29:23 +01:00
QemuMigrate.pm refactor storage whitelist in sync_disks to regex 2019-12-04 18:40:03 +01:00
QemuServer.pm fix #2510: hostpci: always check if device exists 2019-12-09 11:30:14 +01:00
QMPClient.pm refactor: create QemuServer::Helpers and move file/dir code 2019-11-20 16:29:23 +01:00