History | View | Annotate | Download (14.8 kB)
virtio-blk: Convert fprintf() to error_report()
Errors should be logged using error_report() so they go to theappropriate monitor.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
virtio-blk: Handle immediate flush failure properly
Fix virtio-blk to use the usual completion path that involves werror handlinginstead of directly completing the request in cases where bdrv_aio_flushreturns NULL.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
virtio-blk: Respect werror option for flushes
The werror option now affects not only write requests, but also flush requests.Previously, it was not possible to stop a VM on a failed flush.
virtio-blk: propagate the required alignment
Signed-off-by: Christoph Hellwig <hch@lst.de>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
trace: Trace virtio-blk, multiwrite, and paio_submit
This patch adds trace events that make it possible to observevirtio-blk.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
virtio-blk: Fix migration of queued requests
in_sg[].iovec and out_sg[].ioved are pointer to (source) host memory andtherefore invalid after migration. When loading the device state we mustcreate a new mapping on the destination host.
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>
virtio-blk: Create exit function to unregister savevm
Otherwise we can't migrate after we've removed a virtio block device.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
virtio-blk: Fix virtio-blk-s390 to require drive
Move the check from virtio_blk_init_pci(), where it protects onlyvirtio-blk-pci, to virtio_blk_init(). Without that, virtio-blk-s390initializes without a drive. I figure that can lead to null pointerdereferences....
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...
Merge remote branch 'kwolf/for-anthony' into staging
savevm: Add DeviceState param
When available, we'd like to be able to access the DeviceStatewhen registering a savevm. For buses with a get_dev_path()function, this will allow us to create more unique savevmid strings.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>...
Add virtio disk identification support
This patch adds the final missing bits for support ofpassing a serial/id string to a virtio-blk guest driver.
The guest-side component already exists in the virtiodriver, and has recently been reworked by Ryan to export...
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...
virtio-blk: fix the list operation in virtio_blk_load().
Although it is really rare to get in to the while loop, the listoperation in the loop is obviously wrong.
Signed-off-by: Yoshiaki Tamura <tamura.yoshiaki@lab.ntt.co.jp>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
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.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
virtio-blk: stop tracking old_bs
There is a 1:1 relation between VirtIOBlock and BlockDriverState instances,no need to track it because it won't change.
Signed-off-by: Christoph Hellwig <hch@lst.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
virtio-blk: simplify multiwrite calling conventions
Pass the MultiReqBuffer structure down all the way to the I/O submissioninstead of takin it apart. Also mark num_writes unsigned as it can'tgo negative, and take the check for any pending I/O requests into the...
blockdev: Collect block device code in new blockdev.c
Anything that moves hundreds of lines out of vl.c can't be all bad.
Cleanup: virtio-blk.c: Be more consistent using BDRV_SECTOR_SIZE instead
Clean up virtio-blk.c to be more consistent using BDRV_SECTOR_SIZEinstead of hard coded 512 values.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
virtio-blk: fix barrier support
Before issuing the barrier to the block driver we need to flush our oustandingqueue of write requests, as the flush is supposed to be issued after them.
virtio-blk: Avoid zeroing every request structure
The VirtIOBlockRequest structure is about 40 KB in size. This patchavoids zeroing every request by only initializing fields that are read.The other fields are either written to or may not be used at all....
Remove un-needed code
The bdrv_set_geometry_hint call below is not needed - it's just settingwhat was just read.
Signed-off-by: Bruce Rogers <brogers@novell.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
virtio-blk: Fix use after free in error case
virtio_blk_req_complete frees the request, so we can't access it any more whencalling bdrv_mon_event. Use the pointer that was copied earlier.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
block: add logical_block_size property
Add a logical block size attribute as various guest side tools onlyincrease the filesystem sector size based on it, not the advisoryphysical block size.
For scsi we already have support for a different logical block 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" [...] }...
virtio-blk: add topology support
Export all topology information in the block config structure,guarded by a new VIRTIO_BLK_F_TOPOLOGY feature flag.
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,...
virtio-blk: revert serial number support
The addition of the whole ATA IDENTIY page caused the config space togo above the allowed size in the PCI spec, and thus the feature wasalready reverted in the Linux guest driver and disabled by default inqemu....
virtio-blk: 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>
virtio-blk: Fix restart after read error
Current code assumes that only write requests are ever going to be restarted.This is wrong since rerror=stop exists. Instead of directly starting writes,use the same request processing as used for new requests....
virtio-blk: Fix error cases which ignored rerror/werror
If an I/O request fails right away instead of getting an error only in thecallback, we still need to consider rerror/werror.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
virtio_blk: Factor virtio_blk_handle_request out
We need a function that handles a single request. Create one by splitting outcode from virtio_blk_handle_output.
virtio-blk: remove dead variable in virtio_blk_handle_scsi
As pointed out by clang size is only ever written to, but never actuallyused.
virtio: add features as qdev properties
Add feature bits as properties to virtio. This makes it possible to e.g. definemachine without indirect buffer support, which is required for 0.10compatibility, or without hardware checksum support, which is required for 0.11...
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.
virtio-blk: Implement rerror option
virtio-blk: Pass read errors to the guest
We need to signal not only write errors, but also read errors to the guestdriver. This fixes a regression introduced by 869a5c6d.
Pass the drive's readonly attribute to the guest OS
Implemented for virtio-blk and for scsi
Signed-off-by: Naphtali Sprei <nsprei@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
drive cleanup fixes.
Changes: * drive_uninit() wants a DriveInfo now. * drive_uninit() also calls bdrv_delete(), so callers don't need to do that. * drive_uninit() calls are moved over to the ->exit() callbacks, destroy_bdrvs() is zapped. * setting bdrv->private is not needed any more as the...
qemu: make virtio-blk PCI compliant by default
commit bf011293faaa7f87e4de83185931e7411b794128 made virtio-blk-pci notPCI-compliant, since it makes region 0 (which is an i/o region)size > 256, and, since PCI 2.1, i/o regions are limited to 256 bytes size....
virtio-blk: add volatile writecache feature
Add a new VIRTIO_BLK_F_WCACHE feature to virtio-blk to indicate that we havea volatile write cache that needs controlled flushing. Implement aVIRTIO_BLK_T_FLUSH operation to flush it.
Signed-off-by: Christoph Hellwig <hch@lst.de>...
virtio-blk: Use bdrv_aio_multiwrite
It is quite common for virtio-blk to submit more than one write request in arow to the qemu block layer. Use bdrv_aio_multiwrite to allow block drivers tooptimize its handling of the requests.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>...
virtio-blk: handle NULL returns from bdrv_aio_{read, write}
The bdrv_aio_{read,write} routines can return a NULL pointer when theI/O submission fails. Currently we ignore this and will wait foreverfor an I/O completion and leading to a hang of the guest....
qdev-ify virtio-blk.
First user of the new drive property. With this patch applied hostand guest config can be specified separately, like this:
-drive if=none,id=disk1,file=/path/to/disk.img -device virtio-blk-pci,drive=disk1
You can set any property for virtio-blk-pci now. You can set the pci...
Fix VM state change handlers running out of order
When a VM state change handler changes VM state, other VM state changehandlers can see the state transitions out of order.
bmdma_map(), scsi_disk_init() and virtio_blk_init() install VM statechange handlers to restart DMA. These handlers can vm_stop() by...
Add serial number support for virtio_blk
[brought forward to current qemu-kvm.git]
This patch implements the missing qemu logic tointerpret a '-drive .. serial=XYZ ..' flag fora virtio_blk device.
The serial number string is contained in askeletal IDENTIFY DEVICE data structure and...
virtio blk: fix warning.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Avoid gcc 4.4 warning about uninitialized field
Separate virtio PCI code
Split the PCI host bindings from the VRing transport implementation.
Signed-off-by: Paul Brook <paul@codesourcery.com>
Virtio-blk qdev conversion
Virtio-net qdev conversion
virtio-blk: add SGI_IO passthru support
[had the qemu list address wrong the first time, reply to this message, not the previous if you were on Cc]
Add support for SG_IO passthru (packet commands) to the virtio-blkbackend. Conceptually based on an older patch from Hannes Reinecke...
virtio-blk: use generic vectored I/O APIs (Christoph Hellwig)
Use the generic bdrv_aio_readv/bdrv_aio_writev APIs instead of linearizingbuffers directly. This enables using the future native preadv/pwritevsupport.
qemu: record devfn on block driver instance (Marcelo Tosatti)
Record PCIDev on the BlockDriverState structure to locate for releaseon hot-removal.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>...
hw: remove error handling from qemu_malloc() callers (Avi Kivity)
Signed-off-by: Avi Kivity <avi@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6529 c046a42c-6fe2-441c-8c8c-71466251a162
Add and use #defines for PCI device classes
This patch adds and uses #defines for PCI device classes and subclases,using a new pci_config_set_class() function, similar to the recentlyadded pci_config_set_vendor_id() and pci_config_set_device_id().
Change since v1: fixed compilation of hw/sun4u.c...
Use the default subsystem vendor ID for virtio devices (Mark McLoughlin)
A subsystem vendor ID of zero isn't allowed, so we use ourdefault ID.
Gerd points out that although the PCI subsystem vendor ID istreated by the guest as the virtio vendor ID:
/* we use the subsystem vendor/device id as the virtio vendor/device...
Stop VM on error in virtio-blk. (Gleb Natapov)
Signed-off-by: Gleb Natapov <gleb@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6410 c046a42c-6fe2-441c-8c8c-71466251a162
pci: virtio: use pci id defines (Gerd Hoffman)
Use the defines added by the previous patch in the virtio drivers.Also remove the pointless vendor and device args from thevirtio_blk_init() function.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>...
Add virtio-blk support
Virtio-blk is a paravirtual block device based on VirtIO. It can be used byspecifying the if=virtio parameter to the -drive parameter.
When using -enable-kvm, it can achieve very good performance compared to IDE orSCSI.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>...