Statistics
| Branch: | Revision:

root / hw / qdev-properties.c @ cd8722bb

History | View | Annotate | Download (18.3 kB)

# Date Author Comment
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,...

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

449041d4 06/30/2010 11:58 pm Kevin Wolf

qdev-properties: Fix (u)intXX parsers

scanf calls must not use PRI constants, they have probably the wrong size and
corrupt memory. We could replace them by SCN ones, but strtol is simpler than
scanf here anyway. While at it, also fix the parsers to reject garbage after...

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

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

qdev: New qdev_prop_set_string()

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

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

qdev: Don't leak string property value on hot unplug

parse_string() qemu_strdup()s the property value. It is never freed.
It needs to be freed along with the device. Otherwise, the value of
scsi-disk property "ver" gets leaked when hot-unplugging the disk, for...

25920d6a 04/23/2010 05:08 pm Kevin Wolf

Make qemu-config available for tools

To be able to use config files for blkdebug, we need to make these functions
available in the tools. This involves moving two functions that can only be
built in the context of the emulator.

Signed-off-by: Kevin Wolf <>

9f59b566 03/27/2010 03:30 pm Markus Armbruster

error: Trim includes after "Move qemu_error & friends..."

Missed in commit 2f792016.

Signed-off-by: Markus Armbruster <>
Signed-off-by: Aurelien Jarno <>

fdcfa190 03/16/2010 06:45 pm Markus Armbruster

qdev: convert setting device properties to QError

036f7166 03/16/2010 06:01 pm Markus Armbruster

qdev: Hide "ptr" properties from users

Users can't set them, so qdev_device_help() shouldn't list them. Fix
that. Also make qdev_prop_parse() hide them instead of printing a
meaningless "has no parser" error message.

Their value means nothing to users, so qdev_print_props() shouldn't...

27f3f8a3 03/09/2010 04:47 pm Markus Armbruster

qdev: Catch attempt to attach more than one device to a netdev

Guest device and host netdev are peers, i.e. it's a 1:1 relation.
However, we fail to enforce that:

$ qemu -nodefaults --nographic -netdev user,id=net0 -device e1000,netdev=net0 -device virtio-net-pci,netdev=net0 -monitor stdio...
6bf38816 03/09/2010 04:47 pm Markus Armbruster

qdev: Improve diagnostics for bad property values

Property "vlan" reports "failed to parse" even when the value parses
just fine, but the result doesn't name an existing VLAN.

Similarly, properties "drive", "chr" and "netdev" misleadingly report
"failed to parse" when the value doesn't name an existing host device....

eecbb9fe 02/03/2010 08:39 pm Markus Armbruster

Revert "qdev: Add help for property value"

This reverts commit 922910ce42d15bdb7c2347436b1b5798b5401de4.

The commit has four issues:

  • When it runs from the monitor, e.g. "device_add e1000,mac=?", it
    prints to stderr instead of the monitor.
  • Help looks to callers just like failed device creation. This makes...
5137b6ac 02/03/2010 08:39 pm Markus Armbruster

Revert "qdev: Add help for device properties"

This reverts commit 2ba6edf0dd740166632df80caa85992b20791a68.

The commit has two issues:

  • When it runs from the monitor, e.g. "device_add e1000,?", it prints
    to stderr instead of the monitor.
  • Help looks to callers just like failed device creation. This makes...
2ba6edf0 01/26/2010 11:42 pm Stefan Weil

qdev: Add help for device properties

When called with property "?", a list of supported
properties will be printed (instead of an error message).

This is useful for command lines like
qemu -device e1000,?
and was already standard for other options like model=?...

922910ce 01/26/2010 11:42 pm Stefan Weil

qdev: Add help for property value

When called with property value "?",
a help text will be printed (instead of an error message).

This is useful for command lines like
qemu -device e1000,mac=?
and is already standard for other command line options....

dbd48324 01/12/2010 09:24 pm Michael S. Tsirkin

qdev: fix thinko leading to guest crashes

Without this fix, guest crashes with drive=virtio.

Signed-off-by: Michael S. Tsirkin <>
Signed-off-by: Anthony Liguori <>

d2364ee4 01/11/2010 09:40 pm Michael S. Tsirkin

qdev: add bit property type

This adds "bit" property type, which is a boolean stored in a 32 bit
integer field, with legal values on and off. Will be used by virtio for
feature bits.

Signed-off-by: Michael S. Tsirkin <>
Acked-by: Gerd Hoffmann <>...

9ef5c4bf 12/18/2009 07:26 pm Gerd Hoffmann

qdev: improve property error reporting.

Add a error message in case we fail to parse a qdev property.

Also make qemu not abort() in case setting a global property can't be
set. This used to be a clear programming error. The introduction of
the -global switch changed that though, so better exit instead (after...

07a8de35 12/12/2009 03:59 pm Gerd Hoffmann

qdev: also match bus name for global properties

i.e. -global PCI.<property>=<value> will set a default property for all
PCI devices. Also works for the compat properties used by machine
types.

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

458fb679 12/12/2009 03:59 pm Gerd Hoffmann

qdev: make compat stuff more generic

This patch renames the compat properties into global properties and
makes them more generic. The compatibility stuff is only one of
multiple possible users now.

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

d8ed79ae 10/27/2009 07:28 pm Gerd Hoffmann

qdev: add qdev_prop_exists()

Function test whenever a driver has a specific property.

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

1503fff3 10/27/2009 07:28 pm Gerd Hoffmann

qdev: mac addr property fixups

Make the mac property use the newly added type for the mac address.

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

2ef924b4 10/27/2009 07:28 pm Gerd Hoffmann

qdev: add netdev property

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

851bec09 10/27/2009 07:28 pm Gerd Hoffmann

qdev: add vlan property

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

59419663 10/21/2009 09:35 pm Gerd Hoffmann

qdev: add string property.

Patchworks-ID: 35755
Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Amit Shah <>
Signed-off-by: Anthony Liguori <>

41b5e892 10/05/2009 05:32 pm Gerd Hoffmann

qdev: don't crash on unset drive properties.

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

c7cc172d 10/05/2009 05:32 pm Juan Quintela

qdev: Add support for uint8_t

Signed-off-by: Juan Quintela <>
Signed-off-by: Anthony Liguori <>

06113719 09/11/2009 06:19 pm Gerd Hoffmann

qdev: add parser for chardev properties

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

316940b0 09/10/2009 06:47 pm Gerd Hoffmann

qdev: add property type for 32bit signed integers.

Signed-off-by: Gerd Hoffmann <>

73538c31 08/28/2009 10:12 pm Blue Swirl

Suppress kraxelisms

Signed-off-by: Blue Swirl <>

bc19fcaa 08/13/2009 07:26 pm Blue Swirl

Unbreak Sparc32 and PPC

Convert qdev ptr type to chr, allow a NULL pointer.

Signed-off-by: Blue Swirl <>

313feaab 08/10/2009 09:05 pm Gerd Hoffmann

qdev/prop: add CharDriverState property.

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

14b41872 08/10/2009 09:05 pm Gerd Hoffmann

qdev/prop: add drive property.

Adds a (host) drive property, intended to be used by virtual disk
backend drivers.

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

05cb5fe4 07/27/2009 04:39 pm Gerd Hoffmann

qdev/prop: add pci devfn property

So we can parse "$slot.$fn" strings into devfn numbers.

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

5a053d1f 07/21/2009 02:10 pm Blue Swirl

qdev: add 64 bit type

Signed-off-by: Blue Swirl <>

88e150a5 07/17/2009 08:48 pm Christoph Egger

isxdigit -> qemu_isxdigit

Hi!

Attached patch uses qemu_isxdigit() instead of isxdigit().
Fixes build warning on NetBSD.

Signed-off-by: Christoph Egger <>

--
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH...

b6b61144 07/17/2009 01:28 am Gerd Hoffmann

qdev/compat: compat property infrastructure.

This add support for switching devices into a compatibility mode
using device properties. Machine types can have a list of properties
for specific devices attached to allow the easy creation of machine
types compatible to older qemu versions....

ee6847d1 07/17/2009 01:28 am Gerd Hoffmann

qdev: rework device properties.

This patch is a major overhaul of the device properties. The properties
are saved directly in the device state struct now, the linked list of
property values is gone.

Advantages: * We don't have to maintain the list with the property values....