summaryrefslogtreecommitdiff
path: root/qga/commands-win32.c
AgeCommit message (Collapse)AuthorFilesLines
2012-03-12qemu-ga: add guest-network-get-interfaces commandMichal Privoznik1-0/+6
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>
2012-03-12qemu-ga: add win32 guest-suspend-ram commandMichael Roth1-9/+25
S3 sleep implementation for windows.
2012-03-12qemu-ga: add win32 guest-suspend-disk command.Gal Hammer1-12/+120
Implement guest-suspend-disk RPC for Windows. Functionally this should be equivalent to the posix implementation. Signed-off-by: Gal Hammer <ghammer@redhat.com>
2012-03-12qemu-ga: add guest-suspend-hybridLuiz Capitulino1-0/+5
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2012-03-12qemu-ga: add guest-suspend-ramLuiz Capitulino1-0/+5
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2012-03-12qemu-ga: add guest-suspend-diskLuiz Capitulino1-0/+5
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). Both functions will try to use the scripts provided by the pm-utils package if it's available. If it's not available, a manual method, which consists of directly writing to '/sys/power/state', will be used. To reap terminated children, a new signal handler is installed in the parent to catch SIGCHLD signals and a non-blocking call to waitpid() is done to collect their exit statuses. The statuses, however, are discarded. The approach used to query the guest for suspend support deserves some explanation. It's implemented by bios_supports_mode() and shown below: qemu-ga | create pipe | fork() ----------------- | | | | | fork() | -------------------------- | | | | | | | | exec('pm-is-supported') | | | wait() | write exit status to pipe | exit | read pipe This might look complex, but the resulting code is quite simple. The purpose of that approach is to allow qemu-ga to reap its children (semi-)automatically from its SIGCHLD handler. Implementing this the obvious way, that's, doing the exec() call from the first child process, would force us to introduce a more complex way to reap qemu-ga's children. Like registering PIDs to be reaped and having a way to wait for them when returning their exit status to qemu-ga is necessary. The approach explained above avoids that complexity. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2012-02-23qemu-ga: add win32 guest-shutdown commandMichael Roth1-1/+40
Implement guest-shutdown RPC for Windows. Functionally this should be equivalent to the posix implementation. Original patch by Gal Hammer <ghammer@redhat.com>
2012-02-23qemu-ga: fixes for win32 build of qemu-gaMichael Roth1-0/+91
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.