summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2012-07-09Merge remote-tracking branch 'kraxel/usb.55' into stagingAnthony Liguori6-41/+86
* kraxel/usb.55: usb-host: add trace events for iso xfers usb: fix interface initialization usb: split endpoint init and reset usb-redir: Correctly handle the usb_redir_babble usbredir status ehci: Kick async schedule on wakeup in the non companion case usb-ehci: Fix an assert whenever isoc transfers are used ehci: don't flush cache on doorbell rings. ehci: fix td writeback ehci: fix ehci_qh_do_overlay
2012-07-09Merge remote-tracking branch 'bonzini/scsi-next' into stagingAnthony Liguori13-37/+3872
* bonzini/scsi-next: scsi: Fix transfer length for READ POSITION commands. scsi: Add basic support for SCSI media changer commands. scsi: Ensure command and transfer lengths are set for all SCSI devices scsi: Fix LOAD_UNLOAD scsi: Fix data length == SCSI_SENSE_BUF_SIZE virtio-scsi: do not crash on adding buffers to the event queue megasas: LSI Megaraid SAS HBA emulation megasas: Add header file ISCSI: force use of sg for SMC and SSC devices ISCSI: Add SCSI passthrough via scsi-generic to libiscsi scsi-disk: implement READ DISC INFORMATION atapi: implement READ DISC INFORMATION scsi: add a qdev property for the disk's WWN scsi: simplify handling of the VPD page length field
2012-07-09Merge remote-tracking branch 'stefanha/trivial-patches' into stagingAnthony Liguori2-6/+0
* stefanha/trivial-patches: configure: Remove help for --disable-vnc-thread, --enable-vnc-thread cpu-common.h: Remove a pointless ifndef CONFIG_USER_ONLY cpu-common.h: Remove unnecessary guard on including targphys.h
2012-07-09usb-host: add trace events for iso xfersGerd Hoffmann2-6/+10
Replace iso transfer fprintf's with trace points. Also rename existing tracepoints so they all match usb_host_iso_*. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-07-09usb: fix interface initializationGerd Hoffmann2-2/+4
zero is a valid interface number, so don't use it when resetting the endpoints. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-07-09usb: split endpoint init and resetGerd Hoffmann3-4/+15
Create a new usb_ep_reset() function to reset endpoint state, without re-initialiting the queues, so we don't unlink in-flight packets just because usb-host has to re-parse the descriptor tables. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-07-09usb-redir: Correctly handle the usb_redir_babble usbredir statusHans de Goede1-0/+2
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-07-09ehci: Kick async schedule on wakeup in the non companion caseHans de Goede1-2/+3
Commit 0f588df8b3688b00e77aabaa32e26ece5f19bd39, added code to ehci_wakeup to kick the async schedule on wakeup, but the else was positioned wrong making it trigger for devices which are routed to the companion rather then to the ehci controller itself. This patch fixes this. Note that the "programming style" with using the return at the end of the companion block matches how the companion case is handled in the other ports ops, and is done this way for consistency. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-07-09usb-ehci: Fix an assert whenever isoc transfers are usedHans de Goede1-0/+1
hcd-ehci.c is missing an usb_packet_init() call for the ipacket UsbPacket it uses for isoc transfers, triggering an assert (taking the entire vm down) in usb_packet_setup as soon as any isoc transfers are done by a high speed USB device. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-07-09ehci: don't flush cache on doorbell rings.Gerd Hoffmann1-6/+29
Commit 4be23939ab0d7019c7e59a37485b416fbbf0f073 makes ehci instantly zap any unlinked queue heads when the guest rings the doorbell. While hacking up uas support this turned out to be a problem. The linux kernel can unlink and instantly relink the very same queue head, thereby killing any async packets in flight. That alone isn't an issue yet, the packet will canceled and resubmitted and everything is fine. We'll run into trouble though in case the async packet is completed already, so we can't cancel it any more. The transaction is simply lost then. usb_ehci_qh_ptrs q (nil) - QH @ 39c4f000: next 39c4f122 qtds 00000000,00000001,39c50000 usb_ehci_qh_fields QH @ 39c4f000 - rl 0, mplen 0, eps 0, ep 0, dev 0 usb_ehci_qh_ptrs q 0x7f95feba90a0 - QH @ 39c4f000: next 39c4f122 qtds 00000000,00000001,39c50000 usb_ehci_qh_fields QH @ 39c4f000 - rl 0, mplen 0, eps 0, ep 0, dev 0 usb_ehci_qh_ptrs q 0x7f95fe515210 - QH @ 39c4f120: next 39c4f0c2 qtds 29dbce40,29dbc4e0,00000009 usb_ehci_qh_fields QH @ 39c4f120 - rl 4, mplen 512, eps 2, ep 1, dev 2 usb_ehci_packet_action q 0x7f95fe515210 p 0x7f95fdec32a0: alloc usb_packet_state_change bus 0, port 2, ep 1, packet 0x7f95fdec32e0, state undef -> setup usb_ehci_packet_action q 0x7f95fe515210 p 0x7f95fdec32a0: process usb_uas_command dev 2, tag 0x2, lun 0, lun64 00000000-00000000 scsi_req_parsed target 0 lun 0 tag 2 command 42 dir 2 length 16384 scsi_req_parsed_lba target 0 lun 0 tag 2 command 42 lba 5933312 scsi_req_alloc target 0 lun 0 tag 2 scsi_req_continue target 0 lun 0 tag 2 scsi_req_data target 0 lun 0 tag 2 len 16384 usb_uas_scsi_data dev 2, tag 0x2, bytes 16384 usb_uas_write_ready dev 2, tag 0x2 usb_packet_state_change bus 0, port 2, ep 1, packet 0x7f95fdec32e0, state setup -> complete usb_ehci_packet_action q 0x7f95fe515210 p 0x7f95fdec32a0: free usb_ehci_qh_ptrs q 0x7f95fdec3210 - QH @ 39c4f0c0: next 39c4f002 qtds 29dbce40,00000001,00000009 usb_ehci_qh_fields QH @ 39c4f0c0 - rl 4, mplen 512, eps 2, ep 2, dev 2 usb_ehci_queue_action q 0x7f95fe5152a0: free usb_packet_state_change bus 0, port 2, ep 2, packet 0x7f95feba9170, state async -> complete ^^^ async packets completes. usb_ehci_packet_action q 0x7f95fdec3210 p 0x7f95feba9130: wakeup usb_ehci_qh_ptrs q (nil) - QH @ 39c4f000: next 39c4f122 qtds 00000000,00000001,39c50000 usb_ehci_qh_fields QH @ 39c4f000 - rl 0, mplen 0, eps 0, ep 0, dev 0 usb_ehci_qh_ptrs q 0x7f95feba90a0 - QH @ 39c4f000: next 39c4f122 qtds 00000000,00000001,39c50000 usb_ehci_qh_fields QH @ 39c4f000 - rl 0, mplen 0, eps 0, ep 0, dev 0 usb_ehci_qh_ptrs q 0x7f95fe515210 - QH @ 39c4f120: next 39c4f002 qtds 29dbc4e0,29dbc8a0,00000009 usb_ehci_qh_fields QH @ 39c4f120 - rl 4, mplen 512, eps 2, ep 1, dev 2 usb_ehci_queue_action q 0x7f95fdec3210: free usb_ehci_packet_action q 0x7f95fdec3210 p 0x7f95feba9130: free ^^^ endpoint #2 queue head removed from schedule, doorbell makes ehci zap the queue, the (completed) usb packet is freed too and gets lost. usb_ehci_qh_ptrs q (nil) - QH @ 39c4f000: next 39c4f0c2 qtds 00000000,00000001,39c50000 usb_ehci_qh_fields QH @ 39c4f000 - rl 0, mplen 0, eps 0, ep 0, dev 0 usb_ehci_qh_ptrs q 0x7f95feba90a0 - QH @ 39c4f000: next 39c4f0c2 qtds 00000000,00000001,39c50000 usb_ehci_qh_fields QH @ 39c4f000 - rl 0, mplen 0, eps 0, ep 0, dev 0 usb_ehci_queue_action q 0x7f9600dff570: alloc usb_ehci_qh_ptrs q 0x7f9600dff570 - QH @ 39c4f0c0: next 39c4f122 qtds 29dbce40,00000001,00000009 usb_ehci_qh_fields QH @ 39c4f0c0 - rl 4, mplen 512, eps 2, ep 2, dev 2 usb_ehci_packet_action q 0x7f9600dff570 p 0x7f95feba9130: alloc usb_packet_state_change bus 0, port 2, ep 2, packet 0x7f95feba9170, state undef -> setup usb_ehci_packet_action q 0x7f9600dff570 p 0x7f95feba9130: process usb_packet_state_change bus 0, port 2, ep 2, packet 0x7f95feba9170, state setup -> async usb_ehci_packet_action q 0x7f9600dff570 p 0x7f95feba9130: async ^^^ linux kernel relinked the queue head, ehci creates a new usb packet, but we should have delivered the completed one instead. usb_ehci_qh_ptrs q 0x7f95fe515210 - QH @ 39c4f120: next 39c4f002 qtds 29dbc4e0,29dbc8a0,00000009 usb_ehci_qh_fields QH @ 39c4f120 - rl 4, mplen 512, eps 2, ep 1, dev 2 So instead of instantly zapping the queue we'll set a flag that the queue needs revalidation in case we'll see it again in the schedule. ehci then checks that the queue head fields addressing / describing the endpoint and the qtd pointer match the cached content before reusing it. Cc: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-07-09ehci: fix td writebackGerd Hoffmann1-2/+4
Only write back the dwords the hc is supposed to update. Should not make a difference in theory as the guest must not touch the td while it is active to avoid races. But it is still more correct. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-07-09ehci: fix ehci_qh_do_overlayGerd Hoffmann1-19/+18
Use ehci_flush_qh to make sure we touch inly the fields the hc is allowed to touch. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2012-07-07bitops.h: Add functions to extract and deposit bitfieldsPeter Maydell1-0/+90
Add functions deposit32(), deposit64(), extract32() and extract64() to extract and deposit bitfields in 32 and 64 bit words. Based on ideas by Jia Liu and Avi Kivity. Suggested-by: Jia Liu <proljc@gmail.com> Suggested-by: Avi Kivity <avi@redhat.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-07target-i386: make it clearer that op table accesses don't overrunPeter Maydell1-6/+6
Rephrase some of the expressions used to select an entry in the SSE op table arrays so that it's clearer that they don't overrun the op table array size. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-07target-i386: Remove confusing X86_64_DEF macroPeter Maydell1-15/+24
The X86_64_DEF macro is a confusing way of making some terms in a conditional only appear if TARGET_X86_64 is defined. We only use it in two places, and in both cases this is for making the same test, so abstract that check out into a function where we can use a more conventional #ifdef. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-07target-i386: Remove unused macrosPeter Maydell1-6/+0
Commit 11f8cdb removed all the uses of the X86_64_ONLY macro. The BUGGY_64() macro has been unused for a long time: it originally marked some ops which couldn't be enabled because of issues with the pre-TCG code generation scheme. Remove the now-unnecessary definitions of both macros. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-07.gitignore updateEduardo Habkost1-0/+6
Makes sure the following files are ignored: libcacard/.libs/ libcacard/libcacard.la libcacard/libcacard.pc libcacard/libcacard/ libcacard/osdep.lo libcacard/oslib-posix.lo libcacard/qemu-thread-posix.lo libcacard/qemu-timer-common.lo libcacard/trace.lo libcacard/trace/ tests/test-visitor-serialization vscclient Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-07Merge branch 'arm-devs.for-upstream' of ↵Blue Swirl13-8/+2689
git://git.linaro.org/people/pmaydell/qemu-arm * 'arm-devs.for-upstream' of git://git.linaro.org/people/pmaydell/qemu-arm: hw/cadence_gem: Make rx_desc_addr and tx_desc_addr uint32_t i.MX31: KZM-ARM11-01 evaluation board i.MX31: Interrupt Controller i.MX31: Timers i.MX31: Clock Control Module i.MX: UART support Exynos4: add RTC device hw/exynos4210.c: Fix misleading initialization of IROM mirror hw/exynos4210_pwm.c: Fix STOP status in tick handler. ARM: hw/exynos4210_mct.c: Fix a bug which hangs Linux kernel.
2012-07-05target-i386: Fix compilation with --enable-debugStefan Weil1-25/+34
commit c4baa0503d9623f1ce891f525ccd140c598bc29a improved SSE table type safety which now raises compiler errors when latest QEMU was configured with --enable-debug. Fix this by splitting the SSE tables even further to separate helper functions with different signatures. Instead of crashing by calling address 0, the code now jumps to label illegal_op. Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-07-04hw/cadence_gem: Make rx_desc_addr and tx_desc_addr uint32_tPeter Maydell1-2/+2
Make the state fields rx_desc_addr and tx_desc_addr uint32_t; this matches the VMStateDescription, and also conforms to how hardware works: the registers don't magically become larger if the device is attached to a CPU with a larger physical address size. It also fixes a compile failure if the target_phys_addr_t type is changed to 64 bits. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
2012-07-04i.MX31: KZM-ARM11-01 evaluation boardPeter Chubb3-0/+161
Board support for Kyoto Micro's KZM-ARM11-01, an evaluation board built around the Freescale i.MX31. Signed-off-by: Philip O'Sullivan <philipo@ok-labs.com> Signed-off-by: Peter Chubb <peter.chubb@nicta.com.au> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-07-04i.MX31: Interrupt ControllerPeter Chubb2-1/+409
Implement the Freescale i.MX31 advanced vectored interrupt controller, at least to the extent it is used by Linux 3.x Vectors are not implemented. Signed-off-by: Philip O'Sullivan <philipo@ok-labs.com> Signed-off-by: Peter Chubb <peter.chubb@nicta.com.au> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-07-04i.MX31: TimersPeter Chubb3-1/+698
Implement the timers on the Freescale i.MX31 SoC. This is not a complete implementation, but gives enough for Linux to boot and run. In particular external triggers, which are not useful under QEMU, are not implemented. Signed-off-by: Philip O'Sullivan <philipo@ok-labs.com> Signed-off-by: Peter Chubb <peter.chubb@nicta.com.au> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-07-04i.MX31: Clock Control ModulePeter Chubb3-1/+332
For Linux to be able to work out how fast its clocks are going, so that timer ticks come approximately at the right time, it needs to be able to query the clock control module (CCM). This is the start of a CCM implementation. It currently knows only about the MCU, HSP and IPG clocks --- i.e., the ones used to feed the periodic and general purpose timers. Signed-off-by: Peter Chubb <peter.chubb@nicta.com.au> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-07-04i.MX: UART supportPeter Chubb3-0/+484
Implement the Freescale i.MX UART. This uart is used in a variety of SoCs, including some by Motorola, as well as in the Freescale i.MX series. This patch gives only a `bare-bones' implementation, enough to run Linux or OKL4, but that's about it. Signed-off-by: Philip O'Sullivan <philipo@ok-labs.com> Signed-off-by: Peter Chubb <peter.chubb@nicta.com.au> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-07-04Exynos4: add RTC deviceOleg Ogurtsov3-0/+604
Signed-off-by: Oleg Ogurtsov <o.ogurtsov@samsung.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-07-04hw/exynos4210.c: Fix misleading initialization of IROM mirrorEvgeny Voevodin1-1/+1
We want to mirror whole IROM and should pass zero instead of EXYNOS4210_IROM_BASE_ADDR (though it equals to zero too) since memory_region_init_alias takes an offset within an original region as an argument. Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-07-04hw/exynos4210_pwm.c: Fix STOP status in tick handler.Evgeny Voevodin1-1/+1
START/STOP bit was not cleaned correctly. Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-07-04ARM: hw/exynos4210_mct.c: Fix a bug which hangs Linux kernel.Stanislav Vorobiov1-4/+0
After some long period of time Linux kernel hanged due to ptimer_get_count may return 0 before timer interrupt occurs, thus, causing FRC to jump back in time Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2012-07-02scsi: Fix transfer length for READ POSITION commands.Christian Hoff2-1/+23
The transfer length depends on the specific service action code, as defined in the SCSI stream commands spec section 7.7. Up to now only the extended form was supported. Signed-off-by: Christian Hoff <christian.hoff@de.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-02scsi: Add basic support for SCSI media changer commands.Christian Hoff2-6/+43
This adds basic support for SCSI media changer commands. Not all commands are supported as of now, but enough to cover basic functionality. Signed-off-by: Christian Hoff <christian.hoff@de.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-02scsi: Ensure command and transfer lengths are set for all SCSI devicesPaolo Bonzini1-7/+18
scsi-generic relies on those values to be correct, so it is important that those values are initialized properly for all device types. Reported-by: Christian Hoff <christian.hoff@de.ibm.com> Reported-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-02scsi: Fix LOAD_UNLOADChristian Hoff2-4/+4
Change operation code of LOAD_UNLOAD command to 0x1b as described in section 7.3 of the SCSI Stream Commands spec. Signed-off-by: Christian Hoff <christian.hoff@de.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-02scsi: Fix data length == SCSI_SENSE_BUF_SIZEChristian Hoff1-1/+1
Fix the edge case where the sense data length is exactly the same as SCSI_SENSE_BUF_SIZE. This makes SCSI requests work that use all of the available 95 byte sense data. Signed-off-by: Christian Hoff <christian.hoff@de.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-02virtio-scsi: do not crash on adding buffers to the event queuePaolo Bonzini1-1/+5
The event queue is not supported yet and the handler does not have to do much anyway when buffers are added. However, the handler is called unconditionally by the virtio layer, and this results in a crash as soon as buffers are added to the event queue because we pass NULL. Reported-by: Bryan Venteicher <bryanv@daemoninthecloset.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-02megasas: LSI Megaraid SAS HBA emulationHannes Reinecke5-0/+2281
This patch adds an emulation for the LSI Megaraid SAS 8708EM2 HBA. I've tested it to work with Linux, Windows Vista, and Windows7. Signed-off-by: Hannes Reinecke <hare@suse.de> [ Squashed trivial changes from Andreas Faerber, rebased over IOMMU and QBus changes - Paolo ] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-02configure: Remove help for --disable-vnc-thread, --enable-vnc-threadStefan Weil1-2/+0
Commit 2624bab836662d37f08336408a99d97652fc9c4d removed these configure arguments. Now the help text for both is removed, too. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-07-02cpu-common.h: Remove a pointless ifndef CONFIG_USER_ONLYPeter Maydell1-2/+0
Remove an ifndef CONFIG_USER_ONLY guard that was pointless because it is already inside an if !defined(CONFIG_USER_ONLY). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-07-02cpu-common.h: Remove unnecessary guard on including targphys.hPeter Maydell1-2/+0
There's no need to make the include of targphys.h conditional on whether TARGET_PHYS_ADDR_BITS is defined, because targphys.h itself checks that and does nothing if it isn't. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Andreas Färber <afaerber@suse.de> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-07-02megasas: Add header fileHannes Reinecke1-0/+1248
This patch adds the header file for megasas. Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-02ISCSI: force use of sg for SMC and SSC devicesRonnie Sahlberg1-0/+10
If the device we open is a SMC or SSC device, then force the use of sg. We dont have any medium changer or tape emulation so only passthrough via real sg or scsi-generic via iscsi would work anyway. Forcing sg also makes qemu skip trying to read from the device to guess the image format by reading from the device (find_image_format()). SMC devices do not implement READ6/10/12/16 so it is not possible to read from them (SSC have different CDBs). With this patch I can successfully manage a SMC device wiht iscsi in passthrough mode. Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com> [Added TYPE_TAPE handling - Paolo] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-02ISCSI: Add SCSI passthrough via scsi-generic to libiscsiRonnie Sahlberg2-8/+147
Update iscsi to allow passthrough of SG_IO scsi commands when the iscsi device is forced to be scsi-generic. Implement both bdrv_ioctl() and bdrv_aio_ioctl() in the iscsi backend, emulate the SG_IO ioctl and pass the SCSI commands across to the iscsi target. This allows end-to-end passthrough of SCSI all the way from the guest, to qemu, via scsi-generic, then libiscsi all the way to the iscsi target. To activate this you need to specify that the iscsi lun should be treated as a scsi-generic device. Example: -device lsi -device scsi-generic,drive=MyISCSI \ -drive file=iscsi://10.1.1.125/iqn.ronnie.test/1,if=none,id=MyISCSI Note, you can currently not boot a qemu guest from a scsi device. Note, This only works when the host is linux, since the emulation relies on definitions of SG_IO from the scsi-generic implementation in the linux kernel. It should be fairly easy to re-implement some structures similar enough for non-linux hosts to do the same style of passthrough via a fake scsi generic layer and libiscsi if need be. Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-02scsi-disk: implement READ DISC INFORMATIONPaolo Bonzini2-0/+41
This command is not necessary for CD-ROM and DVD-ROM, but some versions of udev trip on its absence. Cc: Kevin Wolf <kwolf@redhat.com> Cc: Markus Armbruster <armbru@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-02atapi: implement READ DISC INFORMATIONPaolo Bonzini1-0/+31
This command is not necessary for CD-ROM and DVD-ROM, but some versions of udev trip on its absence. Cc: Kevin Wolf <kwolf@redhat.com> Cc: Markus Armbruster <armbru@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-02scsi: add a qdev property for the disk's WWNPaolo Bonzini1-1/+13
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-07-02scsi: simplify handling of the VPD page length fieldPaolo Bonzini1-8/+7
The last four bytes of the thin provisioning page were cut out. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2012-06-28bsd-user: fix buildBlue Swirl2-1/+4
Link in oslib objects also for BSD user, but avoid using the version of qemu_vmalloc() defined in oslib-posix.c. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-06-28x86: rename op_helper.c to seg_helper.cBlue Swirl2-3/+3
Rename what is remaining of op_helper.c to seg_helper.c. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-06-28x86: split off memory access helpersBlue Swirl3-137/+165
Move memory access helpers to mem_helper.c. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-06-28x86: split off misc helpersBlue Swirl3-579/+605
Move various functions to misc_helper.c. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>