History | View | Annotate | Download (19.7 kB)
ide: allow other dma comands than read and write
Replace the is_read flag with a dma_cmd flag to allow the dma andrestart logic to handler other commands like TRIM.
Signed-off-by: Christoph Hellwig <hch@lst.de>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
ide: add TRIM support
Add support for TRIM sub function of the data set management command,and wire it up to the qemu discard infrastructure.
ide: Split error status from status register
When adding the werror=stop mode, some flags were added to s->statuswhich are used to determine what kind of operation should be restartedwhen the VM is continued.
Unfortunately, it turns out that s->status is in fact a device register...
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...
ide: Split atapi.c out
Besides moving code, this patch only fixes some whitespace issues in the movedcode and makes all functions in atapi.c static which can be static.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
atapi: GESN: implement 'media' subcommand
Implement the 'media' sub-command of the GET_EVENT_STATUS_NOTIFICATIONcommand. This helps us report tray open, tray closed, no media, mediapresent states to the guest.
Newer Linux kernels (2.6.38+) rely on this command to revalidate discs...
ide: factor dma handling helpers
Factor the DMA I/O path that is duplicated between read and writecommands, into common helpers using the s->is_read flag added forthe macio ATA controller.
ide: add ncq identify data for ahci sata drives
I modified ide_identify() to include the zero-based queue lengthvalue in word 75, and set bit 8 in word 76 to signal NCQ supportin the identify data for AHCI SATA drives.
Signed-off-by: Roland Elek <elek.roland@gmail.com>...
ide: Split out BMDMA code from ATA core
The ATA core is currently heavily intertwined with BMDMA code. Let's loosenthat a bit, so we can happily replace the DMA backend with differentimplementations.
Signed-off-by: Alexander Graf <agraf@suse.de>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
ide: split ide command interpretation off
The ATA command interpretation code can be used for PATA and SATAinterfaces alike. So let's split it out into a separate function.
Store IDE bus id in IDEBus structure for easy access.
Signed-off-by: Gleb Natapov <gleb@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
ide: convert bmdma address ioport to ioport_register()
cmd646, via compile tested, pci lightly boot tested.
Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
ide: Handle flush failure
Instead of always assuming success for bdrv_aio_flush, actually do somethingwith the error. This respects the werror option and accordingly ignores theerror, reports it to the guest or stops the VM and retries after cont.
Ignoring the error is trivial, obviously. For stopping the VM and retrying...
ide: fix migration in the middle of pio operation
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Revert "ide save/restore pio/atapi cmd transfer fields and io buffer"
This reverts commit ed487bb1d69040b9dac64a4fc076d8dd82b131d6.
The conflicts are due to commit 4fc8d6711aff7a9c11e402c3d77b481609f9f486that is a fix to the ide_drive_pre_save() function. It reverts both...
ide: Replace IDEState members is_cdrom, is_cf by drive_kind
The two aren't independent variables. Make that obvious.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
ide: Make ide_init_drive() return success
It still always succeeds. The next commits will add failures.
qdev: Decouple qdev_prop_drive from DriveInfo
Make the property point to BlockDriverState, cutting out the DriveInfomiddleman. This prepares the ground for block devices that don't havea DriveInfo.
Currently all user-defined ones have a DriveInfo, because the only way...
ide: Remove useless IDEDeviceInfo members unit, drive
ide: Remove redundant IDEState member conf
Commit 428c149b added IDEState member conf to let commit 0009baf1 findthe BlockConf from there. It exists only for qdev drives, created viaide_drive_initfn(), not for drives created via ide_init2().
But for a qdev drive, we can just as well reach its IDEDevice, which...
ide: Split non-qdev code off ide_init2()
ide: Turn drive serial into a qdev property ide-drive.serial
It needs to be a qdev property, because it belongs to the drive'sguest part.
Bonus: info qtree now shows the serial number.
cmd646: pass pci_dev as it needs it
Instead of doing tricks to get the pci_dev, just pass it in the 1stplace. Patch is a bit longer that reverting the pci_dev field, but itstates more clearly (IMHO) what we are doing.
It also fixes the bm test, now that you told me that ->unit is not...
ide save/restore pio/atapi cmd transfer fields and io buffer
Save/restore information necessary to continue in progress PIO/ATAPI CMDtransfers.
This includes the IO buffer.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
block: add topology qdev properties
Add three new qdev properties to export block topology information tothe guest. This is needed to get optimal I/O alignment for RAID arraysor SSDs.
The options are:
- physical_block_size to specify the physical block size of the device,...
ide: device version property
This patch adds a new property named 'ver' to ide-drive which allows tospecify the version which the virtual disk/cdrom should report to theguest. By default this is the qemu version (i.e. 0.12). usage:
-drive if=none,id=disk,file=......
workaround for cmd646 bmdma register access while no dma is active
This is a workaround only, and is a partial revertof a few changes to BMDMAState which removed pci_devfield on the way.
- cmd646 pci_from_bm() expects bm->unit value tocorrespond with bm data being passed to callback...
ide: Implement rerror option
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
IDE: Fix reset handling
Problem: x86 systems could not survive a few system_resets.
Clear most of IDE state when reset. Implement the missing reset handlers.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
ide: port pci ide to vmstate
ide: pre VMState functions are not needed anymore
ide: add VMSTATE_IDE_BUS and VMSTATE_IDE_DRIVES
ide: change identify_data type to uint8_t
It is used everywhere as uint8_t except in one place. Cast to uint16_tin that placeSigned-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
ide: BMDMAState don't need a pci_dev field anymore
Patchworks-ID: 35306Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
ide: Remove duplicated definitions
Patchworks-ID: 35297Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
switch ide bus to inplace allocation.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
ide/qdev: add ide bus.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
split away drive init from ide_init2()
This allows the ide bus being initialized without drives attachedand the drives being attached and initialization later on asseparate step.
ide: pass down DriveInfo instead of BlockDriverState
ide: move cmd+irq from IDEState to IDEBus.
These variables are per bus, not per drive. Lets move them andcleanup things a bit. And fix the cmd migration bug for real.
Fix gcc 3 warning: comparison is always true due to limited range of data type
ide: move code to hw/ide/