adding Irix (and, to a lesser extent, Solaris) userland emulation to QEMU
Go to file
Luiz Capitulino 11d0f1255b 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).

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-03-12 15:09:18 -05:00
QMP qmp: add DEVICE_TRAY_MOVED event 2012-02-22 17:23:50 -02:00
audio audio: Add some fall through comments 2012-02-25 18:16:11 +04:00
block block/vmdk: Fix warning from splint (comparision of unsigned value) 2012-03-07 13:03:51 +00:00
bsd-user elf: Improve symbol lookup (optimize, fix for bsd-user) 2012-01-10 18:40:09 +01:00
darwin-user
default-configs Merge remote-tracking branch 'bonzini/virtio-scsi' into staging 2012-02-24 09:33:03 -06:00
docs libcacard: Spelling and grammar fixes in documentation 2012-03-08 15:22:11 +00:00
fpu
fsdev fsdev: Fix parameter parsing for proxy helper 2012-01-30 10:54:16 +05:30
gdb-xml
hw Add missing const attributes for MemoryRegionOps 2012-03-11 11:40:15 +00:00
include/qemu Spelling fixes in comments (it's -> its) 2012-03-08 15:22:11 +00:00
libcacard Merge remote-tracking branch 'stefanha/trivial-patches' into staging 2012-03-09 12:30:20 -06:00
linux-headers PPC: KVM: Update HIOR code to new interface 2012-02-02 02:47:45 +01:00
linux-user Spelling fixes in comments (it's -> its) 2012-03-08 15:22:11 +00:00
net net: remove extra spaces in help messages 2012-02-10 10:44:52 +00:00
pc-bios pc-bios: update kvmvapic.bin 2012-03-01 12:58:46 +02:00
qapi qapi: add string-based visitors 2012-02-21 10:21:05 +01:00
qga qemu-ga: add guest-suspend-disk 2012-03-12 15:09:18 -05:00
qom qom: In function object_set_link_property(), first call object_ref(), then object_unref(). 2012-02-22 13:24:30 -06:00
roms pseries: SLOF PCI flag day 2012-01-21 05:17:02 +01:00
scripts qerror: add check-qerror.sh to verify alphabetical order 2012-01-18 10:23:39 -02:00
slirp slirp: Fix assertion failure on rejected DHCP requests 2012-02-27 14:55:07 +01:00
sysconfigs/target cpu defs: uncomment empty extfeatures_ecx definition for Opteron_G1 (v2) 2012-02-22 13:24:30 -06:00
target-alpha target-alpha: Clean includes 2012-02-28 22:33:41 +01:00
target-arm target-arm: Clean includes 2012-02-28 22:33:42 +01:00
target-cris target-cris: Clean includes 2012-02-28 22:33:42 +01:00
target-i386 target-i386: Mask NX bit from cpu_get_phys_page_debug result 2012-03-11 11:22:39 +00:00
target-lm32 target-lm32: Clean includes 2012-02-28 22:33:42 +01:00
target-m68k target-m68k: Clean includes 2012-02-28 22:33:42 +01:00
target-microblaze target-microblaze: Clean includes 2012-02-28 22:33:42 +01:00
target-mips Spelling fixes in comments (it's -> its) 2012-03-08 15:22:11 +00:00
target-ppc target-ppc: Clean includes 2012-02-28 22:33:42 +01:00
target-s390x Move helpers.h to helper.h 2012-03-05 19:51:18 +01:00
target-sh4 target-sh4: Clean includes 2012-02-28 22:33:43 +01:00
target-sparc target-sparc: Fix mixup of uint64 and uint64_t 2012-01-22 09:55:35 +00:00
target-unicore32 target-unicore32: Clean includes 2012-02-28 22:33:43 +01:00
target-xtensa Merge branch 'upstream' of git://qemu.weilnetz.de/qemu 2012-03-03 17:59:06 +00:00
tcg tcg: Improve tcg_out_label and fix its usage for w64 2012-03-11 11:28:39 +00:00
tests Merge branch 'xtensa' of git://jcmvbkbc.spb.ru/dumb/qemu-xtensa 2012-03-03 17:53:41 +00:00
trace
ui vnc: Add break statement 2012-03-08 15:22:11 +00:00
.gitignore Merge remote-tracking branch 'qemu-kvm/uq/master' into staging 2012-03-01 15:26:01 -06:00
.gitmodules
.mailmap
CODING_STYLE CODING_STYLE: Clarify style for enum and function type names 2012-02-10 10:44:51 +00:00
COPYING
COPYING.LIB
Changelog
HACKING
LICENSE
MAINTAINERS xilinx_zynq: machine model initial version 2012-03-07 02:20:19 +01:00
Makefile build: Include config-host.mak as soon as possible 2012-03-11 11:24:27 +00:00
Makefile.dis
Makefile.hw make: Remove duplicate use of GLIB_CFLAGS 2012-02-09 20:44:38 +04:00
Makefile.objs i8254: Factor out base class for KVM reuse 2012-03-07 12:27:40 +02:00
Makefile.target kvm: x86: Add user space part for in-kernel i8254 2012-03-07 12:27:43 +02:00
Makefile.user
README
TODO
VERSION
a.out.h
acl.c
acl.h
aes.c
aes.h
aio.c prepare for future GPLv2+ relicensing 2012-01-13 10:55:56 -06:00
alpha-dis.c
alpha.ld
arch_init.c pcspk: Convert to qdev 2012-02-17 09:58:22 -06:00
arch_init.h
arm-dis.c
arm-semi.c
arm.ld
async.c
balloon.c
balloon.h
bitmap.c
bitmap.h
bitops.c
bitops.h
block-migration.c prepare for future GPLv2+ relicensing 2012-01-13 10:55:56 -06:00
block-migration.h
block.c qapi: Introduce blockdev-group-snapshot-sync command 2012-02-29 15:48:33 +01:00
block.h qapi: Introduce blockdev-group-snapshot-sync command 2012-02-29 15:48:33 +01:00
block_int.h qapi: Introduce blockdev-group-snapshot-sync command 2012-02-29 15:48:33 +01:00
blockdev.c qapi: Introduce blockdev-group-snapshot-sync command 2012-02-29 15:48:33 +01:00
blockdev.h qapi: Convert block_set_io_throttle 2012-01-18 10:23:39 -02:00
bswap.h
bt-host.c bt-host: add missing break statement 2012-01-13 10:37:00 +00:00
bt-host.h
bt-vhci.c
buffered_file.c prepare for future GPLv2+ relicensing 2012-01-13 10:55:56 -06:00
buffered_file.h
cache-utils.c
cache-utils.h cache-utils: Add missing include file for uintptr_t 2012-03-11 11:25:19 +00:00
check-qdict.c check-qdict: convert to gtest 2012-01-12 10:05:37 -06:00
check-qfloat.c check-qfloat: convert to gtest 2012-01-12 10:05:37 -06:00
check-qint.c check-qint: convert to gtest 2012-01-12 10:05:37 -06:00
check-qjson.c check-qjson: enable disabled tests 2012-01-12 10:05:38 -06:00
check-qlist.c check-qlist: convert to gtest 2012-01-12 10:05:38 -06:00
check-qstring.c check-qstring: remove check.h include 2012-01-12 11:33:22 -06:00
cmd.c
cmd.h
compatfd.c prepare for future GPLv2+ relicensing 2012-01-13 10:55:56 -06:00
compatfd.h
compiler.h rewrite QEMU_BUILD_BUG_ON 2012-02-09 16:17:51 +01:00
config.h
configure configure: Test for libiberty.a (mingw32) 2012-03-11 11:28:07 +00:00
console.c optimize screendump for the common non-switch case 2012-02-24 13:36:05 -06:00
console.h optimize screendump for the common non-switch case 2012-02-24 13:36:05 -06:00
coroutine-gthread.c
coroutine-ucontext.c coroutine: switch to QSLIST 2012-02-17 08:33:33 -06:00
coroutine-win32.c
cpu-all.h target-i386: Add infrastructure for reporting TPR MMIO accesses 2012-02-18 12:15:55 +02:00
cpu-common.h w64: Fix size of ram_addr_t 2012-03-03 18:10:16 +00:00
cpu-defs.h Remove macro HOST_LONG_SIZE 2012-02-28 22:33:41 +01:00
cpu-exec.c cpu-exec.c: Correct comment about this file and indentation cleanup 2012-02-10 10:44:52 +00:00
cpus.c Allow to use pause_all_vcpus from VCPU context 2012-02-18 12:15:54 +02:00
cpus.h
cris-dis.c
cursor.c Fix sign of sscanf format specifiers 2012-03-07 13:03:51 +00:00
cursor_hidden.xpm
cursor_left_ptr.xpm
cutils.c cutils: extract buffer_is_zero() from qemu-img.c 2012-02-09 16:17:50 +01:00
def-helper.h
device_tree.c
device_tree.h
dis-asm.h
disas.c
disas.h
dma-helpers.c dma-helpers: add accounting wrappers 2012-02-22 13:29:07 +01:00
dma.h dma-helpers: add accounting wrappers 2012-02-22 13:29:07 +01:00
dyngen-exec.h
elf.h
envlist.c
envlist.h
error.c
error.h
error_int.h
event_notifier.c prepare for future GPLv2+ relicensing 2012-01-13 10:55:56 -06:00
event_notifier.h prepare for future GPLv2+ relicensing 2012-01-13 10:55:56 -06:00
exec-all.h
exec-memory.h
exec-obsolete.h memory: use a MemoryListener for core memory map updates too 2012-02-29 13:44:42 +02:00
exec.c memory: fix I/O port aliases 2012-03-05 17:40:12 +02:00
gdbstub.c gdbstub: Do not kill target in system emulation mode 2012-03-11 11:23:19 +00:00
gdbstub.h
gen-icount.h
hmp-commands.hx Merge branch 'xtensa' of git://jcmvbkbc.spb.ru/dumb/qemu-xtensa 2012-03-03 17:53:41 +00:00
hmp.c suspend: add system_wakeup monitor command 2012-02-24 13:36:03 -06:00
hmp.h suspend: add system_wakeup monitor command 2012-02-24 13:36:03 -06:00
host-utils.c
host-utils.h
hppa-dis.c
hppa.ld
i386-dis.c
i386.ld
ia64-dis.c
ia64.ld
input.c input: send kbd+mouse events only to running guests. 2012-02-17 11:02:55 -06:00
int128.h
iohandler.c
ioport-user.c
ioport.c ioport: add destructor method to IORange 2012-03-05 17:36:19 +02:00
ioport.h ioport: add destructor method to IORange 2012-03-05 17:36:19 +02:00
iorange.h ioport: add destructor method to IORange 2012-03-05 17:36:19 +02:00
iov.c prepare for future GPLv2+ relicensing 2012-01-13 10:55:56 -06:00
iov.h
json-lexer.c Add 'fall through' comments to case statements without break 2012-01-13 10:36:59 +00:00
json-lexer.h
json-parser.c
json-parser.h
json-streamer.c
json-streamer.h
kvm-all.c Merge remote-tracking branch 'stefanha/trivial-patches' into staging 2012-03-09 12:30:20 -06:00
kvm-stub.c kvm: Add kvm_has_pit_state2 helper 2012-03-07 12:27:42 +02:00
kvm.h kvm: Add kvm_has_pit_state2 helper 2012-03-07 12:27:42 +02:00
libfdt_env.h
linux-aio.c
m68k-dis.c
m68k-semi.c
m68k.ld
main-loop.c main-loop: For tools, initialize timers as part of qemu_init_main_loop() 2012-02-01 14:45:02 -06:00
main-loop.h main-loop: For tools, initialize timers as part of qemu_init_main_loop() 2012-02-01 14:45:02 -06:00
memory.c memory: fix I/O port aliases 2012-03-05 17:40:12 +02:00
memory.h memory: fix I/O port aliases 2012-03-05 17:40:12 +02:00
microblaze-dis.c
migration-exec.c prepare for future GPLv2+ relicensing 2012-01-13 10:55:56 -06:00
migration-fd.c prepare for future GPLv2+ relicensing 2012-01-13 10:55:56 -06:00
migration-tcp.c prepare for future GPLv2+ relicensing 2012-01-13 10:55:56 -06:00
migration-unix.c prepare for future GPLv2+ relicensing 2012-01-13 10:55:56 -06:00
migration.c notifier: switch to QLIST 2012-02-17 08:33:32 -06:00
migration.h
mips-dis.c
mips.ld
module.c prepare for future GPLv2+ relicensing 2012-01-13 10:55:56 -06:00
module.h qom: Unify type registration 2012-02-15 09:39:21 -06:00
monitor.c Merge branch 'xtensa' of git://jcmvbkbc.spb.ru/dumb/qemu-xtensa 2012-03-03 17:53:41 +00:00
monitor.h suspend: add qmp events 2012-02-24 13:36:04 -06:00
nbd.c
nbd.h
net.c w32: Fix build with new net bridge code 2012-02-04 11:49:34 +00:00
net.h Add support for net bridge 2012-02-01 16:24:40 -06:00
notify.c notifier: switch to QLIST 2012-02-17 08:33:32 -06:00
notify.h notifier: switch to QLIST 2012-02-17 08:33:32 -06:00
os-posix.c keep the PID file locked for the lifetime of the process 2012-02-01 16:23:57 -06:00
os-win32.c
osdep.c
osdep.h osdep: Remove local definition of macro offsetof 2012-03-08 15:22:12 +00:00
oslib-posix.c
oslib-win32.c
path.c
pci-ids.txt
pflib.c prepare for future GPLv2+ relicensing 2012-01-13 10:55:56 -06:00
pflib.h
poison.h
posix-aio-compat.c prepare for future GPLv2+ relicensing 2012-01-13 10:55:56 -06:00
ppc-dis.c
ppc.ld
ppc64.ld
qapi-schema-guest.json qemu-ga: add guest-suspend-disk 2012-03-12 15:09:18 -05:00
qapi-schema-test.json
qapi-schema.json qapi: Introduce blockdev-group-snapshot-sync command 2012-02-29 15:48:33 +01:00
qbool.c
qbool.h
qdict-test-data.txt
qdict.c
qdict.h
qemu-aio.h
qemu-barrier.h
qemu-bridge-helper.c Add cap reduction support to enable use as SUID 2012-02-01 16:24:39 -06:00
qemu-char.c qemu-char: qemu_chr_open_fd() can't fail, don't check 2012-02-24 09:06:57 -06:00
qemu-char.h qdev: nuke qdev_init_chardev() 2012-02-03 10:41:08 -06:00
qemu-common.h w64: Don't redefine lseek, ftruncate 2012-03-11 11:27:30 +00:00
qemu-config.c arm: add device tree support 2012-03-02 11:56:38 +00:00
qemu-config.h
qemu-coroutine-int.h coroutine: switch to QSLIST 2012-02-17 08:33:33 -06:00
qemu-coroutine-io.c
qemu-coroutine-lock.c
qemu-coroutine-sleep.c coroutine: add co_sleep_ns() coroutine sleep function 2012-01-26 11:45:26 +01:00
qemu-coroutine.c
qemu-coroutine.h coroutine: add co_sleep_ns() coroutine sleep function 2012-01-26 11:45:26 +01:00
qemu-doc.texi iSCSI: add configuration variables for iSCSI 2012-02-09 16:17:50 +01:00
qemu-error.c
qemu-error.h
qemu-file.h Spelling fixes in comments (it's -> its) 2012-03-08 15:22:11 +00:00
qemu-ga.c qemu-ga: add guest-suspend-disk 2012-03-12 15:09:18 -05:00
qemu-img-cmds.hx
qemu-img.c qemu-img: fix segment fault when the image format is qed 2012-02-29 16:05:07 +01:00
qemu-img.texi
qemu-io.c qemu-io: fix segment fault when the image format is qed 2012-02-29 16:05:00 +01:00
qemu-lock.h
qemu-log.h
qemu-nbd.c open /dev/nbd in nbd_client_thread 2012-02-17 12:41:59 +01:00
qemu-nbd.texi
qemu-objects.h
qemu-option.c qemu-option: Add support for merged QemuOptsLists 2012-02-17 09:08:22 +01:00
qemu-option.h qemu-option: Add support for merged QemuOptsLists 2012-02-17 09:08:22 +01:00
qemu-options-wrapper.h
qemu-options.h
qemu-options.hx qemu-options.hx: allow -dtb argument for all archs 2012-03-05 23:00:15 +01:00
qemu-os-posix.h
qemu-os-win32.h
qemu-progress.c
qemu-queue.h qemu-queue: drop QCIRCLEQ 2012-02-17 08:33:33 -06:00
qemu-sockets.c sockets: Clean up inet_listen_opts()'s convoluted bind() loop 2012-02-24 09:06:58 -06:00
qemu-tech.texi
qemu-thread-posix.c
qemu-thread-posix.h
qemu-thread-win32.c w32: Initialise critical section before starting thread (fix #922131) 2012-02-07 18:11:41 +01:00
qemu-thread-win32.h
qemu-thread.h
qemu-timer-common.c
qemu-timer.c notifier: switch to QLIST 2012-02-17 08:33:32 -06:00
qemu-timer.h ptimer: move declarations to ptimer.h 2012-01-13 10:20:50 -06:00
qemu-tls.h
qemu-tool.c qemu-tool: revert cpu_get_clock() abort(3) 2012-02-29 15:48:44 +01:00
qemu-x509.h
qemu-xattr.h
qemu.sasl
qemu_socket.h
qerror.c qdev: print error message before aborting 2012-02-14 18:57:33 +00:00
qerror.h qdev: print error message before aborting 2012-02-14 18:57:33 +00:00
qfloat.c
qfloat.h
qint.c
qint.h
qjson.c
qjson.h
qlist.c
qlist.h
qmp-commands.hx QMP: Add qmp command for blockdev-group-snapshot-sync 2012-02-29 15:48:39 +01:00
qmp.c suspend: add system_wakeup monitor command 2012-02-24 13:36:03 -06:00
qobject.h
qstring.c
qstring.h
range.h
readline.c
readline.h
rules.mak
s390-dis.c
s390.ld
savevm.c
sh4-dis.c
softmmu-semi.h
softmmu_defs.h
softmmu_exec.h
softmmu_header.h
softmmu_template.h
sparc-dis.c
sparc.ld
sparc64.ld
spice-qemu-char.c Revert "qemu-char: Print strerror message on failure" and deps 2012-02-24 09:06:56 -06:00
sysemu.h suspend: make acpi timer wakeup the guest. 2012-02-24 13:36:04 -06:00
targphys.h
tcg-runtime.c
tci-dis.c
tci.c
test-coroutine.c
test-qmp-commands.c
test-qmp-input-visitor.c qmp: Add missing gcc format attribute and fix format string 2012-01-18 10:23:39 -02:00
test-qmp-output-visitor.c qmp: Fix spelling fourty -> forty 2012-03-07 13:03:51 +00:00
test-string-input-visitor.c qapi: add tests for string-based visitors 2012-02-21 10:21:05 +01:00
test-string-output-visitor.c qapi: add tests for string-based visitors 2012-02-21 10:21:05 +01:00
thunk.c
thunk.h Remove macro HOST_LONG_SIZE 2012-02-28 22:33:41 +01:00
trace-events usb: add tracepoint for usb packet state changes. 2012-02-27 13:37:36 +01:00
translate-all.c
uboot_image.h
usb-bsd.c usb: Resolve warnings about unassigned bus on usb device creation 2012-02-27 15:40:53 +01:00
usb-linux.c usb-host: enable pipelineing for bulk endpoints. 2012-03-07 12:28:05 +01:00
usb-redir.c usb: add USB_RET_IOERROR 2012-03-07 12:28:04 +01:00
usb-stub.c usb: Fix signature of stub usb_host_device_open 2012-03-03 17:54:16 +00:00
user-exec.c
version.rc
vgafont.h
vl.c arm: add device tree support 2012-03-02 11:56:38 +00:00
vmstate.h vmstate: extract declarations out of hw/hw.h 2012-01-13 10:20:51 -06:00
x86_64.ld
xen-all.c Merge remote-tracking branch 'qemu-kvm/memory/core' into staging 2012-03-01 15:26:25 -06:00
xen-mapcache.c prepare for future GPLv2+ relicensing 2012-01-13 10:55:56 -06:00
xen-mapcache.h
xen-stub.c prepare for future GPLv2+ relicensing 2012-01-13 10:55:56 -06:00
xtensa-semi.c

README

Read the documentation in qemu-doc.html or on http://wiki.qemu.org

- QEMU team