]> xenbits.xensource.com Git - libvirt.git/commit
qemu: don't access vmdef within qemu_agent.c
authorJonathon Jongsma <jjongsma@redhat.com>
Fri, 10 Jan 2020 23:32:13 +0000 (17:32 -0600)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 16 Jan 2020 15:35:47 +0000 (16:35 +0100)
commit599ae372d8cf0923757c5a3792acb07dcf3e8802
tree0bdc111992964adae6758608fa20752009ffa00d
parent306b4cb070b8f57a22a261d1f097283f4ef84e65
qemu: don't access vmdef within qemu_agent.c

In order to avoid holding an agent job and a normal job at the same
time, we want to avoid accessing the domain's definition while holding
the agent job. To achieve this, qemuAgentGetFSInfo() only returns the
raw information from the agent query to the caller. The caller can then
release the agent job and then proceed to look up the disk alias from
the vm definition. This necessitates moving a few helper functions to
qemu_driver.c and exposing the agent data structure (qemuAgentFSInfo) in
the header.

In addition, because the agent function no longer returns the looked-up
disk alias, we can't test the alias within qemuagenttest.  Instead we
simply test that we parse and return the raw agent data correctly.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_agent.c
src/qemu/qemu_agent.h
src/qemu/qemu_driver.c
tests/qemuagenttest.c