Statistics
| Branch: | Revision:

root / qemu-ga.c @ 31a32289

History | View | Annotate | Download (24.7 kB)

# Date Author Comment
9d6f1b73 10/09/2012 11:42 am Luiz Capitulino

qemu-ga: ga_open_pidfile(): add new line to pidfile

FHS requires that pid files should end with a new line. Also change to
snprintf() while there.

Signed-off-by: Luiz Capitulino <>
Reviewed-by: Michael Roth <>...

6a3c8c14 10/09/2012 11:40 am Luiz Capitulino

qemu-ga: use state dir from CONFIG_QEMU_LOCALSTATEDIR

Has the side effect of changing the default directory used to
save the freeze status file from /tmp to ${prefix}/var/run.

This is a beneficial change for two reasons:

1. FHS states that programs must not assume that files in /tmp will...
b5488288 09/23/2012 09:11 am Stefan Weil

qemu-ga: Remove unreachable code after g_error

Report from smatch:
qemu-ga.c:117 register_signal_handlers(11) info: ignoring unreachable code.
qemu-ga.c:122 register_signal_handlers(16) info: ignoring unreachable code.

g_error calls abort which terminates the program....

4bdb1a30 08/29/2012 04:25 pm Stefan Weil

qemu-ga: Fix null pointer passed to unlink in failure branch

Clang reports this warning:

Null pointer passed as an argument to a 'nonnull' parameter

Reviewed-by: Luiz Capitulino <>
Signed-off-by: Stefan Weil <>
Signed-off-by: Anthony Liguori <>

4144f122 08/22/2012 06:47 pm Jim Meyering

qemu-ga: don't leak a file descriptor upon failed lockf

Signed-off-by: Jim Meyering <>
Signed-off-by: Anthony Liguori <>

93b91c59 08/13/2012 08:17 pm Luiz Capitulino

qemu-ga: switch to the new error format on the wire

IMPORTANT: this BREAKS qemu-ga compatibility for the error response.

Instead of returning something like:

{ "error": { "class": "InvalidParameterValue",
"data": {"name": "mode", "expected": "halt|powerdown|reboot" } } }...

7795b166 08/13/2012 08:17 pm Luiz Capitulino

error: drop error_get_qobject()/error_set_qobject()

error_get_qobject() is unused since last commit, error_set_qobject()
has never been used. Also drops error_int.h.

Signed-off-by: Luiz Capitulino <>
Reviewed-by: Markus Armbruster <>

c8057f95 08/02/2012 09:16 pm Peter Maydell

Support 'help' as a synonym for '?' in command line options

For command line options which permit '?' meaning 'please list the
permitted values', add support for 'help' as a synonym, by abstracting
the check out into a helper function.

This change means that in some cases where we were being lazy in...

8efacc43 05/15/2012 05:17 pm Michael Roth

qemu-ga: align versioning with QEMU_VERSION

Previously qemu-ga version was defined seperately. Since it is aligned
with QEMU releases, use QEMU_VERSION instead. This also implies the
version bump for 1.1[-rcN] release of qemu-ga.

Reviewed-by: Michal Privoznik <>...

6c615ec5 05/15/2012 05:16 pm Michael Roth

qemu-ga: fix segv after failure to open log file

Currently, if we fail to open the specified log file (generally due to a
permissions issue), we'll assign NULL to the logfile handle (stderr,
initially) used by the logging routines, which can cause a segfault to...

ce8c8b7b 05/15/2012 05:15 pm Luiz Capitulino

qemu-ga: don't warn on no command return

This is a valid condition when a command chooses to not emit a
success response.

Signed-off-by: Luiz Capitulino <>
Signed-off-by: Michael Roth <>

04b4e75f 05/15/2012 05:15 pm Luiz Capitulino

qemu-ga: make reopen_fd_to_null() public

The next commit wants to use it.

Signed-off-by: Luiz Capitulino <>
Reviewed-by: Eric Blake <>
Signed-off-by: Michael Roth <>

226a4894 05/15/2012 05:15 pm Luiz Capitulino

qemu-ga: become_daemon(): reopen standard fds to /dev/null

This fixes a bug where qemu-ga doesn't suspend the guest because it
fails to detect suspend support even when the guest does support
suspend. This happens because of the way qemu-ga fds are managed in...

dc8764f0 05/15/2012 05:15 pm Luiz Capitulino

qemu-ga: guest-suspend: make the API synchronous

Currently, qemu-ga has a SIGCHLD handler that automatically reaps terminated
children processes. The idea is to avoid having qemu-ga commands blocked
waiting for children to terminate.

That approach has two problems:...

a31f0531 05/14/2012 08:27 am Jim Meyering

fix some common typos

These were identified using: http://github.com/lyda/misspell-check
and run like this to create a bourne shell script using GNU sed's
-i option:

git ls-files|grep -vF .bin | misspellings -f - |grep -v '^ERROR:' |perl \
-pe 's/^(.*?)\[(\d+)\]: (\w+) -> "(.*?)"$/sed -i '\''${2}s!$3!$4!'\'' $1/'...

f789aa7b 04/30/2012 04:42 pm Michael Roth

qemu-ga: persist tracking of fsfreeze state via filesystem

Currently, qemu-ga may die/get killed/go away for whatever reason after
guest-fsfreeze-freeze has been issued, and before guest-fsfreeze-thaw
has been issued. This means the only way to unfreeze the guest is via...

f22d85e9 04/30/2012 04:42 pm Michael Roth

qemu-ga: add a whitelist for fsfreeze-safe commands

Currently we rely on fsfreeze/thaw commands disabling/enabling logging
then having other commands check whether logging is disabled to avoid
executing if they aren't safe for running while a filesystem is frozen....

4bdd0416 04/19/2012 06:45 pm Michael Roth

qemu-ga: fix help output

Reviewed-by: Luiz Capitulino <>

3cf0bed8 03/12/2012 10:09 pm Michael Roth

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)....

11d0f125 03/12/2012 10:09 pm Luiz Capitulino

qemu-ga: add guest-suspend-disk

As the command name implies, this command suspends the guest to disk.

The suspend operation is implemented by two functions: bios_supports_mode()
and guest_suspend(). Both functions are generic enough to be used by
other suspend modes (introduced by next commits)....

bc62fa03 02/23/2012 11:43 pm Michael Roth

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...
7868e26e 02/23/2012 11:43 pm Michael Roth

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:...

125b310e 02/23/2012 11:40 pm Michael Roth

qemu-ga: move channel/transport functionality into wrapper class

This is mostly in preparation for the win32 port, which won't use
GIO channels for reasons that will be made clearer later. Here the
GAChannel class is just a loose wrapper around GIOChannel...

d8ca685a 02/23/2012 11:40 pm Michael Roth

qemu-ga: fixes for win32 build of qemu-ga

Various stubs and #ifdefs to compile for Windows using mingw
cross-build. Still has 1 linker error due to a dependency on the
forthcoming win32 versions of the GAChannel/transport class.

dabdf394 01/13/2012 12:36 pm Stefan Weil

Spelling fixes in comments and documentation

Codespell detected these new spelling issues.

Signed-off-by: Stefan Weil <>
Signed-off-by: Stefan Hajnoczi <>

abd6cf6d 12/13/2011 01:06 am Michael Roth

guest agent: add RPC blacklist command-line option

This adds a command-line option, -b/--blacklist, that accepts a
comma-seperated list of RPCs to disable, or prints a list of
available RPCs if passed "?".

In consequence this also adds general blacklisting and RPC listing...

2542bfd5 08/29/2011 01:47 pm Stefan Weil

Fix spelling in comments and debug messages (recieve -> receive)

Signed-off-by: Stefan Weil <>
Reviewed-by: Andreas Färber <>
Signed-off-by: Stefan Hajnoczi <>

8f477478 08/22/2011 02:27 am Michael Roth

guest agent: remove g_strcmp0 usage

g_strcmp0 isn't in all version of glib 2.0, so don't use it to avoid
build breakage on older distros.

Signed-off-by: Michael Roth <>
Signed-off-by: Michael Roth <>
Signed-off-by: Anthony Liguori <>

7267c094 08/21/2011 07:01 am Anthony Liguori

Use glib memory allocation and free functions

qemu_malloc/qemu_free no longer exist after this commit.

Signed-off-by: Anthony Liguori <>

1fc7bd4a 07/24/2011 02:24 am Anthony Liguori

qemu-ga: remove dependency on gio and gthread

As far as I can tell, there isn't a dependency on gthread. Also, the only use
of gio was to enable GSocket to accept a unix domain socket.

Since GSocket isn't available on OpenSuSE 11.1, let's just remove that...

48ff7a62 07/21/2011 10:48 pm Michael Roth

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.
...

e3d4d252 07/21/2011 10:48 pm Michael Roth

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...