qemu: taint domain if virDomainQemuAgentCommand API is used

This is similar to the virDomainQemuMonitorCommand API, it can change
the domain state in a way that libvirt may not understand.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
Pavel Hrdina 2017-11-14 17:28:48 +01:00
parent c7543a7286
commit b98add7571
3 changed files with 5 additions and 1 deletions

View File

@ -100,7 +100,8 @@ VIR_ENUM_IMPL(virDomainTaint, VIR_DOMAIN_TAINT_LAST,
"host-cpu",
"hook-script",
"cdrom-passthrough",
"custom-dtb");
"custom-dtb",
"custom-ga-command");
VIR_ENUM_IMPL(virDomainVirt, VIR_DOMAIN_VIRT_LAST,
"none",

View File

@ -2456,6 +2456,7 @@ typedef enum {
VIR_DOMAIN_TAINT_HOOK, /* Domain (possibly) changed via hook script */
VIR_DOMAIN_TAINT_CDROM_PASSTHROUGH,/* CDROM passthrough */
VIR_DOMAIN_TAINT_CUSTOM_DTB, /* Custom device tree blob was specified */
VIR_DOMAIN_TAINT_CUSTOM_GA_COMMAND, /* Custom guest agent command */
VIR_DOMAIN_TAINT_LAST
} virDomainTaintFlags;

View File

@ -18737,6 +18737,8 @@ qemuDomainQemuAgentCommand(virDomainPtr domain,
if (!qemuDomainAgentAvailable(vm, true))
goto endjob;
qemuDomainObjTaint(driver, vm, VIR_DOMAIN_TAINT_CUSTOM_GA_COMMAND, NULL);
agent = qemuDomainObjEnterAgent(vm);
ret = qemuAgentArbitraryCommand(agent, cmd, &result, timeout);
qemuDomainObjExitAgent(vm, agent);