hw/9pfs: Don't crash when we get a request with not supported 9p operation
Return EOPNOTSUPP as error
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
[virtio-9p] Make rpath thread safe
Current rpath inline function is heavily used in all system calls.This function has a static buffer making it a non-thread safe function.This patch introduces new thread-safe routine and makes use of it.
Signed-off-by: Venkateswararao Jujjuri "<jvrao@linux.vnet.ibm.com>
virtio-9p: Use relative includes for files in hw
Commit 353ac78d495ef976242abd868f68d78420861c2c moved the fileswithout fixing the include paths. It used a modified CFLAGSto add hw to the include search path, but this breaks buildswhere the user wants to set special CFLAGS. Long include paths...
virtio-9p: Move device specific code to virtio-9p-device
virtio-9p: Move 9p device registration into virtio-9p.c
This patch move the 9p device registration into its own file
[virtio-9p] Stop renaming files with similar name!
v9fs_complete_rename() mistakenly renames files with similar nameas we don't check if the matched name is really an offspring.
Signed-off-by: Malahal Naineni <malahal@us.ibm.com>Signed-off-by: Venkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
Merge remote-tracking branch 'amit/for-anthony' into staging
Merge remote-tracking branch 'bonzini/scsi.2' into staging
Conflicts: hw/usb-msd.c
Merge remote-tracking branch 'kraxel/usb.14.pull' into staging
pflash_cfi02: Fix a typo in debug code (TARGET_FMT_pld -> TARGET_FMT_plx)
Thanks to Tobias Hoffmann <th55@gmx.de> for this patch.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
bitbang_i2c: Fix spurious slave read after NACK
After NACKing a read operation, a raising SCL should not trigger a newread from the slave. Introduce a new state which just waits for a stopor start condition after NACK.
Signed-off-by: Marcus Comstedt <marcus@mc.pp.se>...
virtio-serial: Clean up virtconsole detection
virtio-serial-bus needs to treat "virtconsole" devices specially. Ituses VirtIOSerialPort member is_console to recognize them. It getsits value via property initialization. Cute hack, except it letsusers mess with it: "-device virtconsole,is_console=0" isn't plugged...
virtio-serial: Drop useless property is_console
All you could ever achieve with it is break stuff, so removing itshould be safe.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Amit Shah <amit.shah@redhat.com>
virtio-serial: Drop redundant VirtIOSerialPort member info
virtio-console: Simplify init callbacks
virtio-serial-bus: use bh for unthrottling
Instead of calling flush_queued_data when unthrottling, schedulea bh. That way we can return immediately to the caller, and theflush uses the same call path as a have_data for callbackee.
No migration change is required because bh are called from vm_stop....
virtio-serial: Plug memory leak on qdev exit()
virtio_serial_init() allocates the VirtIOSerialBus dynamically, butvirtio_serial_exit() doesn't free it.
Fix by getting rid of the allocation.
scsi: make write_data return void
The return value is unused anyway.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Christoph Hellwig <hch@lst.de>
scsi-generic: Handle queue full
The sg driver currently has a hardcoded limit of commands itcan handle simultaneously. When this limit is reached thedriver will return -EDOM. So we need to capture this toenable proper return values here.
Signed-off-by: Hannes Reinecke <hare@suse.de>...
esp: rename sense to status
This mirrors the LSI patch that was recently committed.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Cc: Christoph Hellwig <hch@lst.de>
scsi: split command_complete callback in two
scsi: rename arguments to the new callbacks
scsi: ignore LUN field in the CDB
The LUN field in the CDB is a historical relic. Ignore it as reserved,which is what modern SCSI specifications actually say.
scsi: Update sense code handling
The SCSI spec has a quite detailed list of sense codes available.It even mandates the use of specific ones for some failure cases.The current implementation just has one type of generic errorwhich is actually a violation of the spec in certain cases....
scsi: do not call send_command directly
Move the common part of scsi-disk.c and scsi-generic.c to the SCSI layer.
scsi: introduce scsi_req_new
scsi: introduce scsi_req_continue
scsi: introduce scsi_req_get_buf
... and remove some SCSIDevice variables or fields that now become unused.
scsi: Implement 'get_sense' callback
The get_sense callback copies existing sense information intothe provided buffer. This is required if sense informationshould be transferred together with the command response.
scsi-disk: add data direction checking
scsi_req_parse() already provides for a data direction setting,so we should be using it to check for correct direction.And we should return the sense code 'INVALID FIELD IN CDB'in these cases.
scsi: reference-count requests
With the next patch, a device may hold SCSIRequest for an indefinitetime. Split a rather big patch, and protect against access errors,by reference counting them.
There is some ugliness in scsi_send_command implementation due to...
lsi: extract lsi_find_by_tag
scsi: Use 'SCSIRequest' directly
Currently the SCSIRequest structure is abstracted away and cannot accesseddirectly from the driver. This requires the handler to do a lookup onan abstract 'tag' which identifies the SCSIRequest structure.
With this patch the SCSIRequest structure is exposed to the driver. This...
scsi: commonize purging requests
The code for canceling requests upon reset is already the same. Cleanit up and move it to scsi-bus.c.
scsi: introduce scsi_req_abort
This covers the case of canceling a request's I/O and stillcompleting it.
scsi: introduce scsi_req_cancel
This is for when the request must be dropped in the void,but still memory should be freed. To this end, the devicesregister a second callback in SCSIBusOps.
scsi: use scsi_req_complete
scsi: add tracing of scsi requests
scsi-generic: Remove bogus double complete
scsi-generic scsi_read_complete() should not both call the clientcomplete callback with SCSI_REASON_DATA and callscsi_command_complete(). The former will cause the client to queue anew read or write request, while the later will free the request data...
scsi: introduce scsi_req_data
This abstracts calling the command_complete callback, reducing churnin the following patches.
scsi: introduce SCSIBusOps
There are more operations than a SCSI bus can handle, besides completingcommands. One example, which this series will introduce, is cleaning upafter a request is cancelled.
More long term, a "SCSI bus" can represent the LUNs attached to a...
scsi-generic: do not use a stale aiocb
If a request is canceled after it has been completed, scsi_cancel_iowould pass a stale aiocb to bdrv_aio_cancel. Avoid this.
usb: add ehci adapter
This patch finally merges the EHCI host adapter aka USB 2.0 support.
Based on the ehci bits collected @ git://git.kiszka.org/qemu.git ehci
EHCI has a long out-of-tree history. Project was started by MarkBurkley, with contributions by Niels de Vos. David S. Ahern continued...
usb: add usb_handle_packet
Add a usb_handle_packet function, put it into use everywhere.Right now it just calls dev->info->handle_packet(), that willchange in future patches though.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb: keep track of packet owner.
Keep track of the device which owns the usb packet for async processing.
usb: move cancel callback to USBDeviceInfo
Remove the cancel callback from the USBPacket struct, move it overto USBDeviceInfo. Zap usb_defer_packet() which is obsolete now.
usb: Add Interface Association Descriptor descriptor type
Signed-off-by: Brad Hards <bradh@frogmouth.net>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb: update config descriptors to identify number of interfaces
Previously we relied on the .bNumInterfaces, but that won't always beaccurate after the introduction of grouped interfaces.
usb: remove fallback to bNumInterfaces if no .nif
All callers have been updated.
usb: add support for "grouped" interfaces and the Interface Association Descriptor
This is used for some devices that have multiple interfaces that form a logicdevice. An example is Video Class, which has a Control interface and aStreaming interface. There can be additional interfaces on the same (physical)...
Bug #757654: UHCI fails to signal stall response patch
UHCI host controller status register indicates error andan interrupt is triggered on BABBLE and STALL errors.
Signed-off-by: Jan Vesely <jano.vesely@gmail.com>Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
usb: Pass the packet to the device's handle_control callback
This allows using the generic usb_generic_handle_packet function fromdevice code which does ASYNC control requests (such as the linux hostpass through code).
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
usb-linux: use usb_generic_handle_packet()
Make the linux usb host passthrough code use the usb_generic_handle_packet()function, rather then the curent DYI code. This removes 200 lines of almostidentical code.
usb-storage: don't call usb_packet_complete twice
usb_msd_copy_data() may cause a recursive call tousb_msd_command_complete() which in turn may completethe packet, setting s->packet to NULL in case it does.Recheck s->packet before calling usb_packet_complete()...
Merge remote-tracking branch 'kraxel/CVE-2011-1751' into staging
Merge branch 'trivial-patches' of git://repo.or.cz/qemu/stefanha
Merge branch 'ppc-next' of git://repo.or.cz/qemu/agraf
piix_pci: fix piix3_set_irq_pic()
If pic_irq is greater than 7, the irq level is always 0 on 32bits.
Signed-off-by: TeLeMan <geleman@gmail.com>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
hw/realview.c: Remove duplicate #include line
Remove a duplicate #include of sysbus.h.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
hw/sd.c: Don't complain about SDIO commands CMD52/CMD53
The SDIO specification introduces new commands 52 and 53.Handle as illegal command but do not complain on stderr,as SDIO-aware OSes (including Linux) may legitimately usethese in their probing for presence of an SDIO card....
pSeries: Clean up write-only variables
A few pieces of the pSeries emulation code have variables which are setbut never used, which causes warnings on gcc 4.6. This patch removesthese instances.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>...
s390x: fix memory detection for guests > 64GB
the s390 memory detection has a 16bit field that specifies the amount ofincrements. This patch adopts the memory size to always fit into thatscheme. This also fixes virtio detection for these guests, since the...
s390x: keep hint on virtio managing size
The s390x virtio bus keeps management information on virtio after the topof the guest's RAM. We need to be able to tell the guest the size of itsRAM (without virtio stuff), but also be able to trap when the guest accesses...
ahci: Fix non-NCQ accesses for LBA > 16bits
AHCI provides two ways of reading/writing data:
1) NCQ 2) ATA commands with the LBA in the command FIS
In the second code path, we didn't handle any LBAs that were bigger than16 bits, so whenever a guest that used high LBA numbers wanted to access...
Ignore pci unplug requests for unpluggable devices (CVE-2011-1751)
This patch makes qemu ignore unplug requests from the guest for pcidevices which are tagged as non-hotpluggable. Trouble spot is thepiix4 chipset with the ISA bridge. Requests to unplug that one will...
blockdev: Store -drive option media in DriveInfo
DriveInfo is closely tied to -drive, and like -drive, it mixesinformation about host and guest part of the block device. UnlikeDriveInfo, BlockDriverState should be about the host part only.
One of the remaining guest bits there is the "type hint". -drive...
scsi: Split qdev "scsi-disk" into "scsi-hd" and "scsi-cd"
A "scsi-disk" is either a hard disk or a CD-ROM, depending on theassociated BlockDriverState's type hint. Unclean; disk vs. CD belongsto the guest part, not the host part.
Have separate qdevs "scsi-hd" and "scsi-cd" to model disk vs. CD in...
ide: Split qdev "ide-drive" into "ide-hd" and "ide-cd"
An "ide-drive" is either a hard disk or a CD-ROM, depending on theassociated BlockDriverState's type hint. Unclean; disk vs. CD belongsto the guest part, not the host part.
Have separate qdevs "ide-hd" and "ide-cd" to model disk vs. CD in...
ahci: Fix crashes on duplicate BH registration
If ahci_dma_set_inactive is called a while there is still a pending BHfrom a previous run, we will crash on the second run ofahci_check_cmd_bh as it overwrites AHCIDevice::check_bh. Avoid thisbroken and redundant duplicate registration....
ide: cleanup warnings
Add \n.
Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
hw/xen_disk: Remove unused local variable
cppcheck report:hw/xen_disk.c:309: style: Variable 'len' is assigned a value that is never used
Cc: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
ide: Turn debug messages into assertions
These printfs aren't really debug messages, but clearly indicate a bug if theyever become effective. Noone uses DEBUG_IDE, let's re-enable the checkunconditionally and make it an assertion instead of printfs in the device...
ahci: Unbreak bar registration
Fix regression of 667bb59: ahci_init initializes ahci.mem, so we have tomove bar registration after it.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Conflicts: cpu-all.h
Merge remote-tracking branch 'agraf/xen-next' into staging
PPC: Qdev'ify e500 pci
The e500 PCI controller isn't qdev'ified yet. This leads to severe issueswhen running with -drive.
To be able to use a virtio disk with an e500 VM, let's convert the PCIcontroller over to qdev.
Reviewed-by: Paul Brook <paul@codesourcery.com>...
PPC: Make MPC8544DS obey -cpu switch
The MPC8544DS board emulation code ignored the user defined -cpu switch.This patch enables it to only provide a sane default, not force an e500v2CPU inside.
Signed-off-by: Alexander Graf <agraf@suse.de>
PPC: Make MPC8544DS emulation work w/o KVM
The MPC8544DS board emulation was only used with KVM so far, so someparts of the code didn't provide proper values for non-KVM execution.
This patch makes the machine work without KVM enabled. To actually usethis, you also need proper e500v2 MMU emulation....
PPC MPC7544DS: Use new TLB helper function
Now that we have some nice helpers that can find us a TLB entry, let'suse that on the machine initialization code, so we don't need to knowabout the internals of the TLB array.
Fix off-by-one error in sizing pSeries hcall table
The pSeries machine uses two tables to look up guest hcalls for emulation.One of these is exactly one entry too small to hold all the hcalls it needsto, leading to memory corruption.
This patch fixes the bug, and while we're at it, make both tables 'static'...
pseries: Increase maximum CPUs to 256
The original pSeries machine was limited to 32 CPUs, more or lessarbitrarily. Particularly when we get SMT KVM guests it will bepretty easy to exceed this. Therefore, raise the max number of CPUsin a pseries machine guest to 256....
Make pSeries 'model' property more closely resemble real hardware
Currently, the qemu emulated pseries machine puts"qemu,emulated-pSeries-LPAR" in the device tree's root level 'model'property. Unfortunately this confuses some installers and ybin, which...
Place pseries vty devices at addresses more similar to existing machines
Currently the qemu pseries machine numbers its virtual serial devicesfrom 0. However, existing pSeries machines running pHyp number them from0x30000000.
In theory these indices are arbitrary, since everything necessary for the...
monitor: add PPC BookE SPRs
Read them via KVM_GET_SREGS in kvm_arch_get_registers(),and display them in "info registers".
Also get CR and PID from the existing KVM_GET_REGS.
Signed-off-by: Scott Wood <scottwood@freescale.com>Signed-off-by: Alexander Graf <agraf@suse.de>
usb-musb: uninline functions
Prototype without "inline" keyword breaks the build with some gccversions. Noticed by Alexander Graf.
Fix this by removing the inline keywork everywhere. Some functionscan't be inlined anyway as the are referenced using function pointers....
lsi53c895a: Rename 'sense' to 'status'
The 'sense' field in the HBA status structure is misnamed, as itactually carries the SCSI status. Rename it.
Signed-off-by: Hannes Reinecke <hare@suse.de>Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>...
ac97: Remove unused local variables
cppcheck report:hw/ac97.c:1004: style: Variable 'written' is assigned a value that is never usedhw/ac97.c:1072: style: Variable 'written' is assigned a value that is never used
Signed-off-by: Stefan Weil <weil@mail.berlios.de>...
Fix typos in comments (instanciation -> instantiation)
Fix typos in comments and code (occured -> occurred and related)
The code changed here is an unused data type name (evt_flush_occurred).
Fix typo in comment (responsiblity -> responsibility)
Fix typos in comment (threshhold -> threshold, mapp -> map)
Fix typos in comments (imediately -> immediately)
Fix typos in comments (interupt -> interrupt)
Fix typos in comments (accessable -> accessible, priveleged -> privileged)
Fix typo in comment (colum -> column)
Fix typo in comment (auxilliary -> auxiliary)
xen: Add Xen hypercall for sleep state in the cmos_s3 callback.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>Signed-off-by: Alexander Graf <agraf@suse.de>
xen: Initialize event channels and io rings
Open and bind event channels; map ioreq and buffered ioreq rings.
Signed-off-by: Arun Sharma <arun.sharma@intel.com>Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>...