target-arm: Clean includes
Remove some include statements which are not needed.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Stefan Weil <sw@weilnetz.de>
target-cris: Clean includes
The change in cpu.h is needed when HOST_LONG_BITS is defined in qemu-common.h.
Cc: Edgar E. Iglesias <edgar.iglesias@gmail.com>Signed-off-by: Stefan Weil <sw@weilnetz.de>
target-i386: Clean includes
Signed-off-by: Stefan Weil <sw@weilnetz.de>
target-lm32: Clean includes
config.h was missing in cpu.h.
Acked-by: Michael Walle <michael@walle.cc>Signed-off-by: Stefan Weil <sw@weilnetz.de>
target-m68k: Clean includes
target-microblaze: Clean includes
target-mips: Clean includes
Cc: Aurelien Jarno <aurelien@aurel32.net>Signed-off-by: Stefan Weil <sw@weilnetz.de>
Remove macro HOST_LONG_SIZE
HOST_LONG_SIZE is simply the size of a pointer value.There is no need for this macro.
target-alpha: Clean includes
Cc: Richard Henderson <rth@twiddle.net>Signed-off-by: Stefan Weil <sw@weilnetz.de>
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
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
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...
cpu defs: remove replicated flags from Intel (v2)
This patch removes the replicated feature flags from cpuid 8000_0001:edx(extfeature_edx) from Intel models, as the duplicated feature flags are presentonly on AMD CPUs. On Intel models, only the i64, syscall, and xd flags are kept...
add Westmere as a qemu cpu model (v2)
Version 1 of this patch was:
Message-Id: <1307041990-26194-11-git-send-email-ehabkost@redhat.comhttp://marc.info/?l=qemu-devel&m=130704415919346
This version doesn't have the duplicate feature bits on extfeature_edx, though,...
cpu defs: uncomment empty extfeatures_ecx definition for Opteron_G1 (v2)
This should have no visible effect, but it should just clean up theconfig file a bit.
This is based on a previous patch from John Cooper where this was introducedwith many other changes at the same time. Original John's patch submission is...
qom: In function object_set_link_property(), first call object_ref(), then object_unref().
In the old implementation, if the new value of the property linksto the same object, as the old value, that object is first unref-ed,and then ref-ed. This leads to unintended deinitialization of that object....
cpu defs: add pse36, mca, mtrr to AMD CPU definitions (v2)
This patch adds some missing flags to extfeature_edx, that were missingaccording to AMD's latest CPUID document.
cpu flags: aliases: pclmuldq|pclmulqdq and ffxsr|fxsr_opt
pclmulqdq: /proc/cpuinfo on Linux and all documentation I have seen usespclmulqdq as the flag name. As the only document using pclmuldq seems tobe the Intel CPUID documentation (Application Note 485), it looks like a...
cpu defs: use Intel flag names for Intel models (v2)
Use 'i64' instead of 'lm' and 'xd' instead of 'nx' on Intel models.
The flags have different names on Intel docs, so use those names for clarity.
This is based on a previous patch from John Cooper where this was introduced...
split SCSI and LSI, add myself as SCSI maintainer
This has been the de facto situation for a while now.Add a tree, too.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
cpu models: reorder flag list to match bit order
This will make it easier to review and change the flag list in the future.
No behaviour change should be introduced by this, as it is just changingthe flag order on the config file.
To make sure the flag sets are really not changed by this patch, I have...
qmp: add DEVICE_TRAY_MOVED event
It's emitted whenever the tray is moved by the guest or by HMP/QMPcommands.
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()
This is used to sync the physical tray state after migration whenusing CD-ROM passthrough. However, migrating when using passthroughis broken anyway and shouldn't be supported...
So, drop this function as it causes a problem with the DEVICE_TRAY_MOVED...
block: Don't call bdrv_eject() if the tray state didn't change
It's not needed. Besides we can then assume that bdrv_eject() isonly called when there's a tray state change, which is useful tothe DEVICE_TRAY_MOVED event (going to be added in a futurecommit)....
block: bdrv_eject(): Make eject_flag a real bool
block: Rename bdrv_mon_event() & BlockMonEventAction
They are QMP events, not monitor events. Rename them accordingly.
Also, move bdrv_emit_qmp_error_event() up in the file. A new event willbe added soon and it's good to have them next each other.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>...
qom: add test tools
Tested-by: Andreas F=E4rber <afaerber@suse.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>