History | View | Annotate | Download (89.8 kB)
ide: set WCACHE supported in IDENTIFY data
ATA does not only have the WCACHE enabled bit in identify word 85, but alsoa WCACHE supported bit in word 82. While the Linux kernel is fine with thelatter at least hdparm also needs the former before correctly displaying...
ide: Factor ide_flush_cache out
The next patch reuses this code, so put it in its own function.
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: propagate the required alignment
IDE is a bit ugly in this respect. For one it doesn't really keep trackof a sector size - most of the protocol is in units of 512 bytes, and weassume 2048 bytes for CDROMs which is correct most of the time.
Second IDE allocates an I/O buffer long before we know if we're dealing...
Improve ATA IDENTIFY word 64 contents.
Fill in word 64 of IDENTIFY data to indicate support for PIO modes 3 and 4.This allows NetBSD guests to use UltraDMA modes instead of just PIO mode 0.
Signed-off-by: Jonathan A. Kollasch <jakllsch@kollasch.net>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Rearrange block headers
Changing block.h or blockdev.h resulted in recompiling most objects.
Move DriveInfo typedef and BlockInterfaceType enum definitionsto qemu-common.h and rearrange blockdev.h use to decrease churn.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Merge branch 'for-anthony' of git://repo.or.cz/qemu/kevin
Fix uint8_t comparisons with negative values
Fix the following warnings:/src/qemu/hw/ide/core.c: In function `ide_drive_pio_post_load':/src/qemu/hw/ide/core.c:2767: warning: comparison is always false due to limited range of data type
/src/qemu/ui/vnc-enc-tight.c: In function `tight_detect_smooth_image':...
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/atapi: add support for GET EVENT STATUS NOTIFICATION
The GET EVENT STATUS NOTIFICATION is a mandatory command accordingto MMC-3, even if event status notification is not supported.
This patch adds support for this command. It returns NEA ("No Event...
ide scsi virtio-blk: Reject empty drives unless media is removable
Disks without media make no sense. For SCSI, a Linux guest kernelcomplains during boot. I didn't try other combinations.
scsi-generic doesn't need the additional check, because it already...
ide: Reject readonly drives unless CD-ROM
drive_init() doesn't permit option readonly for if=ide, but that'sworthless: we get it via if=none and -device.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
ide: Reject invalid CHS geometry
drive_init() doesn't permit invalid CHS for if=ide, but that'sworthless: we get it via if=none and -device.
ide: Replace IDEState members is_cdrom, is_cf by drive_kind
The two aren't independent variables. Make that obvious.
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...
block: Fix virtual media change for if=none
BlockDriverState member removable controls whether virtual mediachange (monitor commands change, eject) is allowed. It is set whenthe "type hint" is BDRV_TYPE_CDROM or BDRV_TYPE_FLOPPY.
The type hint is only set by drive_init(). It sets BDRV_TYPE_FLOPPY...
block: Move error actions from DriveInfo to BlockDriverState
That's where they belong semantically (block device host part), eventhough the actions are actually executed by guest device code.
blockdev: Collect block device code in new blockdev.c
Anything that moves hundreds of lines out of vl.c can't be all bad.
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 ide_init1() off ide_init2()
ide: Change ide_init_drive() to require valid dinfo argument
IDEState members drive_serial_str and version are now left empty untilan actual drive is connected. Before, they got a default value thatwas overwritten when a drive got connected. Doesn't matter, because...
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.
ide: Fix ide_dma_cancel
When cancelling a request, bdrv_aio_cancel may decide that it waits forcompletion of a request rather than for cancellation. IDE therefore can'tabandon its DMA status before calling bdrv_aio_cancel; otherwise the callbackof a completed request would use invalid data....
ide: make a table 'const'
Fix build
Actually some systems don't define PAGE_SIZE. Fixes build breakageby f7736b91c40a617e93505e32dcbd2cb56aad8a23.
Compile ide/core only once
Make win2k install hack unconditional as it is still restricted tox86 only in vl.c.
Replace TARGET_PAGE_SIZE and 4096 with PAGE_SIZE.
block: Emit BLOCK_IO_ERROR before vm_stop() call
The next commit will move the STOP event into do_vm_stop(), tohave the expected event sequence we need to emit the I/O errorevent before calling vm_stop().
The expected sequence is:
{ "event": "BLOCK_IO_ERROR" [...] }...
Fix warning on mingw32
/src/qemu/hw/ide/core.c: In function 'ide_drive_pre_save':/src/qemu/hw/ide/core.c:2740: warning: comparison is always false due to limited range of data type
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>
ide: add topology support
Export the physical block size in the ATA IDENTIFY command. Theother topology values are not supported in ATA so skip them.
Signed-off-by: Christoph Hellwig <hch@lst.de>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: Generate BLOCK_IO_ERROR QMP event
Just call bdrv_mon_event() in the right place.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
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=......
ide: Use some already defined page macros instead of constants
Some PAGE constants were used instead of the macros we already havedefined in internal.h.
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
ide: implement stub for audio control/volume read
This implements the audio control or volume read support as needed bysome systems. A Conectiva Parolin system required this to detect an IDEdevice as CD-ROM, through the CDVOLREAD ioctl.
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>...
Rename DriveInfo.onerror to on_write_error
Either rename variables and functions to refer to write errors (which is whatthey actually do) or introduce a parameter to distinguish reads and writes.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
ide: Implement rerror option
scsi: move scsi-disk.h -> scsi.h
Signed-off-by: Gerd Hoffmann <kraxel@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.
ide: pre VMState functions are not needed anymore
ide: port ide_drive to vmstate
ide: port idebus to vmstate
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>
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.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Unexport ticks_per_sec variable. Create get_ticks_per_sec() function
block: add enable_write_cache flag
Add a enable_write_cache flag in the block driver state, and use it todecide if we claim to have a volatile write cache that needs controlledflushing from the guest. The flag is off if cache=writethrough isdefined because O_DSYNC guarantees that every write goes to stable...
ide: use bdrv_aio_flush
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.
ide: move code to hw/ide/