summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Remove screendump dummy functions.Gerd Hoffmann2012-02-243-12/+4
| | | | | | | | | The code in console.c verifies whenever a screen_dump function pointer is present before calling it, so there is no need to supply an dummy function. Remove them. Also report an error to notify the user that he didn't got a screenshot. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* vga: simplify screendumpGerd Hoffmann2012-02-241-35/+1
| | | | | | | | The displaychangelistener isn't needed at all, we can simply save the image when vga_hw_update is done instead of hooking into the update process. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* suspend: add qmp eventsGerd Hoffmann2012-02-243-0/+10
| | | | | | | | Send qmp events on suspend and wakeup so libvirt has a chance to track the vm state. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* suspend: make acpi timer wakeup the guest.Gerd Hoffmann2012-02-242-0/+9
| | | | | | | | Make the acpi timer wake up the guest. Guests can enable/disable this via acpi too. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* suspend: make rtc alarm wakeup the guest.Gerd Hoffmann2012-02-243-0/+9
| | | | | | | | | Make the rtc wake up the guest when the alarm fires. Add acpi windup to property support RTC_EN, so guests can enable and disable this. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* suspend: make serial ports wakeup the guest.Gerd Hoffmann2012-02-241-0/+6
| | | | | | | | | Add a 'wakeup' property to the serial port. It is off by default. When enabled any incoming character on the serial line will wake up the guest. Useful for guests which have a serial console configured. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* suspend: make ps/2 devices wakeup the guestGerd Hoffmann2012-02-241-0/+6
| | | | | | | | | | | This patch adds wakeup support to ps/2 emulation. Any key press on the ps/2 keyboard will wakeup the guest. Likewise any mouse button press will wakeup the guest. Mouse moves are ignored, so the guest will not wakeup in case your mouse crosses the vnc window of a suspended guest by accident. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* suspend: add system_wakeup monitor commandGerd Hoffmann2012-02-246-0/+57
| | | | | | | | This patch adds the system_wakeup monitor command which will simply wake up suspended guests. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* suspend: switch acpi s3 to new infrastructure.Gerd Hoffmann2012-02-2410-42/+47
| | | | | | | | | | | | | | This patch switches pc s3 suspend over to the new infrastructure. The cmos_s3 qemu_irq is killed, the new notifier is used instead. The xen hack goes away with that too, the hypercall can simply be done in a notifier function now. This patch also makes the guest actually stay suspended instead of leaving suspend instantly, so it is useful for more than just testing whenever the suspend/resume cycle actually works. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* suspend: add infrastructureGerd Hoffmann2012-02-242-0/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds some infrastructure to handle suspend and resume to qemu. First there are two functions to switch state and second there is a suspend notifier: * qemu_system_suspend_request is supposed to be called when the guest asks for being be suspended, for example via ACPI. * qemu_system_wakeup_request is supposed to be called on events which should wake up the guest. * qemu_register_suspend_notifier can be used to register a notifier which will be called when the guest is suspended. Machine types and device models can hook in there to modify state if needed. * qemu_register_wakeup_notifier can be used to register a notifier which will be called when the guest is woken up. Machine types and device models can hook in there to modify state if needed. * qemu_system_wakeup_enable can be used to enable/disable wakeup events. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* acpi: add acpi_pm1_evt_write_enGerd Hoffmann2012-02-244-2/+8
| | | | | | | | Do APCIREGS->pm1.evt.en updates using the new acpi_pm1_evt_write_en function, so the acpi code will see those updates. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* acpi: don't pass overflow_time to acpi_pm1_evt_get_stsGerd Hoffmann2012-02-244-8/+8
| | | | | | | Pretty pointless, can easily be reached via ACPIREGS now. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* acpi: add ACPIREGSGerd Hoffmann2012-02-244-143/+145
| | | | | | | | | | | | All those acpi structs are not independent from each other. Various acpi functions expecting multiple acpi structs passed in are a clean indicator for that ;) So this patch bundles all acpi structs in the new ACPIREGS struct, then use it everythere pass around acpi state. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* acpi: move around structsGerd Hoffmann2012-02-241-25/+23
| | | | | | | | Group all structs at the top of hw/acpi.h. Just moving around lines, no code changes. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Merge remote-tracking branch 'stefanha/trivial-patches' into stagingAnthony Liguori2012-02-243-28/+9
|\ | | | | | | | | | | | | * stefanha/trivial-patches: slirp/misc: fix gcc __warn_memset_zero_len warnings vl.c: Increase width of machine name column in "-M ?" output tcg: Remove unneeded include statements
| * slirp/misc: fix gcc __warn_memset_zero_len warningsAlon Levy2012-02-241-14/+7
| | | | | | | | | | | | | | | | By removing memset altogether (Patch from Stefan Hajnoczi, tested compile only by me). Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
| * vl.c: Increase width of machine name column in "-M ?" outputPeter Maydell2012-02-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | Increase the width of the column used for the machine name in the "-M ?" output from 10 to 20 spaces. This fixes the formatting so it looks nice for architectures where a few of the machines have overly long names. (Our current longest machine name is "petalogix-s3adsp1800" with "realview-eb-mpcore" not far behind.) Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
| * tcg: Remove unneeded include statementsStefan Weil2012-02-231-12/+0
| | | | | | | | | | | | | | | | | | | | | | The standard include files are already included in qemu-common.h. malloc.h and alloca.h were needed for alloca() which was removed from TCG code some years ago when switching from dyngen to TCG (see commit 49516bc0d622112caac9df628caf19010fda8b67). Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
* | Merge remote-tracking branch 'mdroth/qga-win32-pull-2-23-12' into stagingAnthony Liguori2012-02-2414-318/+1263
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * mdroth/qga-win32-pull-2-23-12: qemu-ga: add win32 guest-shutdown command qemu-ga: add Windows service integration qemu-ga: add initial win32 support qemu-ga: fixes for win32 build of qemu-ga qemu-ga: rename guest-agent-commands.c -> commands-posix.c qemu-ga: separate out common commands from posix-specific ones qemu-ga: move channel/transport functionality into wrapper class qemu-ga: Add schema documentation for types
| * | qemu-ga: add win32 guest-shutdown commandMichael Roth2012-02-231-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>
| * | qemu-ga: add Windows service integrationMichael Roth2012-02-234-10/+249
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | qemu-ga: add initial win32 supportMichael Roth2012-02-233-1/+345
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | qemu-ga: fixes for win32 build of qemu-gaMichael Roth2012-02-235-6/+114
| | | | | | | | | | | | | | | | | | 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.
| * | qemu-ga: rename guest-agent-commands.c -> commands-posix.cMichael Roth2012-02-232-1/+1
| | |
| * | qemu-ga: separate out common commands from posix-specific onesMichael Roth2012-02-234-59/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | qemu-ga: move channel/transport functionality into wrapper classMichael Roth2012-02-235-233/+355
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 calls/callbacks, but we also roll in the logic/configuration for various channel types and managing unix socket connections, which makes the abstraction much more complete and further aids in the win32 port since isa-serial/unix-listen will not be supported initially. There's also a bit of refactoring in the main logic to consolidate the exit paths so we can do common cleanup for things like pid files, which weren't always cleaned up previously.
| * | qemu-ga: Add schema documentation for typesMichael Roth2012-02-231-21/+97
| |/ | | | | | | | | Document guest agent schema types in similar fashion to qmp schema types.
* | Merge remote-tracking branch 'qmp/queue/qmp' into stagingAnthony Liguori2012-02-2412-62/+104
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | * qmp/queue/qmp: qmp: add DEVICE_TRAY_MOVED event ide: drop ide_tray_state_post_load() block: Don't call bdrv_eject() if the tray state didn't change block: bdrv_eject(): Make eject_flag a real bool block: Rename bdrv_mon_event() & BlockMonEventAction
| * | qmp: add DEVICE_TRAY_MOVED eventLuiz Capitulino2012-02-224-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | It's emitted whenever the tray is moved by the guest or by HMP/QMP commands. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Acked-by: Kevin Wolf <kwolf@redhat.com>
| * | ide: drop ide_tray_state_post_load()Luiz Capitulino2012-02-221-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is used to sync the physical tray state after migration when using CD-ROM passthrough. However, migrating when using passthrough is broken anyway and shouldn't be supported... So, drop this function as it causes a problem with the DEVICE_TRAY_MOVED event, which is going to be introduced by the next commit. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Acked-by: Kevin Wolf <kwolf@redhat.com>
| * | block: Don't call bdrv_eject() if the tray state didn't changeLuiz Capitulino2012-02-222-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's not needed. Besides we can then assume that bdrv_eject() is only called when there's a tray state change, which is useful to the DEVICE_TRAY_MOVED event (going to be added in a future commit). Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Acked-by: Kevin Wolf <kwolf@redhat.com>
| * | block: bdrv_eject(): Make eject_flag a real boolLuiz Capitulino2012-02-225-7/+7
| | | | | | | | | | | | | | | | | | Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Acked-by: Kevin Wolf <kwolf@redhat.com>
| * | block: Rename bdrv_mon_event() & BlockMonEventActionLuiz Capitulino2012-02-225-41/+41
| |/ | | | | | | | | | | | | | | | | | | | | They are QMP events, not monitor events. Rename them accordingly. Also, move bdrv_emit_qmp_error_event() up in the file. A new event will be added soon and it's good to have them next each other. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Acked-by: Kevin Wolf <kwolf@redhat.com>
* | Merge remote-tracking branch 'kwolf/for-anthony' into stagingAnthony Liguori2012-02-2469-0/+153385
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * kwolf/for-anthony: (46 commits) qemu-iotests: common.config: Allow use of arbitrary qemu* paths qemu-iotests: check: print relevant path information qemu-iotests: test loading internal snapshots qemu-iotests: Update filter for default cluster size qemu-iotests: add qed support to 025 image resize test qemu-iotests: Update rbd support qemu-iotests: common.config: Fix no $TEST_DIR directory qemu-iotests: only run 016 for file and sheepdog protocols qemu-iotests: Use zero-based offsets for IO patterns qemu-iotests: add support for rbd and sheepdog protocols qemu-iotests: filter IMGFMT correctly in 019 qemu-iotests: README: Fix spelling qemu-iotests: add support for qed format qemu-iotests: filter TEST_DIR correctly in 019 qemu-iotests: fix 019 golden output qemu-iotests: update expected results after qemu-img changes qemu-iotests: add read/write from smaller backing image test qemu-iotests: add sub-cluster allocating write test for sparse image formats qemu-iotests: improve test for qemu-img convert with backing file qemu-iotests: consider more cases in parsing qemu-io output ...
| * \ Merge qemu-iotests into for-anthonyKevin Wolf2012-02-2369-0/+153385
| |\ \ | | |/ | |/|
| | * qemu-iotests: common.config: Allow use of arbitrary qemu* pathsLucas Meneghel Rodrigues2012-02-231-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since we might want to test arbitrary qemu, qemu-img and qemu-io paths, allow users to specify environment variable values for QEMU_PROG, QEMU_IMG_PROG and QEMU_IO_PROG so the testsuite will use those values rather than find them on PATH. Obviously, if such env variables are not set prior to script execution, normal detection mechanism takes place. Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
| | * qemu-iotests: check: print relevant path informationLucas Meneghel Rodrigues2012-02-231-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | Print the paths of the programs under test (qemu, qemu-img and qemu-io). Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
| | * qemu-iotests: test loading internal snapshotsKevin Wolf2012-02-233-0/+76
| | | | | | | | | | | | | | | | | | | | | | | | Test loading internal snapshots where the L1 table of the snapshot is smaller than the current L1 table. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
| | * qemu-iotests: Update filter for default cluster sizeKevin Wolf2012-02-232-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Until recently, qemu-img create displayed cluster_size=0 for the default cluster size. It is changed to display the real cluster size now, which results in the cluster size not being filtered out any more. If the cluster size is specified explicitly in CLUSTER_SIZE, keep the output, and if using the default, filter it out. This mostly restores the old behaviour of the test cases; test 015 must be fixed to use CLUSTER_SIZE instead of using extra_img_options for it. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
| | * qemu-iotests: add qed support to 025 image resize testStefan Hajnoczi2012-02-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | QED now supports the truncate (aka resize) operation for growing images. Update test 025 so it runs for QED. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
| | * qemu-iotests: Update rbd supportJosh Durgin2012-02-231-1/+1
| | | | | | | | | | | | | | | | | | | | | rbd implements bdrv_truncate, so test 025 will work. Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
| | * qemu-iotests: common.config: Fix no $TEST_DIR directoryMitnick Lyu2012-02-231-1/+5
| | | | | | | | | | | | | | | | | | | | | mkdir $TEST_DIR on common.config first run Signed-off-by: Mitnick Lyu <mitnick.lyu@gmail.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
| | * qemu-iotests: only run 016 for file and sheepdog protocolsChristoph Hellwig2012-02-231-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | 016 writes past EOF which isn't support by most protocols, so limit it to file and sheepdog, which explicitly support it. Pointed out by Josh Durgin <josh.durgin@dreamhost.com>. Signed-off-by: Christoph Hellwig <hch@lst.de>
| | * qemu-iotests: Use zero-based offsets for IO patternsStefan Hajnoczi2012-02-2312-1863/+1873
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The io_pattern style functions have the following loop: for i in `seq 1 $count`; do echo ... $(( start + i * step )) ... done Offsets are 1-based so start=1024, step=512, count=4 yields: 1536, 2048, 2560, 3072 Normally we expect: 1024, 1536, 2048, 2560 Most tests ignore this detail, which means that they perform I/O to a slightly different range than expected by the test author. Later on things got less innocent and tests started trying to compensate for the 1-based indexing. This included negative start values in test 024 and my own attempt with count-1 in test 028! The end result is that tests that use io_pattern are hard to reason about and don't work the way you'd expect. It's time to clean this mess up. This patch switches io_pattern to 0-based offsets. This requires adjusting the golden outputs since I/O ranges are now shifted and output differs. Verifying these output diffs is easy, however. Each diff hunk moves one I/O from beyond the end of the pattern range to the beginning. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
| | * qemu-iotests: add support for rbd and sheepdog protocolsMORITA Kazutaka2012-02-2331-4/+89
| | | | | | | | | | | | | | | | | | | | | | | | This patch introduces tests for protocols other than file, and initially supports rbd and sheepdog. Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp> Signed-off-by: Christoph Hellwig <hch@lst.de>
| | * qemu-iotests: filter IMGFMT correctly in 019Stefan Hajnoczi2012-02-233-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Test 019 can be run with qcow2 and qed image formats. Replace the specific image format value with "IMGFMT" so the golden output does not hardcode qcow2 or qed. This patch also includes a typo fix for "occurrences". Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
| | * qemu-iotests: README: Fix spellingStefan Weil2012-02-231-1/+1
| | | | | | | | | | | | | | | Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Christoph Hellwig <hch@lst.de>
| | * qemu-iotests: add support for qed formatStefan Hajnoczi2012-02-239-9/+16
| | | | | | | | | | | | | | | Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
| | * qemu-iotests: filter TEST_DIR correctly in 019Christoph Hellwig2012-02-232-3/+3
| | | | | | | | | | | | Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| | * qemu-iotests: fix 019 golden outputKevin Wolf2012-02-221-15/+562
| | | | | | | | | | | | | | | Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
OpenPOWER on IntegriCloud