bswap.h: Remove cpu_to_be16wu()
Replace the legacy cpu_to_be16wu() with stw_be_p().
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Richard Henderson <rth@twiddle.net>Reviewed-by: Michael S. Tsirkin <mst@redhat.com>Message-id: 1383669517-25598-7-git-send-email-peter.maydell@linaro.org...
shix: Don't require firmware presence for qtest
Adopt error_report() while at it.
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>Signed-off-by: Andreas Färber <afaerber@suse.de>
Merge remote-tracking branch 'mst/tags/for_anthony' into staging
pci, pc, acpi fixes, enhancements
This includes some pretty big changes:- pci master abort support by Marcel- pci IRQ API rework by Marcel- acpi generation support by myself
Everything has gone through several revisions, latest versions have been on...
virtio: Remove unneeded memcpy
Report from valgrind:
hw: set interrupts using pci irq wrappers
pci_set_irq and the other pci irq wrappers usePCI_INTERRUPT_PIN config register to compute deviceINTx pin to assert/deassert.
An irq is allocated using pci_allocate_irq wrapperonly if is needed by non pci devices....
blockdev: Remove IF_* check for read-only blockdev_init
IF_NONE allows read-only, which makes forbidding it in this placefor other types pretty much pointless.
Instead, make sure that all devices for which the check would haveerrored out check in their init function that they don't get a read-only...
xen_disk: mark ioreq as mapped before unmapping in error case
Commit 4472beae modified the semantics of ioreq_{un,}map so that they areidempotent if called when they're not needed (ie., twice in a row). However,it neglected to handle the case where batch mapping is not being used (the...
virtio-blk: do not relay a previous driver's WCE configuration to the current
The following sequence happens:- the SeaBIOS virtio-blk driver does not support the WCE feature, whichcauses QEMU to disable writeback caching
- the Linux virtio-blk driver resets the device, finds WCE is available...
block: Error parameter for open functions
Add an Error ** parameter to bdrv_open, bdrv_file_open and associatedfunctions to allow more specific error messages.
Signed-off-by: Max Reitz <mreitz@redhat.com>
dataplane: Fix startup race.
Avoid trying to setup dataplane again if dataplane setup is already inprogress. This may happen if an eventfd is triggered during setup.
I saw this occasionally with an experimental s390 irqfd implementation:
virtio_blk_handle_output...
block: make bdrv_delete() static
Manage BlockDriverState lifecycle with refcnt, so bdrv_delete() is nolonger public and should be called by bdrv_unref() if refcnt isdecreased to 0.
This is an identical change because effectively, there's no multiplereference of BDS now: no caller of bdrv_ref() yet, only bdrv_new() sets...
xen_disk: simplify blk_disconnect with refcnt
We call bdrv_attach_dev when initializing whether or not bs is createdlocally, so call bdrv_detach_dev and let the refcnt handle thelifecycle.
Signed-off-by: Fam Zheng <famz@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
pflash_cfi02.c: fix debug macro
If PFLASH_DEBUG is enabled then we have some build errors:
hw/block/pflash_cfi02.c: In function ‘pflash_timer’:hw/block/pflash_cfi02.c:128:5: error: expected ‘)’ before string constanthw/block/pflash_cfi02.c:128:5: error: too few arguments to function ‘fprintf’...
aio / timers: Switch entire codebase to the new timer API
This is an autogenerated patch using scripts/switch-timer-api.
Switch the entire code base to using the new timer API.
Note this patch may introduce some line length issues.
Signed-off-by: Alex Bligh <alex@alex.org.uk>...
dataplane/virtio-blk: drop flush_true() and flush_io()
.io_flush() is no longer called so drop flush_true() and flush_io().
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
aio: drop io_flush argument
The .io_flush() handler no longer exists and has no users. Drop theio_flush argument to aio_set_fd_handler() and related functions.
The AioFlushEventNotifierHandler and AioFlushHandler typedefs are nolonger used and are dropped too....
dataplane/virtio-blk: check exit conditions before aio_poll()
Check exit conditions before entering blocking aio_poll(). This ismainly for consistency since it's unlikely that we are stopping in thefirst event loop iteration.
sysfw: remove read-only pc_sysfw_flash_vs_rom_bug_compatible
The variable is not written anymore.
This cleans up after 9e1c2ec (which accidentally left variablepc_sysfw_flash_vs_rom_bug_compatible behind, value always zero), andburies dead code from commit dafb82e (which resurrected the pc_sysfw...
pc_sysfw: remove the rom_only property
With the new semantics of pc_sysfw (no -pflash implies "old-style" ROM setup,-pflash implies "new-style" ROM setup), there is no need anymore for a compatproperty. Old machines simply will never use -pflash, and thus will always...
pc_sysfw: do not make it a device anymore
Move the code to hw/i386, the sole remaining property is availableas !pci_enabled.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Markus Armbruster <armbru@redhat.com>Message-id: 1376069702-22330-4-git-send-email-aliguori@us.ibm.com...
onenand: QOM cast cleanup
Introduce a type constant, use QOM casts and rename the parent field andprepare for QOM realize.
Reviewed-by: Hu Tao <hutao@cn.fujitsu.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
fdc: Fix inheritence for SUNW,fdtwo
Since commit dd3be7420774f7dc8f37a96ca24d07f0b6f31b3b SUNW,fdtwo'sinitfn (realizefn since 940194c2369e50d91d1abf6f36d43853eea5e539)was using SYSBUS_FDC() cast. This uses type sysbus-fdc rather thanSUNW,fdtwo.
Fix this by letting SUNW,fdtwo and sysbus-fdc both inherit from an...
Merge remote-tracking branch 'stefanha/block' into staging
devices: Associate devices to their logical category
The category will be used to sort the devices displayed inthe command line help.
Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>Message-id: 1375107465-25767-4-git-send-email-marcel.a@redhat.com...
dataplane: refuse to start if device is already in use
Dataplane must check whether a block device is in use before launchingthe dataplane thread. This is necessary since the thread does notsynchronize with the main loop and I/O requests could cause corruption....
dataplane: enable virtio-blk x-data-plane=on live migration
Although the dataplane thread does not cooperate with dirty memorylogging yet it's fairly easy to temporarily disable dataplane duringlive migration. This way virtio-blk can live migrate when...
xen_disk: support "direct-io-safe" backend option
Support backend option "direct-io-safe". This is documented asfollows in the Xen backend specification:
pflash_cfi01: duplicate status byte from bits 23:16 for 32bit reads
The firmware commonly used with MIPS Malta boards (YAMON) reads thestatus of the pflash with a 32bit memory access. On real hardwarethis results in the status byte being mirrored in the upper 16 bits...
fdc: Use QOM realize for fdc
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>[AF: Renamed SysBusDevice variable]Signed-off-by: Andreas Färber <afaerber@suse.de>
fdc: Improve error propagation for QOM realize
Rename fdctrl_init_common() to fdctrl_realize_common() and letfdctrl_connect_drives() propagate an Error through it.
Reviewed-by: Hu Tao <hutao@cn.fujitsu.com>Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>...
pflash_cfi01: Use QOM realize for pflash_cfi01
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>[AF: Renamed argument]Signed-off-by: Andreas Färber <afaerber@suse.de>
pflash_cfi02: Use QOM realize for pflash_cfi02
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
fdc: QOM'ify some more
Introduce type constant and avoid DO_UPCAST(), container_of(),and use DEVICE to avoid accessing parent qdev directly.
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>[AF: Renamed parent field and avoided repeated SYS_BUS_DEVICE() casts]...
pflash-cfi01: QOM'ify some more
Introduce type constant and replace FROM_SYSBUS().
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>[AF: Renamed parent field]Signed-off-by: Andreas Färber <afaerber@suse.de>
pflash-cfi02: QOM'ify some more
Merge remote-tracking branch 'mjt/trivial-patches' into staging
block/m25p80: Update Micron entries
- Split 32Mb and 256Mb parts into a11 and a13 variants.- Add the 4K sector flag to the 128Mb parts. (These entries were taken from the Linux kernel list, which is missing the flag.)- Fill out the table of sizes with entries for 64Mb parts....
dataplane: sync virtio.c and vring.c virtqueue state
Load the virtio.c state into vring.c when we start dataplane mode andvice versa when stopping dataplane mode. This patch makes it possibleto start and stop dataplane any time while the guest is running....
hw/block: pass owner to memory_region_init* functions
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
memory: add owner argument to initialization functions
nand: Don't inherit from Sysbus
Nand chips are not sysbus devices - they do not have any sense of MMIO,nor interrupts. Re-parent to TYPE_DEVICE accordingly.
Cc: afaerber@suse.de
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Reviewed-by: Andreas Färber <afaerber@suse.de>...
block/nand: Convert Sysbus::init to Device::realize
The prescribed transition from Sysbus::init function to aDevice::realize.
block/nand: QOM casting sweep
Define and use standard QOM cast macro. Remove usages of DO_UPCAST anddirect -> style casting.
block/nand: Formatting sweep
Make this code closer to passing checkpatch. Mostly missing braces, buta few rogue tabs in there as well.
Cc: qemu-trivial@nongnu.org
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
dma: eliminate DMAContext
The DMAContext is a simple pointer to an AddressSpace that is now alwaysalready available. Make everyone hold the address space directly,and clean up the DMA API to use the AddressSpace directly.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>...
NVMe: Initial commit for new storage interface
Initial commit for emulated Non-Volatile-Memory Express (NVMe) pcistorage device.
NVMe is an open, industry driven storage specification definingan optimized register and command set designed to deliver the full...
isa: QOM'ify ISADevice
Rename its parent field and use DEVICE where necessary.
Signed-off-by: Andreas Färber <afaerber@suse.de>
isa: Use realizefn for ISADevice
Drop ISADeviceClass::init and the resulting no-op initfn and letchildren implement their own realizefn. Adapt error handling.Split off an instance_init where sensible.
block: add block driver read only whitelist
We may want to include a driver in the whitelist for read only taskssuch as diagnosing or exporting guest data (with libguestfs as a goodexample). This patch introduces a readonly whitelist option, and forbackward compatibility, the old configure option --block-drv-whitelist...
m25p80: Add Micron n25q032a
Based on the datasheet athttp://www.micron.com/~/media/Documents/Products/Data%20Sheet/NOR%20Flash/Serial%20NOR/N25Q/n25q_32mb_1_8v_65nm.pdf
Signed-off-by: Ed Maste <emaste@freebsd.org>Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
pc_sysfw: allow flash (-pflash) memory to be used with KVM
When pc-sysfw.rom_only == 0, flash memory will beusable with kvm. In order to enable flash memory mode,a pflash device must be created. (For example, byusing the -pflash command line parameter.)...
isapc: Fix non-KVM qemu boot (read/write memory for isapc BIOS)
The isapc machine with seabios currently requires the BIOS regionto be read/write memory rather than read-only memory.
KVM currently cannot support the BIOS as a ROM region, but qemuin non-KVM mode can. Based on this, isapc machine currently only...
memory: Rename readable flag to romd_mode
"Readable" is a very unfortunate name for this flag because even arom_device region will always be readable from the guest POV. Whatdiffers is the mapping, just like the comments had to explain already.Also, readable could currently be understood as being a generic region...
Revert "pc: Kill the "use flash device for BIOS unless KVM" misfeature"
This reverts commit 9953f8822cc316eec9962f0a2858c3439a80adec.While Markus's analysis is entirely correct, there are 1.6 patchesthat fix the bug for real and without requiring machine type hacks....
m25p80.c: Sync Flash chip list with Linux
Add new devices for various manufacturers, and re-sort Spansion list tomatch the order in Linux, which requires chips with a non-zero extended IDto come first.
With this commit the outstanding differences to Linux rev 55bf75b are:...
fdc: QOM'ify ISA floppy controller
Introduce type constant and cast macro to obsolete DO_UPCAST().Reuse type constant for PC machine compatibility settings.
Prepares for ISA realizefn.
Signed-off-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Andreas Färber <afaerber@suse.de>...
pc: Kill the "use flash device for BIOS unless KVM" misfeature
Use of a flash memory device for the BIOS was added in series "[PATCHv10 0/8] PC system flash support", commit 4732dca..1b89faf, v1.1.
Flash vs. ROM is a guest-visible difference. Thus, flash use had to...
virtio: cleanup: init and exit function.
This clean the init and the exit functions and rename virtio_common_cleanupto virtio_cleanup.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>Message-id: 1366791683-5350-7-git-send-email-fred.konrad@greensocs.com...
virtio: remove the function pointer.
This remove the function pointer in VirtIODevice, and use onlyVirtioDeviceClass function pointer.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>Message-id: 1366791683-5350-5-git-send-email-fred.konrad@greensocs.com...
virtio: remove virtiobindings.
This remove virtio-bindings, and use class instead.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>Message-id: 1366791683-5350-6-git-send-email-fred.konrad@greensocs.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
qdev: Drop taddr properties
Drop all the infrastructure for taddr properties (ie ones whichare 'hwaddr' sized). These are now unused, and any further desireduse would be rather questionable since device properties shouldn'tgenerally depend on a type that is conceptually variable based on...
m25p80: Remove bogus include of devices.h
I think in the early revisions of this we had an instantiation helperfor the device in devices.h. This was later removed and this header wasleft over. Removed
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>...
m25p80: Fix debug messages.
Some dodgy casts were making a mess of these msgs.
Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
m25p80: Convert guest errors to LOG_GUEST_ERROR
Some of the debug printfs in m25p80 are really guest errors.Changed over to qemu_log_mask(LOG_GUEST_ERROR accordingly.
m25p80.c: Multiple debug verbosity levels
The debug printfs on every page program/read is extremely verbose. Adda second level of debug for this.
m25p80: Add debug message for no bdrv
If there is no backing bdrv, let the debugging developer know about it.
arm: fix location of some include files
The recent rearrangement of include files had some minor errors: devices.h is not ARM specific and should not be in arm/ arm.h should be in arm/
Move these two headers to correct this.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>...
Typo, spelling and grammatical fixes
Minor fixes to documentation and code comments.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
hw: move private headers to hw/ subdirectories.
Many headers are used only in a single directory. These can bekept in hw/.
hw: move block devices to hw/block/, configure via default-configs/
hw: move target-independent files to subdirectories
This patch tackles all files that are compiled once, movingthem to subdirectories of hw/.
hw: move virtio devices to hw/ subdirectories
hw: make subdirectories for devices
Prepare the new directory structure.