]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: move the guest status check before agent config and status check
authorLuyao Huang <lhuang@redhat.com>
Fri, 3 Jul 2015 06:58:05 +0000 (14:58 +0800)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 8 Jul 2015 08:51:51 +0000 (10:51 +0200)
commit0b3fcfb1eac845ba24ac2ad6eefb969d5f7b8395
tree8478bc0bd59f7badeedfa17984add645505fb939
parent3b2b4114da4341feaf477cec7bc20556810e11e7
qemu: move the guest status check before agent config and status check

When use setvcpus command with --guest option to a offline vm,
we will get error:

 # virsh setvcpus test3 1 --guest
 error: Guest agent is not responding: QEMU guest agent is not connected

However guest is not running, agent status could not be connected.
In this case, report domain is not running will be better than agent is
not connected. Move the guest status check more early to output error to
point out guest status is not right.

Also from the logic, a running vm is a basic requirement to use
agent, we cannot use agent if vm is not running.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_domain.c