Statistics
| Branch: | Revision:

root / hw / ide / qdev.c @ a8aec295

History | View | Annotate | Download (8.3 kB)

# Date Author Comment
0ee20e66 05/08/2013 04:28 pm Kevin Wolf

ahci: Don't allow creating slave drives

An IDE bus provided by AHCI can only take a single IDE drive. If you add
a drive as slave, qemu used to accept the command line but the device
wouldn't be actually usable. Catch the situation instead and error out....

0d09e41a 04/08/2013 07:13 pm Paolo Bonzini

hw: move headers to include/

Many of these should be cleaned up with proper qdev-/QOM-ification.
Right now there are many catch-all headers in include/hw/ARCH depending
on cpu.h, and this makes it necessary to compile these files per-target.
However, fixing this does not belong in these patches....

215e47b9 02/22/2013 10:29 pm Paolo Bonzini

blockdev: enable discard by default

Because discard is now a host parameter, we can always fake it as enabled
in the guest. This is an extension of the current choice to ignore
"not supported" errors from the host when discard_granularity is set
to nonzero....

8c43a6f0 01/10/2013 11:11 pm Andreas Färber

Make all static TypeInfos const

Since 39bffca2030950ef6efe57c2fac8327a45ae1015 (qdev: register all
types natively through QEMU Object Model), TypeInfo as used in
the common, non-iterative pattern is no longer amended with information
and should therefore be const....

9c17d615 12/19/2012 09:32 am Paolo Bonzini

softmmu: move include files to include/sysemu/

Signed-off-by: Paolo Bonzini <>

1de7afc9 12/19/2012 09:32 am Paolo Bonzini

misc: move include files to include/qemu/

Signed-off-by: Paolo Bonzini <>

a5cf8262 10/05/2012 03:58 pm Jim Meyering

scsi, pci, qdev, isa-bus, sysbus: don't let *_get_fw_dev_path return NULL

Use g_strdup rather than strdup, because the sole caller
(qdev_get_fw_dev_path_helper) assumes it gets non-NULL, and dereferences
it. Besides, in that caller, the allocated buffer is already freed with...

b2df4314 08/06/2012 11:39 pm Markus Armbruster

ide scsi: Mess with geometry only for hard disk devices

Legacy -drive cyls=... are now ignored completely when the drive
doesn't back a hard disk device. Before, they were first checked
against a hard disk's limits, then ignored.

Signed-off-by: Markus Armbruster <>...

2adc99b2 07/17/2012 05:48 pm Markus Armbruster

hd-geometry: Compute BIOS CHS translation in one place

Currently, it is split between hd_geometry_guess() and
pc_cmos_init_late(). Confusing. info qtree shows the result of the
former. Also confusing.

Fold the part done in pc_cmos_init_late() into hd_geometry_guess()....

911525db 07/17/2012 05:48 pm Markus Armbruster

hw/block-common: Factor out fall back to legacy -drive serial=...

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

b7eb0c9f 07/17/2012 05:48 pm Markus Armbruster

hw/block-common: Factor out fall back to legacy -drive cyls=...

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

ba801960 07/17/2012 05:48 pm Markus Armbruster

ide: qdev properties for disk geometry

Geometry needs to be qdev properties, because it belongs to the
disk's guest part.

Maintain backward compatibility exactly like for serial: fall back to
DriveInfo's geometry, set with -drive cyls=...

Do this only for ide-hd. ide-drive is legacy. ide-cd doesn't have a...

6e6f61a6 07/17/2012 05:48 pm Markus Armbruster

ide: qdev property for BIOS CHS translation

This isn't quite orthodox. CHS translation is firmware configuration,
communicated via the RTC's CMOS RAM, not a property of the disk. But
it's best to treat it just like geometry anyway.

Maintain backward compatibility exactly like for geometry: fall back...

9dc13e38 07/17/2012 05:48 pm Markus Armbruster

ide pc: Put hard disk info into CMOS only for hard disks

In particular, don't set disk type and geometry when a CD-ROM on bus
ide.0 has media during CMOS initialization.

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

9139046c 07/17/2012 05:48 pm Markus Armbruster

ide pc: Cut out the block layer geometry middleman

PC BIOS setup needs IDE geometry information. Get it directly from
the device model rather than through the block layer. In preparation
of purging geometry from the block layer, which will happen later in...

0d936928 06/18/2012 04:14 pm Anthony Liguori

qdev: Convert busses to QEMU Object Model

This is far less interesting than it sounds. We simply add an Object to each
BusState and then register the types appropriately. Most of the interesting
refactoring will follow in the next patches.

Since we're changing fundamental type names (BusInfo -> BusClass), it all needs...

3cb75a7c 06/18/2012 04:14 pm Paolo Bonzini

qdev: Move bus properties to a separate global

Simple code movement in order to simplify future refactoring.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Andreas Färber <>

bce54474 06/18/2012 04:14 pm Paolo Bonzini

qdev: Move bus properties to abstract superclasses

In qdev, each bus in practice identified an abstract superclass, but
this was mostly hidden. In QOM, instead, these abstract classes are
explicit so we can move bus properties there.

All bus property walks are removed, and all device property walks...

27e0c9a1 04/05/2012 03:54 pm Floris Bos

ide: Add "model=s" qdev option

Allow the user to override the default disk model name "QEMU HARDDISK".

Some Linux distributions use the /dev/disk/by-id/scsi-SATA_name-of-disk-
model_serial addressing scheme when refering to partitions in /etc/fstab
and elsewhere. This causes problems when starting a disk image taken from...

95ebda85 04/05/2012 03:54 pm Floris Bos

ide: Adds wwn=hex qdev option

Allow the user to specify a disk's World Wide Name.

Linux guests can address disks by their unique World Wide Name number
(e.g. /dev/disk/by-id/wwn-0x5001517959123522). This patch adds support
for assigning a World Wide Name number to a virtual IDE disk....

83f7d43a 02/15/2012 05:39 pm Andreas Färber

qom: Unify type registration

Replace device_init() with generalized type_init().

While at it, unify naming convention: type_init([$prefix_]register_types)
Also, type_init() is a function, so add preceding blank line where
necessary and don't put a semicolon after the closing brace....

39bffca2 02/03/2012 06:41 pm Anthony Liguori

qdev: register all types natively through QEMU Object Model

This was done in a mostly automated fashion. I did it in three steps and then
rebased it into a single step which avoids repeatedly touching every file in
the tree.

The first step was a sed-based addition of the parent type to the subclass...

d307af79 02/03/2012 06:41 pm Anthony Liguori

qdev: kill off DeviceInfo

It is no longer used in the tree since everything is done natively through
QEMU Object Model.

Signed-off-by: Anthony Liguori <>

d148211c 01/27/2012 06:50 pm Anthony Liguori

ide: convert to QEMU Object Model

Signed-off-by: Anthony Liguori <>

7267c094 08/21/2011 07:01 am Anthony Liguori

Use glib memory allocation and free functions

qemu_malloc/qemu_free no longer exist after this commit.

Signed-off-by: Anthony Liguori <>

e0e8384d 07/23/2011 07:21 pm Markus Armbruster

ide: Turn properties any IDE device must have into bus properties

Signed-off-by: Markus Armbruster <>
Signed-off-by: Anthony Liguori <>

d353fb72 06/15/2011 03:36 pm Christoph Hellwig

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.

Signed-off-by: Christoph Hellwig <>
Signed-off-by: Kevin Wolf <>

95b5edcd 05/19/2011 11:26 am Markus Armbruster

blockdev: Store -drive option media in DriveInfo

DriveInfo is closely tied to -drive, and like -drive, it mixes
information about host and guest part of the block device. Unlike
DriveInfo, BlockDriverState should be about the host part only.

One of the remaining guest bits there is the "type hint". -drive...

1f56e32a 05/19/2011 11:26 am Markus Armbruster

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 the
associated BlockDriverState's type hint. Unclean; disk vs. CD belongs
to the guest part, not the host part.

Have separate qdevs "ide-hd" and "ide-cd" to model disk vs. CD in...

1ca4d09a 12/11/2010 11:32 pm Gleb Natapov

Add bootindex parameter to net/block/fd device

If bootindex is specified on command line a string that describes device
in firmware readable way is added into sorted list. Later this list will
be passed into firmware to control boot order.

Signed-off-by: Gleb Natapov <>...

dc1a46b6 12/11/2010 11:27 pm Gleb Natapov

Add get_fw_dev_path callback to IDE bus.

Signed-off-by: Gleb Natapov <>
Signed-off-by: Blue Swirl <>

3835510f 12/11/2010 11:27 pm Gleb Natapov

Store IDE bus id in IDEBus structure for easy access.

Signed-off-by: Gleb Natapov <>
Signed-off-by: Blue Swirl <>

779206de 12/11/2010 11:27 pm Gleb Natapov

Introduce fw_name field to DeviceInfo structure.

Add "fw_name" to DeviceInfo to use in device path building. In
contrast to "name" "fw_name" should refer to functionality device
provides instead of particular device model like "name" does.

Signed-off-by: Gleb Natapov <>...

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

f597627f 07/06/2010 06:05 pm Markus Armbruster

ide: Improve error messages

Use error_report(), because it points to the error location.

Reword "tried to assign twice" messages to make it clear that we're
complaining about the unit property.

Report invalid unit property instead of failing silently.
...

c4d74df7 07/06/2010 06:05 pm Markus Armbruster

ide: Make ide_init_drive() return success

It still always succeeds. The next commits will add failures.

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

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

qdev: Decouple qdev_prop_drive from DriveInfo

Make the property point to BlockDriverState, cutting out the DriveInfo
middleman. This prepares the ground for block devices that don't have
a DriveInfo.

Currently all user-defined ones have a DriveInfo, because the only way...

18846dee 07/02/2010 02:18 pm Markus Armbruster

block: Catch attempt to attach multiple devices to a blockdev

For instance, -device scsi-disk,drive=foo -device scsi-disk,drive=foo
happily creates two SCSI disks connected to the same block device.
It's all downhill from there.

Device usb-storage deliberately attaches twice to the same blockdev,...

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

pc: Fix CMOS info for drives defined with -device

Drives defined with drive if=ide get get created along with the IDE
controller, inside machine
>init(). That's before cmos_init().
Drives defined with -device get created during generic device init.
That's after cmos_init(). Because of that, CMOS has no information on...

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

ide: Make it explicit that ide_create_drive() can't fail

All callers of ide_create_drive() ignore its value. Currently
harmless, because it fails only when qdev_init() fails, which fails
only when ide_drive_initfn() fails, which never fails.

Brittle. Change it to die instead of silently ignoring failure....

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

57dac7ef 06/04/2010 12:43 pm Markus Armbruster

ide: Remove redundant IDEState member conf

Commit 428c149b added IDEState member conf to let commit 0009baf1 find
the BlockConf from there. It exists only for qdev drives, created via
ide_drive_initfn(), not for drives created via ide_init2().

But for a qdev drive, we can just as well reach its IDEDevice, which...

6ced55a5 06/04/2010 12:43 pm Markus Armbruster

ide: Turn drive serial into a qdev property ide-drive.serial

It needs to be a qdev property, because it belongs to the drive's
guest part.

Bonus: info qtree now shows the serial number.

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

03432407 06/04/2010 12:43 pm Markus Armbruster

ide: Fix info qtree for ide-drive.ver

Show the actual default value instead of <null> when the property has
not been set.

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

428c149b 02/11/2010 12:53 am Christoph Hellwig

block: add topology qdev properties

Add three new qdev properties to export block topology information to
the guest. This is needed to get optimal I/O alignment for RAID arrays
or SSDs.

The options are:

- physical_block_size to specify the physical block size of the device,...
47c06340 01/20/2010 12:31 am Gerd Hoffmann

ide: device version property

This patch adds a new property named 'ver' to ide-drive which allows to
specify the version which the virtual disk/cdrom should report to the
guest. By default this is the qemu version (i.e. 0.12). usage:

-drive if=none,id=disk,file=......
5c17ca25 10/07/2009 04:54 pm Markus Armbruster

Clean up test for qdev_init() failure

Some callers test for != 0, some for < 0. Normalize to < 0.

Patchworks-ID: 35171
Signed-off-by: Markus Armbruster <>
Signed-off-by: Anthony Liguori <>

1f850f10 10/05/2009 05:32 pm Gerd Hoffmann

switch ide bus to inplace allocation.

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>

da4d0419 09/15/2009 10:23 pm Gerd Hoffmann

ide/qdev: add ide bus.

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Blue Swirl <>