summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-04-19vhost-scsi-pci: new device supporting the tcm_vhost Linux kernel moduleNicholas Bellinger2-0/+78
Cc: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org> Signed-off-by: Asias He <asias@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-04-19vhost-scsi: new device supporting the tcm_vhost Linux kernel moduleNicholas Bellinger5-1/+378
The WWPN specified in configfs is passed to "-device vhost-scsi-pci". The tgpt field of the SET_ENDPOINT ioctl is obsolete now, so it is not available from the QEMU command-line. Instead, I hardcode it to zero. Changes in Patch-v2: - Add vhost_scsi_get_features() in order to determine feature bits supports by host kernel (mst + nab) - Re-enable usage of DEFINE_VIRTIO_COMMON_FEATURES, and allow EVENT_IDX to be disabled by host in vhost_scsi_get_features() - Drop unused hotplug bit in DEFINE_VHOST_SCSI_PROPERTIES Changes in Patch-v1: - Set event_idx=off by default (nab, thanks asias) - Disable hotplug feature bit for v3.9 tcm_vhost kernel code, need to re-enable in v3.10 (nab) - Update to latest qemu.git/master HEAD Changes in WIP-V3: - Drop ioeventfd vhost_scsi_properties (asias, thanks stefanha) - Add CONFIG_VHOST_SCSI (asias, thanks stefanha) - Add hotplug feature bit Changes in WIP-V2: - Add backend guest masking support (nab) - Bump ABI_VERSION to 1 (nab) - Set up set_guest_notifiers (asias) - Set up vs->dev.vq_index (asias) - Drop vs->vs.vdev.{set,clear}_vhost_endpoint (asias) - Drop VIRTIO_CONFIG_S_DRIVER check in vhost_scsi_set_status (asias) Howto: Use the latest seabios, at least commit b44a7be17b git clone git://git.seabios.org/seabios.git make cp out/bios.bin /usr/share/qemu/bios.bin qemu -device vhost-scsi-pci,wwpn=naa.6001405bd4e8476d,event_idx=off ... Cc: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org> Signed-off-by: Asias He <asias@redhat.com> [ Rebase on top of VirtIOSCSICommon patch, fix bugs in feature negotiation and irqfd masking - Paolo ] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-04-19virtio: simplify Makefile conditionalsPaolo Bonzini2-5/+5
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-04-19virtio-scsi: create VirtIOSCSICommonPaolo Bonzini6-148/+210
This patch refactors existing virtio-scsi code into VirtIOSCSICommon in order to allow virtio_scsi_init_common() to be used by both internal virtio_scsi_init() and external vhost-scsi-pci code. Cc: Michael S. Tsirkin <mst@redhat.com> Cc: Asias He <asias@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-04-19vhost: Add vhost_commit callback for SeaBIOS ROM region re-mappingNicholas Bellinger2-15/+41
This patch follows MST's recommendation to move checks for vhost_verify_ring_mappings() -> cpu_physical_memory_map() operations from MemoryListener->region_[add,del]() -> vhost_set_memory() into final MemoryListener->commit() -> vhost_commit() callback. It addresses the case where virtio-scsi vq ioport RAM re-mapping to read-only SeaBIOS ROM triggers a cpu_physical_memory_map() NIL MemoryRegionSection pointer failure. Also save vhost_dev->mem_changed_[start,end]_addr values in vhost_set_memory() for final ranges_overlap checks. (Thanks Paolo!) Cc: Michael S. Tsirkin <mst@redhat.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Asias He <asias@redhat.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-04-19scsi: VMWare PVSCSI paravirtual device implementationDmitry Fleytman7-0/+1780
Signed-off-by: Dmitry Fleytman <dmitry@daynix.com> Signed-off-by: Yan Vugenfirer <yan@daynix.com> [ Rename files to vmw_pvscsi, fix setting of hostStatus in pvscsi_request_cancelled - Paolo ] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-04-19scsi: avoid assertion failure on VERIFY commandPaolo Bonzini1-5/+14
A verify command is not an actual read (we do not implement compare mode) and thus does not have an AIOCB attached. Do not crash in scsi_dma_complete. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-04-18configure: remove duplicate testPaolo Bonzini1-30/+26
We already had a test to add -march=i486 when needed. Make the existing test independent of vhost-net, so that it is also used under Win32. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2013-04-18configure: CONFIG_NO_XEN is duplicatedPaolo Bonzini2-4/+1
We already define it in Makefile.target. But we need to avoid a curious double negation in order to eliminate it. Tested-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2013-04-18configure: eliminate target_libs_softmmuPaolo Bonzini3-5/+5
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2013-04-18configure: move common libraries to config-host.makPaolo Bonzini2-6/+8
Move -lm to the end of the line, so that it can be picked up as a dependency by pixman in the static build case. Reviewed-by: Peter Maydell <peter.maydell@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2013-04-18configure: move CONFIG_QEMU_LDST_OPTIMIZATION to config-host.makPaolo Bonzini1-9/+9
Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2013-04-18elfload: use abi_llong/ullong instead of target_llong/ullongPaolo Bonzini4-8/+12
The alignment is a characteristic of the ABI, not the CPU. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2013-04-18elfload: only give abi_long/ulong the alignment specified by the targetPaolo Bonzini3-19/+18
Previously, this was done for target_long/ulong, and propagated to abi_long/ulong via a typedef. But target_long/ulong should not have any specific alignment, it is never used to access guest memory. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2013-04-18elfload: use abi_int/uint instead of target_int/uintPaolo Bonzini4-12/+16
The alignment is a characteristic of the ABI, not the CPU. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2013-04-18elfload: use abi_short/ushort instead of target_short/ushortPaolo Bonzini4-7/+10
The alignment is a characteristic of the ABI, not the CPU. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2013-04-18elfload: use tswapreg consistently in elf_core_copy_regsPaolo Bonzini1-57/+57
Reviewed-by: Peter Maydell <peter.maydell@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2013-04-18elfload: fix size of registers for N32Paolo Bonzini1-7/+14
Registers are 64-bit in size for the MIPS n32 ABI. Define target_elf_greg_t accordingly, and use the correct function to do endian swaps. Reviewed-by: Peter Maydell <peter.maydell@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2013-04-18elfload: fix size of ABI-dependent fields in core dumpsPaolo Bonzini1-9/+9
Some fields in core dumps are 32-bit in 32-or-64 environments (ppc64abi32, sparc32plus). Use abi_long/ulong for those. Also, the fields of target_elf_siginfo are ints. Use tswap32 to convert them. Reviewed-by: Peter Maydell <peter.maydell@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2013-04-18configure: QEMU_INCLUDES are the same for all subtargetsPaolo Bonzini1-15/+13
Reviewed-by: Peter Maydell <peter.maydell@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2013-04-18configure/Make: Build libfdt from submodule DTCPeter Crosthwaite2-5/+36
Configure to use the DTC submodule to build libfdt when no system libfdt is found. Prompt to install the DTC submodule if --enable-fdt is set but no DTC can be found. DTC has no out-of-tree build capability, so the configure will symlink the Makefile and scripts directory in the out of tree build directory and pass in all the needed DTC arguments to make out of tree build happen. Ideally we fix the DTC make to support out of tree, but did it this way to avoid commits to DTC. Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com> Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2013-04-18dtc: add submodulePeter Crosthwaite2-0/+3
Add dtc submodule as a fallback for old distros. Picking version 1.3.0. as this is the most recently tagged stable version. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2013-04-18configure: Put cross compile flags in EXTRA_CFLAGSPeter Crosthwaite1-6/+9
The cross compile CFLAGS are needed to properly build pixman (and any other submodules). Only the EXTRA_CFLAGS set is passed to submodules not QEMU_CFLAGS, so put the cross compile flags in EXTRA_CFLAGS instead. Signed-off-by: Peter Crosthwaite peter.crosthwaite@xilinx.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
2013-04-17virtio-net: cleanup: init and exit function.KONRAD Frederic1-95/+22
This remove old init and exit function as they are no longer needed. Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com> Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com> Message-id: 1365690602-22729-8-git-send-email-fred.konrad@greensocs.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-04-17virtio-net: cleanup: use QOM cast.KONRAD Frederic2-68/+75
As the virtio-net-pci and virtio-net-s390 are switched to the new API, we can use QOM casts. Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com> Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com> Message-id: 1365690602-22729-7-git-send-email-fred.konrad@greensocs.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-04-17virtio-net-ccw: switch to the new API.KONRAD Frederic2-16/+28
Here the virtio-net-ccw is modified for the new API. The device virtio-net-ccw extends virtio-ccw-device as before. It creates and connects a virtio-net-device during the init. The properties are not modified. Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com> Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com> Message-id: 1365690602-22729-6-git-send-email-fred.konrad@greensocs.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-04-17virtio-net-s390: switch to the new API.KONRAD Frederic2-12/+30
Here the virtio-net-s390 is modified for the new API. The device virtio-net-s390 extends virtio-s390-device as before. It creates and connects a virtio-net-device during the init. The properties are not modified. Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com> Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com> Message-id: 1365690602-22729-5-git-send-email-fred.konrad@greensocs.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-04-17virtio-net-pci: switch to the new API.KONRAD Frederic2-60/+69
Here the virtio-net-pci is modified for the new API. The device virtio-net-pci extends virtio-pci. It creates and connects a virtio-net-device during the init. The properties are not changed. Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com> Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com> Message-id: 1365690602-22729-4-git-send-email-fred.konrad@greensocs.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-04-17virtio-net: add the virtio-net device.KONRAD Frederic5-20/+161
Create virtio-net-device which extends virtio-device, so it can be connected on virtio-bus. Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com> Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com> Message-id: 1365690602-22729-3-git-send-email-fred.konrad@greensocs.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-04-17virtio: add two functions to VirtioDeviceClass.KONRAD Frederic1-0/+12
Recent changes need two functions to VirtioDevice. This just add them into VirtioDeviceClass. Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com> Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com> Message-id: 1365690602-22729-2-git-send-email-fred.konrad@greensocs.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-04-17Fix warnings suppressors to honor --disable-werrorMarkus Armbruster4-3/+8
Replace #pragma GCC diagnostic ignored FOO [Troublesome code...] #pragma GCC diagnostic error FOO by #pragma GCC diagnostic push #pragma GCC diagnostic ignored FOO [Troublesome code...] #pragma GCC diagnostic pop Broken in commit 3f4349d, commit 092bb30, and commit c95e308. Signed-off-by: Markus Armbruster <armbru@redhat.com> Tested-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1366113066-1340-1-git-send-email-armbru@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-04-17fw_cfg: add qtest test caseAnthony Liguori2-0/+143
This validates some basic characteristics of fw_cfg. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Message-id: 1366123521-4330-8-git-send-email-aliguori@us.ibm.com
2013-04-17i440fx-test: add test for PAM functionalityAnthony Liguori1-1/+138
This tests PAM settings for the i440fx. This test does a lot of byte MMIO which is fairly slow with qtest today. But the test does complete in under 2 seconds. We don't fully emulate PAM largely because of limitations with KVM so we #if 0 that part of the test case. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Message-id: 1366123521-4330-7-git-send-email-aliguori@us.ibm.com
2013-04-17i440fx-test: add test to compare default register valuesAnthony Liguori2-0/+150
This test compares all of the default register values against the spec. It turns out we deviate in quite a few places. These places are really only visible to the BIOS though which is why this hasn't created any problems. The deviation actually happens in the core PCI layer so I suspect it's not a simple fix if we really care to fix it. For now, just disable the affected checks. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Message-id: 1366123521-4330-6-git-send-email-aliguori@us.ibm.com
2013-04-17libqos: add malloc supportAnthony Liguori4-0/+130
This is a very simple allocator for the PC platform. It should be possible to add backends for other platforms. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Message-id: 1366123521-4330-5-git-send-email-aliguori@us.ibm.com
2013-04-17libqos: add fw_cfg supportAnthony Liguori5-2/+147
fw_cfg is needed to get the top of memory which is necessary for doing PCI allocation and allocating RAM for DMA. Add a PC version of fw_cfg and enough abstraction to support other platforms. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Message-id: 1366123521-4330-4-git-send-email-aliguori@us.ibm.com
2013-04-17qtest: add libqos including PCI supportAnthony Liguori6-2/+495
This includes basic PCI support for the PC platform. Enough abstraction should be present to support non-PC platforms too. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Message-id: 1366123521-4330-3-git-send-email-aliguori@us.ibm.com
2013-04-17qtest: don't use system command to avoid double forkAnthony Liguori1-7/+4
Currently we waitpid on the child process we spawn off that does nothing more than system() another process. While this does not appear to be incorrect, it's wasteful and confusing so get rid of it. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Message-id: 1366123521-4330-2-git-send-email-aliguori@us.ibm.com
2013-04-17migration: reflect incoming failure to shellEric Blake1-1/+1
Management apps like libvirt don't know to pay attention to stderr unless there is a non-zero exit status. * migration.c (process_incoming_migration_co): Exit with non-zero status on failure. Signed-off-by: Eric Blake <eblake@redhat.com> Message-id: 1366149041-626-1-git-send-email-eblake@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-04-17qbus: remove wrong error messagesAlexey Kardashevskiy1-4/+2
The existing code shows the "Bus '%s' is full" message even if name is specified and different from bus->name (i.e. match=0). The patch excludes unnecessary error message. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Message-id: 1366184940-13516-1-git-send-email-aik@ozlabs.ru Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-04-17chardev: remove the headers of Memory chardev driverLei Li1-6/+0
Memory chardev driver is no longer used, and Commit: 4bf0bb8014ac2ac61b1004f5d92b2a4594d48017 has droped it but the headers, so clean it up. Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com> Message-id: 1366188414-24214-1-git-send-email-lilei@linux.vnet.ibm.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-04-17Merge remote-tracking branch 'bonzini/migration-writev' into stagingAnthony Liguori2-69/+149
# By Paolo Bonzini # Via Paolo Bonzini * bonzini/migration-writev: qemu-file: do not use stdio for qemu_fdopen iov: handle partial writes from sendmsg and recvmsg iov: reorganize iov_send_recv, part 3 iov: reorganize iov_send_recv, part 2 iov: reorganize iov_send_recv, part 1 qemu-file: drop socket_put_buffer Message-id: 1366192012-14872-1-git-send-email-pbonzini@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-04-17qemu-file: do not use stdio for qemu_fdopenPaolo Bonzini1-11/+90
This uses system calls directly for Unix file descriptors, so that the efficient writev_buffer can be used. Pay attention to the possibility of partial writes in writev. Reviewed-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Orit Wassermann <owasserm@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-04-17iov: handle partial writes from sendmsg and recvmsgPaolo Bonzini1-47/+55
Partial writes can still happen in sendmsg and recvmsg, if a signal is received in the middle of a write. To handle this, retry the operation with a new offset/bytes pair. Reviewed-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Orit Wassermann <owasserm@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-04-17iov: reorganize iov_send_recv, part 3Paolo Bonzini1-15/+15
"si" and "ei" are merged in a single variable. Reviewed-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Orit Wassermann <owasserm@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-04-17iov: reorganize iov_send_recv, part 2Paolo Bonzini1-14/+14
Do not touch the "bytes" argument anymore. Instead, remember the original length of the last iovec if we touch it, and restore it afterwards. This requires undoing the changes in opposite order. The previous algorithm didn't care. Reviewed-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Orit Wassermann <owasserm@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-04-17iov: reorganize iov_send_recv, part 1Paolo Bonzini1-7/+13
Once the initial part of the iov is dropped, it is not used anymore. Modify iov/iovcnt directly instead of adjusting them with the "si" variable. Reviewed-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Orit Wassermann <owasserm@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-04-17qemu-file: drop socket_put_bufferPaolo Bonzini1-13/+0
It is enough to implement one of socket_writev_buffer and socket_put_buffer. Reviewed-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Orit Wassermann <owasserm@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-04-16qom: do nothing on unparent of object without parentPaolo Bonzini1-0/+4
Otherwise, device_unparent will fail to get a canonical path of the object. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1364910600-3418-1-git-send-email-pbonzini@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2013-04-16qdev: Fix device_add bus assumptionsAndreas Färber1-8/+8
Drop an unreachable fallback bus assignment to SysBus. If no ,bus= is specified, only search busses recursively for bus type if the DeviceClass has a bus_type specified. Handle resulting NULL cases. Signed-off-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Andreas Färber <afaerber@suse.de> Message-id: 1366077021-28882-1-git-send-email-afaerber@suse.de Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>