From e3d4d25206a13ca48936e4357a53591997ce6d57 Mon Sep 17 00:00:00 2001 From: Michael Roth Date: Tue, 19 Jul 2011 15:41:55 -0500 Subject: guest agent: add guest agent RPCs/commands This adds the initial set of QMP/QAPI commands provided by the guest agent: guest-sync guest-ping guest-info guest-shutdown guest-file-open guest-file-read guest-file-write guest-file-seek guest-file-flush guest-file-close guest-fsfreeze-freeze guest-fsfreeze-thaw guest-fsfreeze-status The input/output specification for these commands are documented in the schema. Example usage: host: qemu -device virtio-serial \ -chardev socket,path=/tmp/vs0.sock,server,nowait,id=qga0 \ -device virtserialport,chardev=qga0,name=org.qemu.quest_agent.0 ... echo "{'execute':'guest-info'}" | socat stdio unix-connect:/tmp/qga0.sock guest: qemu-ga -m virtio-serial -p /dev/virtio-ports/org.qemu.guest_agent.0 \ -p /var/run/qemu-guest-agent.pid -d Signed-off-by: Michael Roth Signed-off-by: Luiz Capitulino --- qemu-ga.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'qemu-ga.c') diff --git a/qemu-ga.c b/qemu-ga.c index 1f3585c51e..6e2f61fe3c 100644 --- a/qemu-ga.c +++ b/qemu-ga.c @@ -636,6 +636,9 @@ int main(int argc, char **argv) g_log_set_default_handler(ga_log, s); g_log_set_fatal_mask(NULL, G_LOG_LEVEL_ERROR); s->logging_enabled = true; + s->command_state = ga_command_state_new(); + ga_command_state_init(s, s->command_state); + ga_command_state_init_all(s->command_state); ga_state = s; module_call_init(MODULE_INIT_QAPI); @@ -644,6 +647,7 @@ int main(int argc, char **argv) g_main_loop_run(ga_state->main_loop); + ga_command_state_cleanup_all(ga_state->command_state); unlink(pidfile); return 0; -- cgit v1.2.3-55-g7522