History | View | Annotate | Download (9 kB)
qdev: make compat stuff more generic
This patch renames the compat properties into global properties andmakes them more generic. The compatibility stuff is only one ofmultiple possible users now.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qdev: move DO_UPCAST() into osdep.h
Nothing qdev specific about this, make it available throughtout.
Signed-off-by: Mark McLoughlin <markmc@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
usb core: use qdev for -usbdevice
This patchs adds infrastructure to handle -usbdevice via qdev callbacks.USBDeviceInfo gets a name field (for the -usbdevice driver name) and acallback for -usbdevice parameter parsing.
The new usbdevice_create() function walks the qdev driver list and looks...
zap DeviceState->nd
No users left.Also cleanup obsolete helper functions.
qdev: add qdev_prop_exists()
Function test whenever a driver has a specific property.
qdev: mac addr property fixups
Make the mac property use the newly added type for the mac address.
qdev: add netdev property
qdev: add vlan property
qdev: add string property.
Patchworks-ID: 35755Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Amit Shah <amit.shah@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Suppress warnings about 'warn_unused_result' attribute directive
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Warn if value of qdev_init() isn't checked
After qdev_init() fails, the device is gone. Failure to check runs ahigh risk of use-after-free.
Patchworks-ID: 35166Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
New qdev_init_nofail()
Like qdev_init(), but terminate program via hw_error() instead ofreturning an error value.
Use it instead of qdev_init() where terminating the program on failureis okay, either because it's during machine construction, or because...
qemu/qdev: type safety in reset handler
Add type safety to qdev reset handlers, by declaring them asDeviceState * rather than void *.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
store a pointer to QemuOpts in DeviceState, release it when zapping a device.
qdev: device free fixups.
Two bug fixes: * When freeing a device we unregister even stuff we didn't register in the first place because the ->init() callback failed. * When freeing a device with child busses attached, we fail to zap the child bus (and the devices attached to it)....
Add exit callback to DeviceInfo.
This adds a exit callback for device destruction to DeviceInfo, sowe can hook cleanups into qdev device destruction.
Followup patches will put that into use.
qdev hotplug: infrastructure and monitor commands.
Adds device_add and device_del commands. device_add accepts acceptsthe same syntax like the -device command line switch. device_delexpects a device id. So you should tag your devices with ids if you...
allow qdev busses allocations be inplace
qdev: Add support for uint8_t
Signed-off-by: Juan Quintela <quintela@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Fix spelling in comment
replace Convery -> Convert
Cc: Paul Brook <paul@codesourcery.com>Signed-off-by: Stefan Weil <weil@mail.berlios.de>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Fix sys-queue.h conflict for good
Problem: Our file sys-queue.h is a copy of the BSD file, but there aresome additions and it's not entirely compatible. Because of that, there havebeen conflicts with system headers on BSD systems. Some hacks have beenintroduced in the commits 15cc9235840a22c289edbe064a9b3c19c5f49896,...
qdev: add property type for 32bit signed integers.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
qdev: integrate reset
qdev: integrate vmstate
qdev/scsi: add scsi bus support to qdev, convert drivers.
Adding scsi disks via -device works now, i.e. you can do:
-drive id=sda,if=none,......
qdev: add return value to init() callbacks.
Sorry folks, but it has to be. One more of these invasive qdev patches.
We have a serious design bug in the qdev interface: device initcallbacks can't signal failure because the init() callback has noreturn value. This patch fixes it....
move useful type definitons to osdep.h
Fix virtio-blk
Reported-by: Christoph HellwigSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
rename "info qdrv" to "info qdm"
As requested by avi: driver != device model.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Message-Id:
qdev/prop: add CharDriverState property.
qdev/prop: macros for creating typechecked properties.
There are DEFINE_PROP_$TYPE macros foreach property type. These macros link the qdev_prop_$name struct to thetype used by that property. typeof(struct->field) is verifyed to be the...
QemuOpts: switch over -device.
Make -device switch use the QemuOpts framework.Everything should continue to work like it did before.
New: "-set device.$id.$property=$value" works.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>...
qdev/prop: add drive property.
Adds a (host) drive property, intended to be used by virtual diskbackend drivers.
qdev/core: add monitor command to list all drivers
qdev/prop: add pci devfn property
So we can parse "$slot.$fn" strings into devfn numbers.
qdev: create default bus names.
Create a default bus name if none is passed to qbus_create().
If the parent device has DeviceState->id set it will be used to createthe bus name,. i.e. -device lsi,id=foo will give you a scsi bus named"foo.0".
If there is no id BusInfo->name (lowercased) will be used instead, i.e....
qdev: bus walker + qdev_device_add()
This patch implements a parser and qdev tree walker for bus paths andadds qdev_device_add on top of this.
A bus path can be: (1) full path, i.e. /i440FX-pcihost/pci.0/lsi/scsi.0 (2) bus name, i.e. "scsi.0". Best used together with id= to make...
qdev: add 64 bit type
Suppress a Sparse warning
Move the export to a file used by both qdev.c and sysbus.c.
qdev: add user-specified identifier to devices.
Add id field to DeviceState. Make "info qtree" print it.
This helps users and management apps identifying devices in monitoroutput, which is especially useful with otherwise identical devicessuch as two virtio disks....
qdev/compat: compat property infrastructure.
This add support for switching devices into a compatibility modeusing device properties. Machine types can have a list of propertiesfor specific devices attached to allow the easy creation of machinetypes compatible to older qemu versions....
qdev: add no_user, alias and desc
no_user: prevent users from adding certain devices.desc: description of the device.alias: to allow user friendly shortcuts on the command line, i.e. -device usbmouse instead of -device "QEMU USB Mouse" or -device lsi instead of -device lsi53c895a...
qdev: rework device properties.
This patch is a major overhaul of the device properties. The propertiesare saved directly in the device state struct now, the linked list ofproperty values is gone.
Advantages: * We don't have to maintain the list with the property values....
qdev: replace bus_type enum with bus_info struct.
BusInfo is filled with name and size (pretty much like I did forDeviceInfo as well). There is also a function pointer to printbus-specific device information to the monitor. sysbus is hookedup there, I've also added a print function for PCI....
qdev: remove DeviceType
The only purpose DeviceType serves is creating a linked list ofDeviceInfo structs. This removes DeviceType and add a next field toDeviceInfo instead, so the DeviceInfo structs can be changed that way.Elimitates a pointless extra level of indirection....
qdev: move name+size into DeviceInfo (v2)
Rationale: move device information from code to data structures.
v2: Adapt the drivers missed in the first version.
qdev: add monitor command to dump the tree.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Paul Brook <paul@codesourcery.com>
Record device property types
Record device property types, and provide a list of properties at deviceregistration time.
Add a "device" property type that holds a reference to annother device.
Signed-off-by: Paul Brook <paul@codesourcery.com>
qdev: kill DeviceState->name
is redundant with DeviceState->type->name
Remove qdev irq sink handling
We have both IRQ sinks and GPIO inputs. These are in principle exactlythe same thing, so remove the former.
Add common BusState
Implement and use a common device bus state. The main side-effect isthat creating a bus and attaching it to a parent device are no longerseparate operations. For legacy code we allow a NULL parent, but thatshould go away eventually....
Consistently use uint64_t for int properties
I apparently failed to do this properly on the first attempt.
qdev scsi bus infrastructure
PCI network qdev conversion
Basic qdev infrastructure.
qdev child bus support