qemu-iotests: export TEST_DIR for non-bash tests
Since qemu-iotests may need to create large image files it is possibleto specify the test directory. The TEST_DIR variable needs to beexported so non-bash tests can make use of it.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>...
qemu-iotests: add iotests Python module
Block layer tests that involve QMP commands rather than qemu-img orqemu-io are not well-suited for shell scripting. This patch adds aPython module which allows tests to be written in Python instead.
The basic API is:...
test: add image streaming tests
This patch adds a test suite for the image streaming feature. Itexercises the 'block_stream', 'block_job_cancel', 'block_job_set_speed',and 'query-block-jobs' QMP commands.
qemu-iotests: Filter out DOS line endings
This one makes it possible to run qemu-iotests on a Windows build using Wineand get somewhat meaningful results.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
qemu-iotests: 026: Reduce output changes for cache=none qcow2
qemu-iotests supports the -nocache option which makes the tests run withcache=none. For blkdebug tests with qcow2 this means that we may seetest results that differ from cache=writethrough. This patch makes the...
qemu-iotests: Test rebase with short backing file
This tests that qemu-img rebase doesn't assume that the backing file hasthe same size as the image, but considers that it can be smaller.
QMP: Add qmp command for blockdev-group-snapshot-sync
This adds the QMP command for blockdev-group-snapshot-sync. Ittakes an array in as the input, for the argument devlist. Thearray consists of the following elements:
+ device: device to snapshot. e.g. "ide-hd0", "virtio0"...
qapi: Introduce blockdev-group-snapshot-sync command
This is a QAPI/QMP only command to take a snapshot of a group ofdevices. This is similar to the blockdev-snapshot-sync command, exceptblockdev-group-snapshot-sync accepts a list devices, filenames, and...
qcow2: Fix build with DEBUG_EXT enabled
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block: remove unused fields in BlockDriverState
sync_aiocb is unused since commit ce1a14d (Dynamically allocate AIOCompletion Blocks., 2006-08-07).
private is unused since commit 56a1493 (drive cleanup fixes., 2009-09-25).
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
block: drop aio_multiwrite in BlockDriver
These were never used.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qcow2: Fix offset in qcow2_read_extensions
The spec says that the length of extensions is padded to 8 bytes, notthe offset. Currently this is the same because the header size is amultiple of 8, so this is only about compatibility with future changesto the header size....
qcow2: Reject too large header extensions
Image files that make qemu-img info read several gigabytes into theunknown header extensions list are bad. Just fail opening the imageif an extension claims to be larger than the header extension area.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>...
fdc: take side count into account
Floppies can be simple or double-sided. However, current codewas only taking the common case into account (ie 2 sides).
This repairs single-sided floppies, which where totally brokenbefore this patch : for track > 0, wrong sector number was...
fdc: set busy bit when starting a command
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>
fdc: most control commands do not generate interrupts
In fact, only three control commands generate an interrupt:read_id, recalibrate and seek
fdc: handle read-only floppies (abort early on write commands)
A real floppy doesn't attempt to write to read-only media either.
fdc: add CCR (Configuration Control Register) write register
DIR and CCR registers share the same address ; DIR is read-onlywhile CCR is write-only
CCR register is used to change media transfer rate, which will bechecked in following changes.
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>...
block: add a transfer rate for floppy types
Floppies must be read at a specific transfer rate, depending of its own format.Update floppy description table to include required transfer rate.
fdc: add a 'check media rate' property. Not used yet
Set it to true for current Qemu versions, and false for previous ones
fdc: check if media rate is correct before doing any transfer
The programmed rate has to be the same as the required rate for thefloppy format ; if that's not the case, the transfer should abort.This check can be disabled by using the 'check_media_rate' property....
fdc: fix seek command, which shouldn't check tracks
The seek command just sends step pulses to the drive and doesn't care ifthere is a medium inserted of if it is banging the head against the drive.
fdc: DIR (Digital Input Register) should return status of current drive...
ide: fail I/O to empty disk
Requesting a read or a write operation on an empty disk can leadto 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>...
Merge remote-tracking branch 'aneesh/for-upstream' into staging
slirp: Fix assertion failure on rejected DHCP requests
The guest network stack might DHCPREQUEST an address that the slirp builtin dhcp server can't let it have - for example if the guest has an oldleases file from another network configuration. In this case the dhcp...
slirp: Clean up ifs_init
Remove duplicate ifs_init macros, reimplement the logic as static inlinein 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>
slirp: Fix requeuing of batchq packets in if_start
In case we requeued a packet that was the head of a longer sessionqueue, we failed to restore this ordering. Also, we did not properlydeal with changes to Slirp::next_m.
Instead of a cumbersome roll back, this fix simply avoids any changes...
slirp: Refactor if_start
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>
audio: Add some fall through comments
Static code analysers expect these comments for case statements withouta break statement.
Signed-off-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: malc <av1474@comtv.ru>
vl.c: Avoid segfault when started with no arguments
Fix a bug (introduced in commit a0abe47) where a command line whichspecified no machine arguments (either explicitly or implicitly via-kernel &co) would result in a segfault because of a NULL pointerreturned from qemu_opts_find(qemu_find_opts("machine"), 0)....
configure: Check whether makecontext() is a glibc stub function
On some systems (notably ARM Linux) glibc provides implementationsof makecontext(), getcontext() and friends which are stubs whichalways return failure. Make the configure test for makecontext()...
optimize screendump for the common non-switch case
switch console only if needed, also pass down whenever the console wasswitched or not because a displaysurface redraw is only needed in casethe console was switched.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>...
build: allow turning off debuginfo
This patch adds --{enable,disable}-debug-info switches to configurewhich allows to include/exclude the '-g' switch on the gcc & ldcommand lines. Not building debug info reduces ressource usage(especially disk) alot and is quite useful for test builds....
nic: zap obsolote romloading bits from ne2k + pcnet
These days one just needs to specify the romfile in PCiDeviceInfo andeverything magically works. It also allows to disable pxe rom loadingvia "romfile=<emptystring>" like it is possible for all other nics....
suspend: make acpi timer wakeup the guest.
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: add qmp events
Send qmp events on suspend and wakeup so libvirthas a chance to track the vm state.
vga: simplify screendump
The displaychangelistener isn't needed at all, we can simply save theimage when vga_hw_update is done instead of hooking into the updateprocess.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Remove screendump dummy functions.
The code in console.c verifies whenever a screen_dump functionpointer is present before calling it, so there is no need to supply andummy function. Remove them. Also report an error to notify the userthat he didn't got a screenshot....
suspend: switch acpi s3 to new infrastructure.
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 bedone in a notifier function now....
suspend: add system_wakeup monitor command
This patch adds the system_wakeup monitor command which will simplywake up suspended guests.
suspend: make ps/2 devices wakeup the guest
This patch adds wakeup support to ps/2 emulation. Any key press on theps/2 keyboard will wakeup the guest. Likewise any mouse button presswill wakeup the guest. Mouse moves are ignored, so the guest will not...
suspend: make serial ports wakeup the guest.
Add a 'wakeup' property to the serial port. It is off by default. Whenenabled any incoming character on the serial line will wake up theguest. Useful for guests which have a serial console configured.
suspend: make rtc alarm wakeup the guest.
Make the rtc wake up the guest when the alarm fires.Add acpi windup to property support RTC_EN, so guestscan enable and disable this.
acpi: move around structs
Group all structs at the top of hw/acpi.h.Just moving around lines, no code changes.
acpi: add ACPIREGS
All those acpi structs are not independent from each other.Various acpi functions expecting multiple acpi structs passedin are a clean indicator for that ;)
So this patch bundles all acpi structs in the new ACPIREGSstruct, then use it everythere pass around acpi state....
acpi: don't pass overflow_time to acpi_pm1_evt_get_sts
Pretty pointless, can easily be reached via ACPIREGS now.
acpi: add acpi_pm1_evt_write_en
Do APCIREGS->pm1.evt.en updates using the new acpi_pm1_evt_write_enfunction, so the acpi code will see those updates.
suspend: add infrastructure
This patch adds some infrastructure to handle suspend and resume toqemu. First there are two functions to switch state and second thereis a suspend notifier:
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
Merge remote-tracking branch 'mdroth/qga-win32-pull-2-23-12' into staging
Merge remote-tracking branch 'qmp/queue/qmp' into staging
Merge remote-tracking branch 'kwolf/for-anthony' into staging
Merge remote-tracking branch 'bonzini/virtio-scsi' into staging
vl.c: Error locations for options using add_device_config()
These are -bt, -serial, -virtcon, -parallel, -debugcon, -usbdevice.Improves messages emitted via proper error reporting interfaces. Forinstance:
$ qemu-system-x86_64 -nodefaults -S -usb -usbdevice net:vlan=xxx...
gdbstub: Error locations for -gdb
Stash away the option argument with add_device_config(), so we stillhave its location when we get around to parsing it.
This doesn't improve any messages I can see just yet, but that'llchange shortly.
Signed-off-by: Markus Armbruster <armbru@redhat.com>...
sockets: Drop sockets_debug debug code
I'm trying to improve this code's error reporting, and the debug codeis getting in my way: it clutters the code, it clobbers errno ininconvenient places, and it uses the same fprintf() both for errorreporting and debug output in a few places....
sockets: Clean up inet_listen_opts()'s convoluted bind() loop
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
console: Eliminate text_consoles[]
Simply use consoles[] instead.
target-i386: Introduce x86_cpuid_version_set_family()
Move the logic for setting the family and extended family into ahelper function.
To make the helper self-contained and in preparation of futureunordered/multiple uses, mask out any previous family values first....
target-i386: Introduce x86_cpuid_version_set_model()
Move the logic for setting the model and extended model fieldsinto a helper function.
To make the function self-contained and to prepare for futureunordered/multiple uses, mask out any previous model values first....
target-i386: Introduce x86_cpuid_version_set_stepping()
Move the logic for setting the stepping field into a helper function.
To make the function self-contained and to prepare for futureunordered/multiple uses, mask out any previous stepping values first....
target-i386: Introduce x86_cpuid_set_model_id()
Move the logic to transform the 48-char model ID into the 12-word modelvalue into a helper.
Signed-off-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu-char: Use qemu_open() to avoid leaking fds to children
Fixed silently in commit aad04cd0, but that just got reverted.Re-apply the fixes, plus one missed instance: parport on Linux.
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Markus Armbruster <armbru@redhat.com>...
qemu-char: Re-apply style fixes from just reverted aad04cd0
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu-char: qemu_chr_open_fd() can't fail, don't check
Cleaned up silently in commit aad04cd0, but that just got reverted.Re-apply this part.
Revert "qemu-char: Print strerror message on failure" and deps
The commit's purpose is laudable:
The only way for chardev drivers to communicate an error was to return a NULL pointer, which resulted in an error message that said that something went wrong, but not why....
virtio-scsi: process control queue requests
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
virtio-scsi: add migration support
scsi: fix wrong return for target INQUIRY
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
scsi: fix searching for an empty id
The conditions for detecting no free target or LUN were wrong.
The LUN loop was followed by an "if" condition that is nevertrue, because the loop is exited as soon as lun becomes equalto bus->info->max_lun, and never becomes greater than it....
scsi-block: always use scsi_generic_ops for cache != none
slirp/misc: fix gcc __warn_memset_zero_len warnings
By removing memset altogether (Patch from Stefan Hajnoczi, testedcompile only by me).
Signed-off-by: Alon Levy <alevy@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
hw/9pfs: Endian fixes for virtfs
This patch fixes several endian bugs in virtfs.
Cc: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>Signed-off-by: David Gibson <david@gibson.dropbear.id.au>...
./configure: add option for disabling VirtFS
Signed-off-by: Meador Inge <meadori@codesourcery.com>Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
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...
qemu-ga: add win32 guest-shutdown command
Implement guest-shutdown RPC for Windows. Functionally this should beequivalent to the posix implementation.
Original patch by Gal Hammer <ghammer@redhat.com>
qemu-ga: add initial win32 support
This adds a win32 channel implementation that makes qemu-ga functionalon Windows using virtio-serial (unix-listen/isa-serial not currentlyimplemented). Unlike with the posix implementation, we do not useGIOChannel for the following reasons:...
qemu-ga: move channel/transport functionality into wrapper class
This is mostly in preparation for the win32 port, which won't useGIO channels for reasons that will be made clearer later. Here theGAChannel class is just a loose wrapper around GIOChannel...
qemu-ga: separate out common commands from posix-specific ones
Many of the current RPC implementations are very much POSIX-specificand require complete re-writes for Windows. There are however a smallset of core guest agent commands that are common to both, and other...
qemu-ga: rename guest-agent-commands.c -> commands-posix.c
qemu-ga: fixes for win32 build of qemu-ga
Various stubs and #ifdefs to compile for Windows using mingwcross-build. Still has 1 linker error due to a dependency on theforthcoming win32 versions of the GAChannel/transport class.
qemu-ga: Add schema documentation for types
Document guest agent schema types in similar fashion to qmp schematypes.
Merge qemu-iotests into for-anthony
qemu-iotests: only run 016 for file and sheepdog protocols
016 writes past EOF which isn't support by most protocols, so limitit 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: common.config: Fix no $TEST_DIR directory
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: Update rbd support
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: add qed support to 025 image resize test
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 filter for default cluster size
Until recently, qemu-img create displayed cluster_size=0 for the defaultcluster size. It is changed to display the real cluster size now, which resultsin the cluster size not being filtered out any more....
qemu-iotests: test loading internal snapshots
Test loading internal snapshots where the L1 table of the snapshotis smaller than the current L1 table.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Christoph Hellwig <hch@lst.de>
qemu-iotests: check: print relevant path information
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: common.config: Allow use of arbitrary qemu* paths
Since we might want to test arbitrary qemu, qemu-img andqemu-io paths, allow users to specify environment variablevalues for QEMU_PROG, QEMU_IMG_PROG and QEMU_IO_PROG sothe testsuite will use those values rather than find them...
qemu-iotests: add support for qed format
qemu-iotests: README: Fix spelling
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Christoph Hellwig <hch@lst.de>
qemu-iotests: filter IMGFMT correctly in 019
Test 019 can be run with qcow2 and qed image formats. Replace thespecific image format value with "IMGFMT" so the golden output does nothardcode qcow2 or qed.
This patch also includes a typo fix for "occurrences"....
qemu-iotests: add support for rbd and sheepdog protocols
This patch introduces tests for protocols other than file, andinitially 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: Use zero-based offsets for IO patterns
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...
qemu-iotests: filter TEST_DIR correctly in 019
tcg: Remove unneeded include statements
The standard include files are already included in qemu-common.h.
malloc.h and alloca.h were needed for alloca() which was removedfrom TCG code some years ago when switching from dyngen to TCG(see commit 49516bc0d622112caac9df628caf19010fda8b67)....
vl.c: Increase width of machine name column in "-M ?" output
Increase the width of the column used for the machine name inthe "-M ?" output from 10 to 20 spaces. This fixes the formattingso it looks nice for architectures where a few of the machineshave overly long names. (Our current longest machine name is...