summaryrefslogtreecommitdiffstats
path: root/blockdev.h
Commit message (Collapse)AuthorAgeFilesLines
* Introduce do_snapshot_blkdev() and monitor command to handle it.Jes Sorensen2010-12-171-0/+1
| | | | | | | | | | | The monitor command is: snapshot_blkdev <device> [snapshot-file] [format] Default format is qcow2. For now snapshots without a snapshot-file, eg internal snapshots, are not supported. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* scsi: Increase the number of possible devicesHannes Reinecke2010-11-251-1/+1
| | | | | | | | | | | | The SCSI parallel interface has a limit of 8 devices, but not the SCSI stack in general. So we should be removing the hard-coded limit and use MAX_SCSI_DEVS instead. And we only need to scan those devices which are allocated by the bus. Signed-off-by: Hannes Reinecke <hare@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* Implement drive_del to decouple block removal from device removalRyan Harper2010-11-241-0/+1
| | | | | | | | | | | | | | | | | | | | | Currently device hotplug removal code is tied to device removal via ACPI. All pci devices that are removable via device_del() require the guest to respond to the request. In some cases the guest may not respond leaving the device still accessible to the guest. The management layer doesn't currently have a reliable way to revoke access to host resource in the presence of an uncooperative guest. This patch implements a new monitor command, drive_del, which provides an explicit command to revoke access to a host block device. drive_del first quiesces the block device (qemu_aio_flush; bdrv_flush() and bdrv_close()). This prevents further IO from being submitted against the host device. Finally, drive_del cleans up pointers between the drive object (host resource) and the device object (guest resource). Signed-off-by: Ryan Harper <ryanh@us.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* blockdev: Use GCC_FMT_ATTR (format checking)Stefan Weil2010-10-031-8/+7
| | | | | | | | | | | | | Additional changes: * Removed 'extern' from drive_add (avoids too long line). * Removed 'extern' from other functions (makes declarations consistent with others in same header file). Cc: Blue Swirl <blauwirbel@gmail.com> Cc: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Rearrange block headersBlue Swirl2010-08-241-8/+2
| | | | | | | | | Changing block.h or blockdev.h resulted in recompiling most objects. Move DriveInfo typedef and BlockInterfaceType enum definitions to qemu-common.h and rearrange blockdev.h use to decrease churn. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* blockdev: drive_get_by_id() is no longer used, removeMarkus Armbruster2010-07-021-1/+0
| | | | | Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* blockdev: Clean up automatic drive deletionMarkus Armbruster2010-07-021-0/+4
| | | | | | | | | | | | | | | | | | | | | We automatically delete blockdev host parts on unplug of the guest device. Too much magic, but we can't change that now. The delete happens early in the guest device teardown, before the connection to the host part is severed. Thus, the guest part's pointer to the host part dangles for a brief time. No actual harm comes from this, but we'll catch such dangling pointers a few commits down the road. Clean up the dangling pointers by delaying the automatic deletion until the guest part's pointer is gone. Device usb-storage deliberately makes two qdev properties refer to the same drive, because it automatically creates a second device. Again, too much magic we can't change now. Multiple references worked okay before, but now free_drive() dies for the second one. Zap the extra reference. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* blockdev: New drive_get_by_blockdev()Markus Armbruster2010-07-021-0/+1
| | | | | Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* blockdev: Remove drive_get_serial()Markus Armbruster2010-07-021-1/+0
| | | | | | | Unused since commit 6ced55a5. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* blockdev: Give drives internal linkageMarkus Armbruster2010-06-151-2/+0
| | | | | | | | This is the list of drives defined with drive_init(). Hide it, so it doesn't get abused. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* block: Move error actions from DriveInfo to BlockDriverStateMarkus Armbruster2010-06-151-10/+0
| | | | | | | | That's where they belong semantically (block device host part), even though 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>
* blockdev: Collect block device code in new blockdev.cMarkus Armbruster2010-06-041-0/+71
Anything that moves hundreds of lines out of vl.c can't be all bad. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
OpenPOWER on IntegriCloud