Statistics
| Branch: | Revision:

root / blockdev.h @ efdef95f

History | View | Annotate | Download (2.1 kB)

# Date Author Comment
84fb3925 02/07/2011 01:51 pm Marcelo Tosatti

blockdev: add refcount to DriveInfo

The host part of a block device can be deleted with in progress
block migration.

To fix this, add a reference count to DriveInfo, freeing resources
on last reference.

Signed-off-by: Marcelo Tosatti <>...

319ae529 01/31/2011 12:59 pm Markus Armbruster

blockdev: Fix drive_add for drives without media

Watch this:

(qemu) drive_add 0 if=none
(qemu) info block
none0: type=hd removable=0 [not inserted]
(qemu) drive_del none0
Segmentation fault (core dumped)

add_init_drive() is confused about drive_init()'s failure modes, and...

5645b0f4 01/31/2011 12:57 pm Markus Armbruster

blockdev: Replace drive_add()'s fmt, ... by optstr parameter

Let the callers build the optstr. Only one wants to. All the others
become simpler, because they don't have to worry about escaping '%'.

Signed-off-by: Markus Armbruster <>
Signed-off-by: Kevin Wolf <>

f1bd51ac 01/31/2011 12:17 pm Markus Armbruster

blockdev: New drive_get_by_index()

Signed-off-by: Markus Armbruster <>
Signed-off-by: Kevin Wolf <>

2292ddae 01/31/2011 11:59 am Markus Armbruster

blockdev: Make drive_add() take explicit type, index parameters

Before, type & index were hidden in printf-like fmt, ... parameters,
which get expanded into an option string. Rather inconvenient for
uses later in this series.

New IF_DEFAULT to ask for the machine's default interface. Before,...

27d6bf40 01/31/2011 11:42 am Markus Armbruster

blockdev: Fix regression in -drive if=scsi,index=N

Before commit 622b520f, index=12 meant bus=1,unit=5.

Since the commit, it means bus=0,unit=12. The drive is created, but
not the guest device. That's because the controllers we use with
if=scsi drives (lsi53c895a and esp) support only 7 units, and...

904ebffe 01/31/2011 11:24 am Markus Armbruster

blockdev: Move BlockInterfaceType from qemu-common.h to blockdev.h

Signed-off-by: Markus Armbruster <>
Signed-off-by: Kevin Wolf <>

13839974 01/31/2011 11:24 am Markus Armbruster

blockdev: New drive_get_next(), replacing qdev_init_bdrv()

qdev_init_bdrv() doesn't belong into qdev.c; it's about drives, not
qdevs. Rename to drive_get_next, move to blockdev.c, drop the bogus
DeviceState argument, and return DriveInfo instead of
BlockDriverState....

6d4a2b3a 01/31/2011 11:03 am Christoph Hellwig

block: add block_resize monitor command

Add a monitor command that allows resizing of block devices while
qemu is running. It uses the existing bdrv_truncate method already
used by qemu-img to do it's work. Compared to qemu-img the size
parsing is very simplicistic, but I think having a properly numering...

f8882568 12/17/2010 05:11 pm Jes Sorensen

Introduce do_snapshot_blkdev() and monitor command to handle it.

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 <>...

622b520f 11/25/2010 12:57 pm Hannes Reinecke

scsi: Increase the number of possible devices

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...

9063f814 11/24/2010 06:30 pm Ryan Harper

Implement drive_del to decouple block removal from device removal

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...

6ea421fe 10/03/2010 09:37 am Stefan Weil

blockdev: Use GCC_FMT_ATTR (format checking)

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 <>...

2446333c 08/24/2010 06:22 pm Blue Swirl

Rearrange block headers

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 <>

dfb0acd8 07/02/2010 02:18 pm Markus Armbruster

blockdev: drive_get_by_id() is no longer used, remove

Signed-off-by: Markus Armbruster <>
Signed-off-by: Kevin Wolf <>

0c6f9c17 07/02/2010 02:18 pm Markus Armbruster

blockdev: Remove drive_get_serial()

Unused since commit 6ced55a5.

Signed-off-by: Markus Armbruster <>
Signed-off-by: Kevin Wolf <>

e4700e59 07/02/2010 02:18 pm Markus Armbruster

blockdev: New drive_get_by_blockdev()

Signed-off-by: Markus Armbruster <>
Signed-off-by: Kevin Wolf <>

14bafc54 07/02/2010 02:18 pm Markus Armbruster

blockdev: Clean up automatic drive deletion

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...

abd7f68d 06/15/2010 10:41 am Markus Armbruster

block: Move error actions from DriveInfo to BlockDriverState

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 <>
Signed-off-by: Kevin Wolf <>

c9b62a7e 06/15/2010 10:41 am Markus Armbruster

blockdev: Give drives internal linkage

This is the list of drives defined with drive_init(). Hide it, so it
doesn't get abused.

Signed-off-by: Markus Armbruster <>
Signed-off-by: Kevin Wolf <>

666daa68 06/04/2010 04:20 pm Markus Armbruster

blockdev: Collect block device code in new blockdev.c

Anything that moves hundreds of lines out of vl.c can't be all bad.

Signed-off-by: Markus Armbruster <>
Signed-off-by: Kevin Wolf <>