summaryrefslogtreecommitdiff
path: root/hw
AgeCommit message (Collapse)AuthorFilesLines
2013-01-22ohci: add missing breakGerd Hoffmann1-0/+1
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-22Revert "usb-storage: Drop useless null test in usb_msd_handle_data()"Gerd Hoffmann1-1/+1
This reverts commit a1cbfd554e11bb8af38c2f3e1f1574bf4c563cd2. Test isn't useless. scsi_req_enqueue() may finish the request (will actually happen for requests which don't trigger any I/O such as INQUIRY), then call usb_msd_command_complete() which in turn will set s->req to NULL after unref'ing it. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2013-01-21sysbus: Drop sysbus_from_qdev() cast macroAndreas Färber75-214/+213
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> Cc: Anthony Liguori <anthony@codemonkey.ws> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-21virtio-s390-device: create a virtio-s390-bus during init.KONRAD Frederic2-0/+3
A virtio-s390-bus is created during the init. So one VirtIODevice can be connected 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>
2013-01-21virtio-s390-bus: add virtio-s390-bus.KONRAD Frederic2-0/+46
This add the virtio-s390-bus which extends virtio-bus. So one VirtIODevice can be connected on this bus. Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-21virtio-pci: refactor virtio-pci device.KONRAD Frederic2-2/+139
Create the virtio-pci device which is abstract. This transport device will create a virtio-pci-bus, so one VirtIODevice can be connected. Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-21virtio-pci-bus: introduce virtio-pci-bus.KONRAD Frederic2-0/+52
Introduce virtio-pci-bus, which extends virtio-bus. It is used with virtio-pci transport device. Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-21virtio-device: refactor virtio-device.KONRAD Frederic4-12/+130
Create the virtio-device which is abstract. All the virtio-device can extend this class. It also add some functions to virtio-bus. Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-21virtio-bus: introduce virtio-busKONRAD Frederic3-0/+217
Introduce virtio-bus. Refactored transport device will create a bus which extends virtio-bus. Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-21qdev: add a maximum device allowed field for the bus.KONRAD Frederic2-0/+14
Add a max_dev field to BusClass to specify the maximum amount of devices allowed on 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> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-21hw/tpci200: Fix compiler warning (redefined symbol with MinGW)Stefan Weil1-3/+3
STATUS_TIMEOUT is defined in winnt.h: CC hw/tpci200.o hw/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: note: this is the location of the previous definition Use STATUS_TIME instead of STATUS_TIMEOUT as suggested by Alberto Garcia. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-01-21acpitable: open the data file in binary modeMichael Tokarev1-1/+1
-acpitable {file|data}=file reads the content of file, but it is in 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 platform it is really needed. Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-01-21hw: Spelling fix in log messageStefan Weil1-1/+1
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>
2013-01-20Merge remote-tracking branch 'stefanha/block' into stagingAnthony Liguori3-5/+8
# By Kevin Wolf (4) and others # Via Stefan Hajnoczi * stefanha/block: dataplane: support viostor virtio-pci status bit setting dataplane: avoid reentrancy during virtio_blk_data_plane_stop() win32-aio: use iov utility functions instead of open-coding them win32-aio: Fix memory leak win32-aio: Fix vectored reads aio: Fix return value of aio_poll() ide: Remove wrong assertion block: fix null-pointer bug on error case in block commit
2013-01-19usb: Fix compilation for MinGW (regression)Stefan Weil1-1/+1
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>
2013-01-19vl: Use size_t for sizes in get_boot_devices_list()Markus Armbruster1-1/+1
Code mixes uint32_t, int and size_t. Very unlikely to go wrong in practice, but clean it up anyway. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-01-19fw_cfg: Use void *, size_t instead of uint8_t *, uint32_t for blobsMarkus Armbruster3-26/+26
Many callers pass size_t, which gets silently truncated to uint32_t. Harmless, because all practical sizes are well below 4GiB. Clean it up anyway. Size overflow now fails assertions. Bonus: saves a whole bunch of silly casts. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-01-19pc: Clean up bochs_bios_init()'s (non-)use of sizeofMarkus Armbruster1-3/+3
Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-01-19sun4: Fix unchecked strdup() by switching to fw_cfg_add_string()Markus Armbruster2-12/+4
Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-01-19pc: Fix unchecked strdup() by switching to fw_cfg_add_string()Markus Armbruster1-3/+1
Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-01-19fw_cfg: New fw_cfg_add_string()Markus Armbruster2-0/+8
Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-01-19fw_cfg: Dumb down fw_cfg_add_*() not to return success / failureMarkus Armbruster2-35/+24
No caller is checking the value, so all errors get ignored, usually silently. assert() instead. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-01-19fw_cfg: Replace debug prints by tracepointsMarkus Armbruster1-19/+6
Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2013-01-19Merge branch 'ppc-for-upstream' of git://repo.or.cz/qemu/agrafBlue Swirl4-21/+55
* 'ppc-for-upstream' of git://repo.or.cz/qemu/agraf: PPC: KVM: Add support for EPR with KVM openpic: export e500 epr enable into a ppc.c function Update Linux kernel headers PPC: e500: Change in-memory order of load blobs PPC: Provide zero SVR for -cpu e500mc and e5500 PPC: E500: Calculate loading blob offsets properly openpic: set mixed mode as supported openpic: unify gcr mode mask updates openpic: move gcr write into a function
2013-01-18s390: Add a hypercall registration interface.Cornelia Huck4-42/+107
Allow virtio machines to register for different diag500 function codes 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>
2013-01-18S390: Enable -cpu help and QMP query-cpu-definitionsViktor Mihajlovski1-1/+5
This enables qemu -cpu help to return a list of supported CPU models on s390 and also to query for cpu definitions in the monitor. Initially only cpu model = host is returned. This needs to be reworked into a full-fledged CPU model handling later on. This change is needed to allow libvirt exploiters (like OpenStack) to specify a CPU model. Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com> Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com> Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com> [agraf: fix s390x-linux-user, adjust header locations] Signed-off-by: Alexander Graf <agraf@suse.de>
2013-01-18s390: Move IPL code into a separate deviceChristian Borntraeger3-88/+185
Lets move the code to setup IPL for external kernel or 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 was created with zipl under LPAR or z/VM (future patch) - reuse that code for several machines (e.g. virtio-ccw and virtio-s390) - allow different machines to provide different defaults Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com> [agraf: symbolify initial psw, adjust header file location, fix for QOM] Signed-off-by: Alexander Graf <agraf@suse.de>
2013-01-18PPC: KVM: Add support for EPR with KVMAlexander Graf1-0/+6
This patch links KVM EPR support to the existing TCG support we have now. Signed-off-by: Alexander Graf <agraf@suse.de>
2013-01-18openpic: export e500 epr enable into a ppc.c functionAlexander Graf3-6/+18
Enabling and disabling the EPR capability (mpic_proxy) is a system wide operation. As such, it belongs into the ppc.c file, since that's where PPC specific machine wide logic happens. Signed-off-by: Alexander Graf <agraf@suse.de>
2013-01-18PPC: e500: Change in-memory order of load blobsAlexander Graf1-1/+6
Today, we load <kernel> <initrd> <dtb> into memory in that order. However, Linux has a bug where it can only handle the dtb if it's within the first 64MB of where <kernel> starts. So instead, let's change the order to <kernel> <dtb> <initrd> making Linux happy. Signed-off-by: Alexander Graf <agraf@suse.de>
2013-01-18PPC: E500: Calculate loading blob offsets properlyAlexander Graf1-4/+8
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 account, fixing the dtb offset along the way. Reported-by: Stuart Yoder <stuart.yoder@freescale.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2013-01-18openpic: set mixed mode as supportedAlexander Graf1-0/+1
The Raven MPIC implementation supports the "Mixed" mode to work with an i8259. While we don't implement mixed mode, we should mark it as a supported mode in the mode bitmap. Signed-off-by: Alexander Graf <agraf@suse.de>
2013-01-18openpic: unify gcr mode mask updatesAlexander Graf1-12/+13
The mode mask already masks out bits we don't care about, so the actual handling code can stay intact regardless. Signed-off-by: Alexander Graf <agraf@suse.de>
2013-01-18openpic: move gcr write into a functionAlexander Graf1-17/+22
The GCR register contains too much functionality to be covered inside of the register switch statement. Move it out into a separate function. Signed-off-by: Alexander Graf <agraf@suse.de>
2013-01-18dataplane: support viostor virtio-pci status bit settingStefan Hajnoczi1-1/+2
The viostor virtio-blk driver for Windows does not use the VIRTIO_CONFIG_S_DRIVER bit. It only sets the VIRTIO_CONFIG_S_DRIVER_OK bit. The viostor driver refreshes the virtio-pci status byte sometimes while the guest is running. We misinterpret 0x4 (VIRTIO_CONFIG_S_DRIVER_OK) as an indication that virtio-blk-data-plane should be stopped since 0x2 (VIRTIO_CONFIG_S_DRIVER) is missing. The result is that the device becomes unresponsive. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-01-18dataplane: avoid reentrancy during virtio_blk_data_plane_stop()Stefan Hajnoczi1-3/+6
When dataplane is stopping, the s->vdev->binding->set_host_notifier(..., false) call can invoke the virtqueue handler if an ioeventfd notification is pending. This causes hw/virtio-blk.c to invoke virtio_blk_data_plane_start() before virtio_blk_data_plane_stop() returns! The result is that we try to restart dataplane while trying to stop it and the following assertion is raised: msix_set_mask_notifier: Assertion `!dev->msix_mask_notifier' failed. Although the code was intended to prevent this scenario, the s->started boolean isn't enough. Add s->stopping so that we can postpone clearing s->started until we've completely stopped dataplane. This way, virtqueue handler calls during virtio_blk_data_plane_stop() are ignored. When dataplane is legitimately started again later we already self-kick ourselves to resume processing. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-01-17Merge remote-tracking branch 'luiz/queue/qmp' into stagingAnthony Liguori15-23/+24
# By Wenchao Xia # Via Luiz Capitulino * luiz/queue/qmp: HMP: add sub command table to info HMP: move define of mon_cmds HMP: add infrastructure for sub command HMP: delete info handler HMP: add QDict to info callback handler
2013-01-17virtio-pci: fix irqfd cleanup argument orderMichael S. Tsirkin1-3/+3
Order of arguments of kvm_virtio_pci_irqfd_release got 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> Tested-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Tested-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-17qom: Extend documentation on QOM method conceptsAndreas Färber1-4/+10
Add a documentation section "Methods" and discuss among others how to handle overriding virtual methods. Clarify DeviceClass::realize documentation and refer to the above. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-17HMP: add QDict to info callback handlerWenchao Xia15-23/+24
This patch change all info call back function to take additional QDict * parameter, which allow those command take parameter. Now it is set to NULL at default case. Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2013-01-17ide: Remove wrong assertionKevin Wolf1-1/+0
The Bus Master IDE Active bit (BM_STATUS_DMAING) is not only set when the request is still in flight, but also when it has completed and the size of the physical memory regions in the PRDT was larger than the transfer size. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-01-16tmp105: Add temperature QOM propertyAndreas Färber2-20/+29
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>
2013-01-16tmp105: QOM'ifyAndreas Färber2-24/+39
Introduce TYPE_ constant and cast macro. Move the state struct to the new header to allow for future embedding. 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>
2013-01-16tmp105: Fix I2C protocol bugAndreas Färber1-3/+6
An early length postincrement in the TMP105's I2C TX path led to transfers of more than one byte to place the second byte in the third byte's place within the buffer and the third byte to get discarded. Fix this by explictly incrementing the length after the checks but before the callback is called, which again checks the length. Adjust the Coding Style while at it. Signed-off-by: Alex Horn <alex.horn@cs.ox.ac.uk> 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>
2013-01-16tmp105: Split out I2C message constants from headerAndreas Färber2-33/+51
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>
2013-01-16usb-storage: Drop useless null test in usb_msd_handle_data()Markus Armbruster1-1/+1
scsi_req_new() never returns null, and scsi_req_enqueue() dereferences the 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>
2013-01-16pseries: Replace non-portable asprintf by g_strdup_printfStefan Weil2-28/+8
g_strdup_printf already handles OOM errors, so some error handling in QEMU code can be removed. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-16Add new DEFAULT_MACHINE_OPTIONS to q35 and ppc405Knut Omang2-0/+2
Without this default q35/ppc405 based machines would no longer boot after commit e4ada29e909787f629626660b1561f6a680187d3 Signed-off-by: Knut Omang <knut.omang@oracle.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-15qdev: Prepare "realized" propertyAndreas Färber2-24/+122
Introduce the QOM realizefn suggested by Anthony. Detailed documentation is supplied in the qdev header. For now this implements a default DeviceClass::realize callback that just wraps DeviceClass::init, which it deprecates. Once all devices have been converted to DeviceClass::realize, DeviceClass::init is to be removed. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de> Cc: Anthony Liguori <anthony@codemonkey.ws> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-01-15qdev: Fold state enum into bool realizedAndreas Färber5-29/+31
Whether the device was initialized or not is QOM-level information and currently unused. Drop it from device. This leaves the boolean state of whether or not DeviceClass::init was called or not, a.k.a. "realized". Suggested-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>