spice: add worker wrapper functions.
Add wrapper functions for all spice worker calls.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
spice: add qemu_spice_display_init_common
Factor out SimpleSpiceDisplay initialization intoqemu_spice_display_init_common() and call it fromboth qxl.c (for vga mode) and spice-display.c
spice/qxl: move worker wrappers
Move the wrapper functions which are used by qxl only to qxl.c.Rename them from qemu_spice_* to qxl_spice_*. Also pass in aqxl state pointer instead of a SimpleSpiceDisplay pointer.
qxl: fix surface tracking & locking
Surface tracking needs proper locking since it is used from vcpu and spiceworker threads, add it. Also reset the surface counter when zapping allsurfaces.
qxl: add io_port_to_string
Signed-off-by: Alon Levy <alevy@redhat.com>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
exec.h cleanup
Move softmmu_exec.h include directives from target-*/exec.h totarget-*/op_helper.c. Move also various other stuff only used inop_helper.c there.
Define global env in dyngen-exec.h.
For i386, move wrappers for segment and FPU helpers from user-exec.c...
revamp acpitable parsing and allow to specify complete (headerful) table
This patch almost rewrites acpi_table_add() function(but still leaves it using old get_param_value() interface).The result is that it's now possible to specify whole table(together with a header) in an external file, instead of just...
sd: do not add one sector to the disk size
This leads to random off-by-one error.When the size of the SD is exactly 1GB, the emulation was returning awrong SDHC CSD descriptor.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
usb-hid: Fix 0/0 position for Windows in tablet mode
For unknown reasons, Windows drivers (tested with XP and Win7) ignoreusb-tablet events that move the pointer to 0/0. So always report 0/0 as1/0.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
Add support for Zipit Z2 machine
Zipit Z2 is small PXA270 based handheld.
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>Reviewed-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
onenand: Add missing brace.
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
hw/onenand: program actions can only clear bits
The program actions onenand_prog_main() and onenand_prog_spare()can only set bits.
This implies a rewrite of onenand_erase() to not use the programfunctions, since erase does need to set bits.
Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>...
onenand: Handle various ID fields separately
Handle the manufacturer, device and version IDs separately rather thansmooshing them all together into a single uint32_t. Note that the IDregisters are actually 16 bit, even though typically the top bits are 0...
onenand: Pass BlockDriverState to init function
Pass the BlockDriverState to the onenand init function so it doesn'tneed to look up the drive itself.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
hw/nand: qdevify
Qdevify the NAND device.
Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>[Riku Voipio: Fixes and restructuring patchset]Signed-off-by: Riku Voipio <riku.voipio@iki.fi>[Peter Maydell: More fixes and cleanups for upstream submission]...
hw/nand: Writing to NAND can only clear bits
Writing to a NAND device cannot set bits, it can only clear them;implement this rather than simply copying the data.
hw/nand: Support multiple reads following READ STATUS
After receiving READ STATUS command all subsequent IO reads should returnthe status register value until another command is issued.
Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>[Riku Voipio: Fixes and restructuring patchset]...
hw/nand: Support devices wider than 8 bits
Support NAND devices which are wider than 8 bits.
nand: Bump vmstate version after changing structure.
hw/nand: Support large NAND devices
Add support for NAND devices of over 1Gb.
hw/nand: Pass block device state to init function
Pass the BlockDeviceState to the nand_init() function ratherthan having it look it up via drive_get() itself.
lm832x: Take DeviceState pointer in lm832x_key_event()
Since lm832x has been qdev'ified, its users will generallyhave a DeviceState pointer rather than an i2c_slave pointer,so adjust lm832x_key_event's prototype to suit.
This allows the n810 (its only user) to actually pass a correct...
hw/omap_gpio.c: Convert to qdev
Convert the OMAP GPIO module to qdev.
hw/omap_clk: Add the clock for the OMAP2430-specific fifth GPIO module
The OMAP2430 has a fifth GPIO module which earlier OMAP2 models lack; addthe clock definition for it.
hw/omap_l4.c: Add helper function omap_l4_region_base
Add helper function omap_l4_region_base() to return the base addressof a particular region of an L4 target agent.
Merge remote-tracking branch 'agraf/xen-next' into staging
Merge remote-tracking branch 'kraxel/migration.2' into staging
multiboot: Fix bss segment support
Multiboot images can specify a bss segment. The boot loader must clearthe memory of the bss and ensure that no modules or structures areallocated inside it. Several fields are provided in the Multibootheader that were previously not used properly. The header is now used...
Fix last sector write on sd card
When writing the last sector of an SD card using WRITE_MULTIPLE_BLOCKQEmu throws an error saying that we've run off the end, and leavesitself in the wrong state.
Tested on ARM Vexpress model.
Signed-off-by: Dr. David Alan Gilbert <david.gilbert@linaro.org>...
pc: grab system_memory
While eventually this should come from the machine initialization function,take a short cut to avoid converting all machines now.
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
pc: convert pc_memory_init() to memory API
pc: move global memory map out of pc_init1() and into its callers
Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
pci: pass address space to pci bus when created
This is now done sloppily, via get_system_memory(). Eventually callerswill be converted to stop using that.
pci: add MemoryRegion based BAR management API
Allow registering a BAR using a MemoryRegion. Once all users are converted,pci_register_bar() and pci_register_bar_simple() will be removed.
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Avi Kivity <avi@redhat.com>...
sysbus: add MemoryRegion based memory management API
Allow registering sysbus device memory using a MemoryRegion. Once all usersare converted, sysbus_init_mmio() and sysbus_init_mmio_cb() will be removed.
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>...
usb-ohci: convert to MemoryRegion
showing a splash picture when start
Added options to let qemu transfer two configuration files to bios:"bootsplash.bmp" and "etc/boot-menu-wait", which could be specified by command -boot splash=P,splash-time=TP is jpg/bmp file name or an absolute path, T have a max value of 0xffff, unit...
qdev: Reset hot-plugged devices
Device models rely on the core invoking their reset handlers after init.We do this in the cold-plug case, but so far we miss this step afterhot-plug.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
xen: implement unplug protocol in xen_platform
The unplug protocol is necessary to support PV drivers in the guest: thedrivers expect to be able to "unplug" emulated disks and nics beforeinitializing the Xen PV interfaces.It is responsibility of the guest to make sure that the unplug is done...
xen: make xen_enabled even more clever
When using xen_enabled() we're currently only checking if xen is enabledat all during the build. But what if you want to build multiple targetsout of which only one can potentially run xen code?
That means that for generic code we'll still have to fall back to the...
xen: Fix xen_enabled().
Use the "host" CONFIG_ define instead of the "target" one.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>Acked-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Alexander Graf <agraf@suse.de>
Fix chrdev return value conversion
6e1db57b2ac9025c2443c665a0d9e78748637b26 didn'tconvert brlapi or win32 chrdevs, breaking build for those.
Fix by converting the chrdevs.
Acked-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
mc146818rtc: Handle host clock resets
Make use of the new clock reset notifier to update the RTC wheneverrtc_clock is the host clock and that happens to jump backward. Thisavoids that the RTC stalls for the period the host clock was set back.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>...
Correct spelling of licensed
Correct typos of "licenced" to "licensed".
Reviewed-by: Stefan Weil <weil@mail.berlios.de>Reviewed-by: Andreas F=E4rber <andreas.faerber@web.de>Signed-off-by: Matthew Fernandez <matthew.fernandez@gmail.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
notifier: Pass data argument to callback
This allows to pass additional information to the notifier callbackwhich is useful if sender and receiver do not share any other distinctdata structure.
Will be used first for the clock reset notifier.
ide: Turn properties any IDE device must have into bus properties
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
virtio-serial: Turn props any virtio-serial-bus device must have into bus props
usb-ccid: Drop unused CCIDCardInfo callback print()
virtio-serial: Clean up virtser_bus_dev_print() output
Old version looks like this in info qtree (last four lines):
dev: virtconsole, id "" dev-prop: is_console = 1 dev-prop: nr = 0 dev-prop: chardev = <null>...
vga: Fix type of lfb/map_addr/end.
These addresses have been passed through pci_to_cpu_addr,and thus need to be full target_phys_addr_t.
Acked-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Richard Henderson <rth@twiddle.net>Cc: Jan Kiszka <jan.kiszka@siemens.com>...
qemu-char: Print strerror message on failure
The only way for chardev drivers to communicate an error was to return a NULLpointer, which resulted in an error message that said that something wentwrong, but not why.
This patch changes the interface to return 0/-errno and updates...
report serial devices created with -device in the PIIX4 config space
Serial and parallel devices created with -device are not reported inthe PIIX4 configuration space, and are hence not picked up by the DSDT.This upsets Windows, which hides them altogether from the guest....
multiboot: Support commas in module parameters
Support commas in the parameter list of multiboot modules as well as for thekernel command line, by using double commas (via get_opt_value()).
Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de>Reviewed-by: Kevin Wolf <kwolf@redhat.com>...
net: Consistently use qemu_macaddr_default_if_unset
Drop the open-coded MAC assignment from net_init_nic and replace it withstandard qemu_macaddr_default_if_unset which is also used by qdev. Thatavoid creating colliding MACs when instantiating NICs via different...
Merge remote-tracking branch 'spice/spice.v39' into staging
Merge remote-tracking branch 'kraxel/usb.21' into staging
Merge remote-tracking branch 'kwolf/for-anthony' into staging
usb-hid: fixup changed tracking.
Remove leftover calls to usb_hid_changed().
Take care to update the changed flag after delivering a event viaGET_REPORT like we do when sending events via interrupt endpoint.
usb-uhci: fix irq handling on error.
Spec on UHCI_STS_USBERR: "If the TD on which the error interruptoccurred also had its IOC bit set, both this bit and Bit 0 are set."
Make UHCI emulation do that.
ds1225y: convert to qdev device, and use it in MIPS Jazz emulation
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
ds1225y: use trace framework
ds1225y: Remove protection stuff, which doesn't belong to this device
ahci doesn't support migration
ehci doesn't support migration
usb storage: first migration support bits.
Tag vmstate as unmigratable for the time being,to be removed when mgration support is finished.
usb-wacom doesn't support migration
usb-bt doesn't support migration
usb-net doesn't support migration
usb-serial doesn't support migration
qxl: upon reset, if spice worker is stopped, the command rings can be not empty
Spice worker does no longer process commands when it is stopped.Otherwise, it might crash during migration when attempting to processcommands while the guest is not completely loaded....
vmstate: add no_migrate flag to VMStateDescription
This allows to easily tag devices as non-migratable,so any attempt to migrate a virtual machine with thedevice in question active will make migration fail.
scsi-disk: Fixup debugging statement
A debugging statement wasn't converted to the new interface.
Signed-off-by: Hannes Reinecke <hare@suse.de>Acked-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
scsi-disk: Mask out serial number EVPD
If the serial number is not set we should mask it out in thelist of supported VPD pages and mark it as not supported.
scsi: Add 'hba_private' to SCSIRequest
'tag' is just an abstraction to identify the commandfrom the driver. So we should make that explicit byreplacing 'tag' with a driver-defined pointer 'hba_private'.This saves the lookup for driver handling several commands...
Merge remote-tracking branch 'kraxel/usb.19' into staging
Merge remote-tracking branch 'spice/spice.v38' into staging
Merge remote-tracking branch 'mst/for_anthony' into staging
iov: Update parameter usage in iov_(to|from)_buf()
iov_to_buf() has an 'offset' parameter, iov_from_buf() hasn't.This patch adds the missing parameter to iov_from_buf().It also renames the 'offset' parameter to 'iov_off' toemphasize it's the offset into the iovec and not the buffer....
virtio-serial-bus: Fix trailing \n in error_report string
Markus fixed offenders in the file but one instance sneaked in viaanother patch. Fix it.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
virtio-console: Prevent abort()s in case of host chardev close
A host chardev could close just before the guest sends some data to bewritten. This will cause an -EPIPE error. This shouldn't be propagatedto virtio-serial-bus.
Ideally we should close the port once -EPIPE is received, but since the...
virtio-serial-bus: Add trace events
Add some trace events for messages passed between the guest and host.
virtio-console: Add some trace events
Add some trace events for messages passed between the char layer and thevirtio-serial bus.
pci_ids: tweak names to match linux/pci_ids.h
Sync xen names to ones used by linux. Addxen platform device id as well.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/piix_pci.c: Fix PIIX3-xen to initialize ids
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
xen: move to new pci initializers
move ids to pci info structure
virtio: fix indirect descriptor buffer overflow
We were previously allowing arbitrarily-long indirect descriptors, whichcould lead to a buffer overflow in qemu-kvm process.
CVE-2011-2212
vhost: fix double free on device stop
vhost dev stop failed to clear the log field.Typically not an issue as dev start overwrites this field,but if logging gets disabled before the following start,it doesn't so this causes a double free.
xen_console: fix memory leak
con_init leaks the string "type", fix it.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>Signed-off-by: Alexander Graf <agraf@suse.de>
xen: add vkbd support for PV on HVM guests
Register the vkbd backend even when running as device emulator for HVMguests: it is useful because it doesn't need a frequent timer like usb.
Check whether the XenInput DisplayState has been set in the initialise...
xen_disk: cope with missing xenstore "params" node
When disk is a cdrom and the drive is empty the "params" node inxenstore might be missing completely: cope with it instead ofsegfaulting.
Updated in v2:
- actually removed the strchr(blkdev->params, ':') that caused the...
xen_disk: treat "aio" as "raw"
Sometimes the toolstack uses "aio" without an additional formatidentifier, in such cases use "raw".
- fix code style.
xen_console: support the new extended xenstore protocol
Since CS 21994 on xen-unstable.hg and CS466608f3a32e1f9808acdf832a5843af37e5fcec on qemu-xen-unstable.git, fewchanges have been introduced to the PV console xenstore protocol, asdescribed by the document docs/misc/console.txt under xen-unstable.hg....
xen_console: fall back to qemu serial device
The new xen_console protocol changed the default xen_console output devicefrom whatever Qemu chose to whatever xenstore choses and "pty" as fallback.
This is not how Qemu works. It has its own serial redirection semantics. So...
xen: Fold CONFIG_XEN_MAPCACHE into CONFIG_XEN
Xen won't be enabled if there is no backend support available for thehost. And that also means the map cache will work. So drop the separateconfig switch and move the required stubs over to xen-stub.c.
esp: cancel current request only if some request is in flight
This bug was introduced in 94d3f98a3f3caddd7875f9a11776daeb84962a7b:scsi_cancel_io was checking if some request was pending before tryingto cancel it, while scsi_req_cancel always cancels the request....
spapr: use specific endian ld/st_phys
Signed-off-by: Alexander Graf <agraf@suse.de>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
s390-virtio: use specific endian ld/st_phys
ppc405_uc: use specific endian ld/st_phys
pl080: use specific endian ld/st_phys