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 <mdroth@linux.vnet.ibm.com>
Signed-off-by: Luiz Capitulino <lcapitulino@gmail.com>
		
	
			
		
			
				
	
	
		
			32 lines
		
	
	
		
			985 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
		
			985 B
		
	
	
	
		
			C
		
	
	
	
	
	
/*
 | 
						|
 * QEMU Guest Agent core declarations
 | 
						|
 *
 | 
						|
 * Copyright IBM Corp. 2011
 | 
						|
 *
 | 
						|
 * Authors:
 | 
						|
 *  Adam Litke        <aglitke@linux.vnet.ibm.com>
 | 
						|
 *  Michael Roth      <mdroth@linux.vnet.ibm.com>
 | 
						|
 *
 | 
						|
 * This work is licensed under the terms of the GNU GPL, version 2 or later.
 | 
						|
 * See the COPYING file in the top-level directory.
 | 
						|
 */
 | 
						|
#include "qapi/qmp-core.h"
 | 
						|
#include "qemu-common.h"
 | 
						|
 | 
						|
#define QGA_VERSION "1.0"
 | 
						|
#define QGA_READ_COUNT_DEFAULT 4 << 10
 | 
						|
 | 
						|
typedef struct GAState GAState;
 | 
						|
typedef struct GACommandState GACommandState;
 | 
						|
 | 
						|
void ga_command_state_init(GAState *s, GACommandState *cs);
 | 
						|
void ga_command_state_add(GACommandState *cs,
 | 
						|
                          void (*init)(void),
 | 
						|
                          void (*cleanup)(void));
 | 
						|
void ga_command_state_init_all(GACommandState *cs);
 | 
						|
void ga_command_state_cleanup_all(GACommandState *cs);
 | 
						|
GACommandState *ga_command_state_new(void);
 | 
						|
bool ga_logging_enabled(GAState *s);
 | 
						|
void ga_disable_logging(GAState *s);
 | 
						|
void ga_enable_logging(GAState *s);
 |