aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2012-02-29qemu-iotests: 026: Reduce output changes for cache=none qcow2Kevin Wolf2-2/+8
qemu-iotests supports the -nocache option which makes the tests run with cache=none. For blkdebug tests with qcow2 this means that we may see test results that differ from cache=writethrough. This patch makes the diff a bit smaller and therefore easier to review. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-02-29qemu-iotests: Filter out DOS line endingsKevin Wolf1-1/+7
This one makes it possible to run qemu-iotests on a Windows build using Wine and get somewhat meaningful results. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-02-29test: add image streaming testsStefan Hajnoczi3-0/+157
This patch adds a test suite for the image streaming feature. It exercises the 'block_stream', 'block_job_cancel', 'block_job_set_speed', and 'query-block-jobs' QMP commands. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-02-29qemu-iotests: add iotests Python moduleStefan Hajnoczi1-0/+164
Block layer tests that involve QMP commands rather than qemu-img or qemu-io are not well-suited for shell scripting. This patch adds a Python module which allows tests to be written in Python instead. The basic API is: VM - class for launching and interacting with a VM QMPTestCase - abstract base class for tests that use QMP qemu_img() - wrapper function for invoking qemu-img qemu_io() - wrapper function for invoking qemu-io imgfmt - the image format under test (e.g. qcow2, qed) test_dir - scratch directory path for temporary files main() - entry point for running tests Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-02-29qemu-iotests: export TEST_DIR for non-bash testsStefan Hajnoczi1-0/+2
Since qemu-iotests may need to create large image files it is possible to specify the test directory. The TEST_DIR variable needs to be exported so non-bash tests can make use of it. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-02-29QMP: Add qmp command for blockdev-group-snapshot-syncJeff Cody1-0/+39
This adds the QMP command for blockdev-group-snapshot-sync. It takes an array in as the input, for the argument devlist. The array consists of the following elements: + device: device to snapshot. e.g. "ide-hd0", "virtio0" + snapshot-file: path & file for the snapshot image. e.g. "/tmp/file.img" + format: snapshot format. e.g., "qcow2". Optional There is no HMP equivalent for the command. Signed-off-by: Jeff Cody <jcody@redhat.com> Acked-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-02-29qapi: Introduce blockdev-group-snapshot-sync commandJeff Cody5-0/+257
This is a QAPI/QMP only command to take a snapshot of a group of devices. This is similar to the blockdev-snapshot-sync command, except blockdev-group-snapshot-sync accepts a list devices, filenames, and formats. It is attempted to keep the snapshot of the group atomic; if the creation or open of any of the new snapshots fails, then all of the new snapshots are abandoned, and the name of the snapshot image that failed is returned. The failure case should not interrupt any operations. Rather than use bdrv_close() along with a subsequent bdrv_open() to perform the pivot, the original image is never closed and the new image is placed 'in front' of the original image via manipulation of the BlockDriverState fields. Thus, once the new snapshot image has been successfully created, there are no more failure points before pivoting to the new snapshot. This allows the group of disks to remain consistent with each other, even across snapshot failures. Signed-off-by: Jeff Cody <jcody@redhat.com> Acked-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-02-29qcow2: Reject too large header extensionsKevin Wolf1-0/+5
Image files that make qemu-img info read several gigabytes into the unknown header extensions list are bad. Just fail opening the image if an extension claims to be larger than the header extension area. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-02-29qcow2: Fix offset in qcow2_read_extensionsKevin Wolf1-3/+2
The spec says that the length of extensions is padded to 8 bytes, not the offset. Currently this is the same because the header size is a multiple of 8, so this is only about compatibility with future changes to the header size. While touching it, move the calculation to a common place instead of duplicating it for each header extension type. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-02-29block: drop aio_multiwrite in BlockDriverPaolo Bonzini2-26/+3
These were never used. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-02-29block: remove unused fields in BlockDriverStatePaolo Bonzini1-5/+0
sync_aiocb is unused since commit ce1a14d (Dynamically allocate AIO Completion Blocks., 2006-08-07). private is unused since commit 56a1493 (drive cleanup fixes., 2009-09-25). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-02-29qcow2: Fix build with DEBUG_EXT enabledKevin Wolf1-1/+0
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-02-29ide: fail I/O to empty diskPaolo Bonzini1-4/+20
Requesting a read or a write operation on an empty disk can lead to QEMU dumping core. Also fix a few braces here and there. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-02-29fdc: DIR (Digital Input Register) should return status of current drive...Hervé Poussineau1-7/+3
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-02-29fdc: fix seek command, which shouldn't check tracksHervé Poussineau1-3/+6
The seek command just sends step pulses to the drive and doesn't care if there is a medium inserted of if it is banging the head against the drive. Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-02-29fdc: check if media rate is correct before doing any transferHervé Poussineau1-3/+50
The programmed rate has to be the same as the required rate for the floppy format ; if that's not the case, the transfer should abort. This check can be disabled by using the 'check_media_rate' property. Save media rate value only if media rate check is enabled. Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-02-29fdc: add a 'check media rate' property. Not used yetHervé Poussineau2-0/+31
Set it to true for current Qemu versions, and false for previous ones Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-02-29block: add a transfer rate for floppy typesHervé Poussineau4-38/+52
Floppies must be read at a specific transfer rate, depending of its own format. Update floppy description table to include required transfer rate. Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-02-29fdc: add CCR (Configuration Control Register) write registerHervé Poussineau1-0/+22
DIR and CCR registers share the same address ; DIR is read-only while CCR is write-only CCR register is used to change media transfer rate, which will be checked in following changes. Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-02-29fdc: handle read-only floppies (abort early on write commands)Hervé Poussineau1-0/+11
A real floppy doesn't attempt to write to read-only media either. Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-02-29fdc: most control commands do not generate interruptsHervé Poussineau1-6/+6
In fact, only three control commands generate an interrupt: read_id, recalibrate and seek Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-02-29fdc: set busy bit when starting a commandHervé Poussineau1-1/+1
This bit must be active while a command is currently executed. Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-02-29fdc: take side count into accountHervé Poussineau1-6/+11
Floppies can be simple or double-sided. However, current code was only taking the common case into account (ie 2 sides). This repairs single-sided floppies, which where totally broken before this patch : for track > 0, wrong sector number was calculated, and data was read/written at wrong place on underlying device. Fortunately, only some 360 kB floppies are single-sided, so this bug was probably not seen much. Signed-off-by: Hervé Poussineau <hpoussin@reactos.org> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2012-02-27Merge remote-tracking branch 'aneesh/for-upstream' into stagingAnthony Liguori3-9/+26
* aneesh/for-upstream: hw/9pfs: Endian fixes for virtfs ./configure: add option for disabling VirtFS
2012-02-27slirp: Fix assertion failure on rejected DHCP requestsDavid Gibson1-1/+2
The guest network stack might DHCPREQUEST an address that the slirp built in dhcp server can't let it have - for example if the guest has an old leases file from another network configuration. In this case the dhcp server should and does reject the request and prepares to send a DHCPNAK to the client. However, in this case the daddr variable in bootp_reply() is set to 0.0.0.0. Shortly afterwards, it unconditionally attempts to pre-insert the new client address into the ARP table. This causes an assertion failure in arp_address_add() because of the 0.0.0.0 address. According to RFC2131, DHCPNAK messages for clients on the same subnet must be sent to the broadcast address (S3.2, subpoint 2). Cc: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2012-02-27slirp: Refactor if_startJan Kiszka1-42/+36
Replace gotos with a while loop, fix coding style. CC: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com> CC: Fabien Chouteau <chouteau@adacore.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2012-02-27slirp: Fix requeuing of batchq packets in if_startJan Kiszka1-16/+19
In case we requeued a packet that was the head of a longer session queue, we failed to restore this ordering. Also, we did not properly deal with changes to Slirp::next_m. Instead of a cumbersome roll back, this fix simply avoids any changes until we know if the packet was actually sent. Both fixes crashes due to inconsistent queues and simplifies the logic. Thanks to Zhi Yong Wu who found the reason for these crashes. CC: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com> CC: Fabien Chouteau <chouteau@adacore.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2012-02-27slirp: Clean up ifs_initJan Kiszka3-4/+5
Remove duplicate ifs_init macros, reimplement the logic as static inline in mbuf.h. CC: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com> CC: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2012-02-25audio: Add some fall through commentsStefan Weil2-1/+4
Static code analysers expect these comments for case statements without a break statement. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: malc <av1474@comtv.ru>
2012-02-24configure: Check whether makecontext() is a glibc stub functionPeter Maydell1-0/+4
On some systems (notably ARM Linux) glibc provides implementations of makecontext(), getcontext() and friends which are stubs which always return failure. Make the configure test for makecontext() also check for the presence of the __stub_makecontext macro which indicates the presence of these stubs, so we can avoid trying to use them and fall back to a different coroutine implementation instead. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-24vl.c: Avoid segfault when started with no argumentsPeter Maydell1-7/+10
Fix a bug (introduced in commit a0abe47) where a command line which specified no machine arguments (either explicitly or implicitly via -kernel &co) would result in a segfault because of a NULL pointer returned from qemu_opts_find(qemu_find_opts("machine"), 0). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-24nic: zap obsolote romloading bits from ne2k + pcnetGerd Hoffmann2-16/+2
These days one just needs to specify the romfile in PCiDeviceInfo and everything magically works. It also allows to disable pxe rom loading via "romfile=<emptystring>" like it is possible for all other nics. [ v2: rebased & adapted to qom changes ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-24build: allow turning off debuginfoGerd Hoffmann1-2/+13
This patch adds --{enable,disable}-debug-info switches to configure which allows to include/exclude the '-g' switch on the gcc & ld command lines. Not building debug info reduces ressource usage (especially disk) alot and is quite useful for test builds. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-24optimize screendump for the common non-switch caseGerd Hoffmann9-21/+34
switch console only if needed, also pass down whenever the console was switched or not because a displaysurface redraw is only needed in case the console was switched. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-02-24Remove screendump dummy functions.Gerd Hoffmann3-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>
2012-02-24vga: simplify screendumpGerd Hoffmann1-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>
2012-02-24suspend: add qmp eventsGerd Hoffmann3-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>
2012-02-24suspend: make acpi timer wakeup the guest.Gerd Hoffmann2-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>
2012-02-24suspend: make rtc alarm wakeup the guest.Gerd Hoffmann3-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>
2012-02-24suspend: make serial ports wakeup the guest.Gerd Hoffmann1-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>
2012-02-24suspend: make ps/2 devices wakeup the guestGerd Hoffmann1-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>
2012-02-24suspend: add system_wakeup monitor commandGerd Hoffmann6-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>
2012-02-24suspend: switch acpi s3 to new infrastructure.Gerd Hoffmann10-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>
2012-02-24suspend: add infrastructureGerd Hoffmann2-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>
2012-02-24acpi: add acpi_pm1_evt_write_enGerd Hoffmann4-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>
2012-02-24acpi: don't pass overflow_time to acpi_pm1_evt_get_stsGerd Hoffmann4-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>
2012-02-24acpi: add ACPIREGSGerd Hoffmann4-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>
2012-02-24acpi: move around structsGerd Hoffmann1-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>
2012-02-24Merge remote-tracking branch 'stefanha/trivial-patches' into stagingAnthony Liguori3-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
2012-02-24Merge remote-tracking branch 'mdroth/qga-win32-pull-2-23-12' into stagingAnthony Liguori14-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