macio: QOM'ify some more
Move bar MemoryRegion initialization to an instance_init.
Signed-off-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Alexander Graf <agraf@suse.de>
macio: Delay qdev init until all fields are initialized
This turns macio_bar_setup() into an implementation detail of the qdevinitfn, to be removed step by step.
macio: Split MacIO in two
Let the machines create two different types. This prepares to moveknowledge about sub-devices from the machines into the devices.
mac_nvram: Clean up public API
The state data field is accessed in uint8_t quantities, so switch fromuint32_t argument and return value to uint8_t.
Fix debug format specifiers while at it.
mac_nvram: Mark as Big Endian
ppc: Move Mac machines to hw/ppc/
Signed-off-by: Andreas Färber <afaerber@suse.de>[agraf: squash in MAINTAINERS fix]Signed-off-by: Alexander Graf <agraf@suse.de>
Revert "serial: fix retry logic"
This reverts commit 67c5322d7000fd105a926eec44bc1765b7d70bdd:
I'm not sure if the retry logic has ever worked when not using FIFO mode. I found this while writing a test case although code inspection confirms it is...
trivial: etraxfs_eth: Eliminate checkpatch errors
This is a trivial patch to harmonize the coding style onhw/etraxfs_eth.c. This is in preparation to split off the bitbang mdiocode into a separate file.
Cc: Peter Maydell <peter.maydell@linaro.org>Cc: Paul Brook <paul@codesourcery.com>...
Merge remote-tracking branch 'bonzini/scsi-next' into staging
Merge remote-tracking branch 'kraxel/usb.77' into staging
scsi: fix segfault with 0-byte disk
When a 0-sized disk is found, READ CAPACITY will return aLUN NOT READY error. However, because it returns -1 insteadof zero, the HBA will call scsi_req_continue. This willtypically cause a segmentation fault or an assertion failure....
lsi: use qbus_reset_all to reset SCSI bus
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
scsi: Drop useless null test in scsi_unit_attention()
req was created by scsi_req_alloc(), which initializes req->dev to avalue it dereferences. req->dev isn't changed anywhere else.Therefore, req->dev can't be null.
Drop the useless null test; it spooks Coverity....
ohci: add missing break
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb: add usb-bot device (scsi bulk-only transport).
Basically the same as usb-storage, but without automatic scsidevice setup. Also features support for up to 16 LUNs.
Revert "usb-storage: Drop useless null test in usb_msd_handle_data()"
This reverts commit a1cbfd554e11bb8af38c2f3e1f1574bf4c563cd2.
Test isn't useless. scsi_req_enqueue() may finish the request (willactually happen for requests which don't trigger any I/O such as...
qxl: change rom size to 8192
This is a simpler solution to 869981, where migration breaks since qxl'srom bar size has changed. Instead of ignoring fields in QXLRom, which is what hasactually changed, we remove some of the modes, a mechanism alreadyaccounted for by the guest. The modes left allow for portrait and...
qxl: stop using non revision 4 rom fields for revision < 4
Signed-off-by: Alon Levy <alevy@redhat.com>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
sysbus: Drop sysbus_from_qdev() cast macro
Replace by SYS_BUS_DEVICE() QOM cast macro using a scripted conversion.Avoids the old macro creeping into new code.
Resolve a Coding Style warning in openpic code.
Signed-off-by: Andreas Färber <afaerber@suse.de>...
virtio-s390-device: create a virtio-s390-bus during init.
A virtio-s390-bus is created during the init. So one VirtIODevice can beconnected on the virtio-s390-device through this bus.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
virtio-pci: refactor virtio-pci device.
Create the virtio-pci device which is abstract. This transport device willcreate a virtio-pci-bus, so one VirtIODevice can be connected.
virtio-s390-bus: add virtio-s390-bus.
This add the virtio-s390-bus which extends virtio-bus. So one VirtIODevice canbe connected on this bus.
qdev: add a maximum device allowed field for the bus.
Add a max_dev field to BusClass to specify the maximum amount of devices allowedon the bus (has no effect if max_dev=0)
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>...
virtio-bus: introduce virtio-bus
Introduce virtio-bus. Refactored transport device will create a bus whichextends virtio-bus.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
virtio-device: refactor virtio-device.
Create the virtio-device which is abstract. All the virtio-device can extendthis class. It also add some functions to virtio-bus.
virtio-pci-bus: introduce virtio-pci-bus.
Introduce virtio-pci-bus, which extends virtio-bus. It is used with virtio-pcitransport device.
hw/tpci200: Fix compiler warning (redefined symbol with MinGW)
STATUS_TIMEOUT is defined in winnt.h:
CC hw/tpci200.ohw/tpci200.c:34:0: warning: "STATUS_TIMEOUT" redefined [enabled by default]/usr/lib/gcc/x86_64-w64-mingw32/4.6/../../../../x86_64-w64-mingw32/include/winnt.h:1036:0:...
hw: Spelling fix in log message
defineition -> definition
Signed-off-by: Stefan Weil <sw@weilnetz.de>Reviewed-by: Andreas F=E4rber <afaerber@suse.de>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
acpitable: open the data file in binary mode
-acpitable {file|data}=file reads the content of file, but it isin binary form, so the file should be opened usin O_BINARY flag.On *nix it is a no-op, but on windows and other weird platformit is really needed....
Merge remote-tracking branch 'stefanha/block' into staging
usb: Fix compilation for MinGW (regression)
84f2d0ea added an argument to function usb_host_info.The stub function must match the declaration in usb.h.
Signed-off-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
vl: Use size_t for sizes in get_boot_devices_list()
Code mixes uint32_t, int and size_t. Very unlikely to go wrong inpractice, but clean it up anyway.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
fw_cfg: Use void *, size_t instead of uint8_t *, uint32_t for blobs
Many callers pass size_t, which gets silently truncated to uint32_t.Harmless, because all practical sizes are well below 4GiB. Clean itup anyway. Size overflow now fails assertions....
pc: Clean up bochs_bios_init()'s (non-)use of sizeof
sun4: Fix unchecked strdup() by switching to fw_cfg_add_string()
fw_cfg: New fw_cfg_add_string()
pc: Fix unchecked strdup() by switching to fw_cfg_add_string()
fw_cfg: Dumb down fw_cfg_add_*() not to return success / failure
No caller is checking the value, so all errors get ignored, usuallysilently. assert() instead.
fw_cfg: Replace debug prints by tracepoints
Merge branch 'ppc-for-upstream' of git://repo.or.cz/qemu/agraf
s390: Move IPL code into a separate device
Lets move the code to setup IPL for external kernelor via the zipl rom into a separate file. This allows to
- define a reboot handler, setting up the PSW appropriately- enhance the boot code to IPL disks that contain a bootmap that...
S390: Enable -cpu help and QMP query-cpu-definitions
This enables qemu -cpu help to return a list of supported CPU modelson s390 and also to query for cpu definitions in the monitor.Initially only cpu model = host is returned. This needs to be reworked...
s390: Add a hypercall registration interface.
Allow virtio machines to register for different diag500 functioncodes and convert s390-virtio to use it.
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>Signed-off-by: Alexander Graf <agraf@suse.de>
PPC: E500: Calculate loading blob offsets properly
We have 3 blobs we need to load when booting the system:
- kernel - initrd - dtb
We place them in physical memory in that order. At least we should.This patch fixes the location calculation up to take any module into...
PPC: e500: Change in-memory order of load blobs
Today, we load
<kernel> <initrd> <dtb>
into memory in that order. However, Linux has a bug where it can onlyhandle the dtb if it's within the first 64MB of where <kernel> starts.
So instead, let's change the order to...
openpic: export e500 epr enable into a ppc.c function
Enabling and disabling the EPR capability (mpic_proxy) is a systemwide operation. As such, it belongs into the ppc.c file, since that'swhere PPC specific machine wide logic happens.
Signed-off-by: Alexander Graf <agraf@suse.de>
PPC: KVM: Add support for EPR with KVM
This patch links KVM EPR support to the existing TCG support we have now.
openpic: move gcr write into a function
The GCR register contains too much functionality to be covered insideof the register switch statement. Move it out into a separate function.
openpic: unify gcr mode mask updates
The mode mask already masks out bits we don't care about, so theactual handling code can stay intact regardless.
openpic: set mixed mode as supported
The Raven MPIC implementation supports the "Mixed" mode to work withan i8259. While we don't implement mixed mode, we should mark it asa supported mode in the mode bitmap.
dataplane: support viostor virtio-pci status bit setting
The viostor virtio-blk driver for Windows does not use theVIRTIO_CONFIG_S_DRIVER bit. It only sets the VIRTIO_CONFIG_S_DRIVER_OKbit.
The viostor driver refreshes the virtio-pci status byte sometimes while...
dataplane: avoid reentrancy during virtio_blk_data_plane_stop()
When dataplane is stopping, the s->vdev->binding->set_host_notifier(...,false) call can invoke the virtqueue handler if an ioeventfdnotification is pending. This causes hw/virtio-blk.c to invoke...
Merge remote-tracking branch 'luiz/queue/qmp' into staging
virtio-pci: fix irqfd cleanup argument order
Order of arguments of kvm_virtio_pci_irqfd_releasegot mixed up in all calls.As a result users see assertions during cleanup.
Reported-by: Laszlo Ersek <lersek@redhat.com>Reviewed-by: Laszlo Ersek <lersek@redhat.com>...
qom: Extend documentation on QOM method concepts
Add a documentation section "Methods" and discuss among others how tohandle overriding virtual methods.
Clarify DeviceClass::realize documentation and refer to the above.
HMP: add QDict to info callback handler
This patch change all info call back function to takeadditional QDict * parameter, which allow those commandtake parameter. Now it is set to NULL at default case.
Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>...
ide: Remove wrong assertion
The Bus Master IDE Active bit (BM_STATUS_DMAING) is not only set whenthe request is still in flight, but also when it has completed and thesize of the physical memory regions in the PRDT was larger than thetransfer size.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>...
tmp105: Split out I2C message constants from header
Allows value sharing with qtest.
Signed-off-by: Andreas Färber <andreas.faerber@web.de>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
tmp105: Fix I2C protocol bug
An early length postincrement in the TMP105's I2C TX path led totransfers of more than one byte to place the second byte in the thirdbyte's place within the buffer and the third byte to get discarded.
Fix this by explictly incrementing the length after the checks but...
tmp105: QOM'ify
Introduce TYPE_ constant and cast macro.Move the state struct to the new header to allow for future embedding.
tmp105: Add temperature QOM property
This obsoletes tmp105_set() and allows for better error handling.
Signed-off-by: Andreas Färber <andreas.faerber@web.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
usb-storage: Drop useless null test in usb_msd_handle_data()
scsi_req_new() never returns null, and scsi_req_enqueue() dereferencesthe pointer, so checking for null is useless.
Spotted by Coverity.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
pseries: Replace non-portable asprintf by g_strdup_printf
g_strdup_printf already handles OOM errors, so some error handling inQEMU code can be removed.
Signed-off-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Add new DEFAULT_MACHINE_OPTIONS to q35 and ppc405
Without this default q35/ppc405 based machines would no longer bootafter commit e4ada29e909787f629626660b1561f6a680187d3
Signed-off-by: Knut Omang <knut.omang@oracle.com>Reviewed-by: Markus Armbruster <armbru@redhat.com>...
qdev: Prepare "realized" property
Introduce the QOM realizefn suggested by Anthony.Detailed documentation is supplied in the qdev header.
For now this implements a default DeviceClass::realize callback thatjust wraps DeviceClass::init, which it deprecates....
qdev: Fold state enum into bool realized
Whether the device was initialized or not is QOM-level information andcurrently unused. Drop it from device. This leaves the boolean state ofwhether or not DeviceClass::init was called or not, a.k.a. "realized"....
Make default boot order machine specific
This patch makes default boot order machine specific instead ofset globally. The default boot order can be set per machine inQEMUMachine boot_order. This also allows a machine to receive aNULL boot order when -boot isn't used and take an appropriate action...
pseries: set no default boot order
This patch removes the default boot order for pseries machine. This allowsthe machine to handle a NULL boot order in case no -boot option is provided.Thus it helps SLOF firmware to verify if boot order is specified in command...
Merge remote-tracking branch 'afaerber/memory-ioport' into staging
Merge remote-tracking branch 'afaerber/qom-cpu' into staging
Merge remote-tracking branch 'afaerber-or/prep-up' into staging
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Merge remote-tracking branch 'sstabellini/xen-2013-01-14' into staging
xen_platform: Do not use old_portio-style callbacks
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>Signed-off-by: Andreas Färber <afaerber@suse.de>
acpi_piix4: Do not use old_portio-style callbacks
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>[AF: Used HWADDR_PRIx for hwaddr PIIX4_DPRINTF()]Signed-off-by: Andreas Färber <afaerber@suse.de>
hw/dma.c: Fix conversion of ioport_register* to MemoryRegion
The commit 582299336879504353e60c7937fbc70fea93f3da introduced a 1-shift forsome offset in DMA emulation.
Before the previous commit, which converted ioport_register_* toMemoryRegion, the DMA controller registered 8 ioports with the following...
scsi-disk: qemu_vfree(NULL) is fine, simplify
Signed-off-by: Markus Armbruster <armbru@redhat.com>Acked-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
ide: fix TRIM with empty range entry
ATA-ACS-3 says "If the two byte range length is zero, then the LBARange Entry shall be discarded as padding." iovecs are used as ifthey are linearized, so it is incorrect to discard the rest ofthis iovec.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
ide: issue discard asynchronously but serialize the pieces
Now that discard can take a long time, make it asynchronous.Each LBA range entry is processed separately because discardcan be an expensive operation.
exec: Return CPUState from qemu_get_cpu()
Move the declaration to qemu/cpu.h and add documentation.The implementation still depends on CPUArchState for CPU iteration.
Signed-off-by: Andreas Färber <afaerber@suse.de>
cpu: Move nr_{cores,threads} fields to CPUState
To facilitate the field movements, pass MIPSCPU to malta_mips_config();avoid that for mips_cpu_map_tc() since callers only access MIPS ThreadContexts, inside TCG helpers.
cpu: Move numa_node field to CPUState
cpu: Move cpu_index field to CPUState
Note that target-alpha accesses this field from TCG, now using anegative offset. Therefore the field is placed last in CPUState.
Pass PowerPCCPU to [kvm]ppc_fixup_cpu() to facilitate this change.
Move common parts of mips cpu_state_reset() to mips_cpu_reset()....
pc87312: Replace register_ioport_*() with MemoryRegion
Prepare an instance_init function for the MemoryRegion init.
Signed-off-by: Andreas Färber <andreas.faerber@web.de>Tested-by: Hervé Poussineau <hpoussin@reactos.org>
pc87312: Avoid define conflict on mingw32
Mingw32 headers define FAR, causing this warning:/src/qemu/hw/pc87312.c:38:0: warning: "FAR" redefined [enabled by default]In file included from /usr/local/lib/gcc/i686-mingw32msvc/4.7.0/../../../../i686-mingw32msvc/include/windows.h:48:0,...
virtio-9p: fix compilation error.
Fix the compilation error introduced by msg new field.
CC hw/9pfs/virtio-9p.oIn file included from /home/konradf/Documents/safe/greensocs/virtio-project/x86-qemu/qemu/hw/9pfs/virtio-9p.c:17:0:/home/konradf/Documents/safe/greensocs/virtio-project/x86-qemu/qemu/hw/virtio-pci.h:30:16: erreur: field ‘msg’ has incomplete type...
virtio-pci: build for uninitialized return value in vq_vector_unmask
Fixes the following:
/home/mdroth/w/qemu2.git/hw/virtio-pci.c: In function‘kvm_virtio_pci_vector_unmask’:/home/mdroth/w/qemu2.git/hw/virtio-pci.c:673:12: error: ‘ret’ may beused uninitialized in this function [-Werror=uninitialized]...
dataplane: fix build breakage on set_guest_notifiers()
virtio_pci_set_guest_notifiers() now takes an additional argument tospecify the number of virtqueues to assign a guest notifier for. Thiscauses a build breakage for CONFIG_VIRTIO_BLK_DATA_PLANE builds:...
Add TEWS TPCI200 IndustryPack emulation
The TPCI200 is a PCI board that supports up to 4 IndustryPack modules.
A new bus type called 'IndustryPack' has been created so anycompatible module can be attached to this board.
Reviewed-by: Andreas Färber <afaerber@suse.de>...
Add GE IP-Octal 232 IndustryPack emulation
The GE IP-Octal 232 is an IndustryPack module that implements eightRS-232 serial ports, each one of which can be redirected to acharacter device in the host.
Signed-off-by: Alberto Garcia <agarcia@igalia.com>...
xen_disk: implement BLKIF_OP_FLUSH_DISKCACHE, remove BLKIF_OP_WRITE_BARRIER
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
xen_disk: add persistent grant support to xen_disk backend
This protocol extension reuses the same set of grant pages for alltransactions between the front/back drivers, avoiding expensive tlbflushes, grant table lock contention and switches between userspace...
xen_disk: fix memory leak
On ioreq_release the full ioreq was memset to 0, loosing all the dataand memory allocations inside the QEMUIOVector, which leads to amemory leak. Create a new function to specifically reset ioreq.
Reported-by: Maik Wessler <maik.wessler@yahoo.com>...
Merge remote-tracking branch 'kraxel/usb.76' into staging
Merge remote-tracking branch 'spice/spice.v67' into staging
Merge remote-tracking branch 'kraxel/testdev.2' into staging
Merge remote-tracking branch 'kwolf/for-anthony' into staging
Merge remote-tracking branch 'mst/tags/for_anthony' into staging
pci,virtio
This further optimizes MSIX handling in virtio-pci.Also included is pci cleanup by Paolo, and pci deviceassignment fix by Alex.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>...
usb-host: Drop superfluous null test from usb_host_auto_scan()
Coverity points out that port is later passed to usb_host_open(),which dereferences it. It actually can't be null: it always points tousb_host_scan()'s auto port[]. Drop the superfluous port == NULL...
usb-host: Initialize dev->port the obviously safe way
Coverity worries the strcpy() could overrun the destination. Itcan't, because the source always points to usb_host_scan()'s autoport[], which has the same size. Use pstrcpy() anyway, to hush thechecker....