3cf0bed8 | 07-Feb-2012 |
Michael Roth <mdroth@linux.vnet.ibm.com> |
qemu-ga: add guest-sync-delimited
guest-sync leaves it as an exercise to the user as to how to reliably obtain the response to guest-sync if the client had previously read in a partial response (due
qemu-ga: add guest-sync-delimited
guest-sync leaves it as an exercise to the user as to how to reliably obtain the response to guest-sync if the client had previously read in a partial response (due qemu-ga previously being restarted mid-"sentence" due to reboot, forced restart, etc).
qemu-ga handles this situation on its end by having a client precede their guest-sync request with a 0xFF byte (invalid UTF-8), which qemu-ga/QEMU JSON parsers will treat as a flush event. Thus we can reliably flush the qemu-ga parser state in preparation for receiving the guest-sync request.
guest-sync-delimited provides the same functionality for a client: when a guest-sync-delimited is issued, qemu-ga will precede it's response with a 0xFF byte that the client can use as an indicator to flush its buffer/parser state in preparation for reliably receiving the guest-sync-delimited response.
It is also useful as an optimization for clients, since, after issuing a guest-sync-delimited, clients can safely discard all stale data read from the channel until the 0xFF is found.
More information available on the wiki:
http://wiki.qemu.org/Features/QAPI/GuestAgent#QEMU_Guest_Agent_Protocol
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
show more ...
|
3424fc9f | 29-Feb-2012 |
Michal Privoznik <mprivozn@redhat.com> |
qemu-ga: add guest-network-get-interfaces command
This command returns an array of:
[ifname, hwaddr, [ipaddr, ipaddr_family, prefix] ]
for each interface in the system. Currently, only IPv4 and I
qemu-ga: add guest-network-get-interfaces command
This command returns an array of:
[ifname, hwaddr, [ipaddr, ipaddr_family, prefix] ]
for each interface in the system. Currently, only IPv4 and IPv6 are supported.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
show more ...
|
aa59637e | 29-Jan-2012 |
Gal Hammer <ghammer@redhat.com> |
qemu-ga: add win32 guest-suspend-disk command.
Implement guest-suspend-disk RPC for Windows. Functionally this should be equivalent to the posix implementation.
Signed-off-by: Gal Hammer <ghammer@r
qemu-ga: add win32 guest-suspend-disk command.
Implement guest-suspend-disk RPC for Windows. Functionally this should be equivalent to the posix implementation.
Signed-off-by: Gal Hammer <ghammer@redhat.com>
show more ...
|
546b60d0 | 23-Jan-2012 |
Michael Roth <mdroth@linux.vnet.ibm.com> |
qemu-ga: add win32 guest-shutdown command
Implement guest-shutdown RPC for Windows. Functionally this should be equivalent to the posix implementation.
Original patch by Gal Hammer <ghammer@redhat.
qemu-ga: add win32 guest-shutdown command
Implement guest-shutdown RPC for Windows. Functionally this should be equivalent to the posix implementation.
Original patch by Gal Hammer <ghammer@redhat.com>
show more ...
|
bc62fa03 | 21-Jan-2012 |
Michael Roth <mdroth@linux.vnet.ibm.com> |
qemu-ga: add Windows service integration
This allows qemu-ga to function as a Windows service:
- to install the service (will auto-start on boot): qemu-ga --service install - to start the se
qemu-ga: add Windows service integration
This allows qemu-ga to function as a Windows service:
- to install the service (will auto-start on boot): qemu-ga --service install - to start the service: net start qemu-ga - to stop the service: net stop qemu-ga - to uninstall service: qemu-ga --service uninstall
Original patch by Gal Hammer <ghammer@redhat.com>
show more ...
|
7868e26e | 21-Jan-2012 |
Michael Roth <mdroth@linux.vnet.ibm.com> |
qemu-ga: add initial win32 support
This adds a win32 channel implementation that makes qemu-ga functional on Windows using virtio-serial (unix-listen/isa-serial not currently implemented). Unlike wi
qemu-ga: add initial win32 support
This adds a win32 channel implementation that makes qemu-ga functional on Windows using virtio-serial (unix-listen/isa-serial not currently implemented). Unlike with the posix implementation, we do not use GIOChannel for the following reasons:
- glib calls stat() on an fd to check whether S_IFCHR is set, which is the case for virtio-serial on win32. Because of that, a one-time check to determine whether the channel is readable is done by making a call to PeekConsoleInput(), which reports the underlying handle is not a valid console handle, and thus we can never read from the channel.
- if one goes as far as to "trick" glib into thinking it is a normal file descripter, the buffering is done in such a way that data written to the output stream will subsequently result in that same data being read back as if it were input, causing an error loop. furthermore, a forced flush of the channel only moves the data into a secondary buffer managed by glib, so there's no way to prevent output from getting read back as input.
The implementation here ties into the glib main loop by implementing a custom GSource that continually submits asynchronous/overlapped I/O to fill an GAChannel-managed read buffer, and tells glib to poll the corresponding event handle for a completion whenever there is no data/RPC in the read buffer to notify the main application about.
show more ...
|
42074a9d | 20-Jan-2012 |
Michael Roth <mdroth@linux.vnet.ibm.com> |
qemu-ga: separate out common commands from posix-specific ones
Many of the current RPC implementations are very much POSIX-specific and require complete re-writes for Windows. There are however a sm
qemu-ga: separate out common commands from posix-specific ones
Many of the current RPC implementations are very much POSIX-specific and require complete re-writes for Windows. There are however a small set of core guest agent commands that are common to both, and other commands such as guest-file-* which *may* be portable. So we introduce commands.c for the latter, and will rename guest-agent-commands.c to commands-posix.c in a future commit. Windows implementations will go in commands-win32.c, eventually.
show more ...
|
e3d4d252 | 19-Jul-2011 |
Michael Roth <mdroth@linux.vnet.ibm.com> |
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-rea
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 <mdroth@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@gmail.com>
show more ...
|
48ff7a62 | 20-Jul-2011 |
Michael Roth <mdroth@linux.vnet.ibm.com> |
guest agent: qemu-ga daemon
This is the actual guest daemon, it listens for requests over a virtio-serial/isa-serial/unix socket channel and routes them through to dispatch routines, and writes the
guest agent: qemu-ga daemon
This is the actual guest daemon, it listens for requests over a virtio-serial/isa-serial/unix socket channel and routes them through to dispatch routines, and writes the results back to the channel in a manner similar to QMP.
A shorthand invocation:
qemu-ga -d
Is equivalent to:
qemu-ga -m virtio-serial -p /dev/virtio-ports/org.qemu.guest_agent.0 \ -f /var/run/qemu-ga.pid -d
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@gmail.com>
show more ...
|