]> Git Repo - qemu.git/commit - qga/commands-posix.c
qga: ignore non present cpus when handling qmp_guest_get_vcpus()
authorIgor Mammedov <[email protected]>
Thu, 6 Sep 2018 12:51:54 +0000 (14:51 +0200)
committerMichael Roth <[email protected]>
Tue, 30 Oct 2018 21:48:49 +0000 (16:48 -0500)
commitb4bf912a6c19449e68af7b4173a8c6da21904d99
tree5487060e948f1940617f2105fb9ff0960159e8d6
parent0692b03ee135f6295168082199af55c6f289794d
qga: ignore non present cpus when handling qmp_guest_get_vcpus()

If VM has VCPUs plugged sparselly (for example a VM started with
3 VCPUs (cpu0, cpu1 and cpu2) and then cpu1 was hotunplugged so
only cpu0 and cpu2 are present), QGA will rise a error
  error: internal error: unable to execute QEMU agent command 'guest-get-vcpus':
  open("/sys/devices/system/cpu/cpu1/"): No such file or directory
when
  virsh vcpucount FOO --guest
is executed.
Fix it by ignoring non present CPUs when fetching CPUs status from sysfs.

Signed-off-by: Igor Mammedov <[email protected]>
Reviewed-by: Laszlo Ersek <[email protected]>
Reviewed-by: Marc-AndrĂ© Lureau <[email protected]>
Signed-off-by: Michael Roth <[email protected]>
qga/commands-posix.c
This page took 0.024597 seconds and 4 git commands to generate.