History | View | Annotate | Download (136 Bytes)
qdev: Split up header so it can be used in cpu.h
Header file dependency is a frickin' nightmare right now. cpu.h tendsto get included in our 'include everything' header files but qdev alsoneeds to include those headers mainly for qdev-properties since it knows...
vl.c: convert *vga_enabled functions to QOM
And get rid of qdev_exists().
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
net: Rename VLANClientState to NetClientState
The vlan feature is no longer part of net core. Rename VLANClientStateto NetClientState because net clients are not explicitly associated witha vlan at all, instead they have a peer net client to which they are...
net: Remove VLANState
VLANState is no longer used and can be removed.
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>Signed-off-by: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>Reviewed-by: Laszlo Ersek <lersek@redhat.com>
net: Convert qdev_prop_vlan to peer with hub
Instead of using VLANState use net/hub.h to support the vlan qdevproperty. The vlan qdev property becomes an alias for the peer qdevproperty but is represented as a VLAN ID number. When a VLAN ID isselected the device will really peer with a hub port....
qdev: Fix Open Firmware comment
Commit 0d936928ef87ca1bb7b41b5b89c400c699a7691c removed code,but left the related comment at a location where it no longerbelongs to.
The patch moves the comment to the correct callback and improves the text.
Signed-off-by: Stefan Weil <sw@weilnetz.de>...
Merge remote-tracking branch 'kwolf/for-anthony' into staging
constify value pointer for qdev_prop_set_string
qdev_prop_set_string uses object_property_set_str, which takesa const char * for the value. Lets propagate the constnessinto qdev_prop_set_string.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>...
qdev: New property type chs-translation
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qdev-properties: Introduce pci-host-devaddr.
This new property will be used to specify a host pci device address.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>Acked-by: Michael S. Tsirkin <mst@redhat.com>Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
qdev: Remove qdev_prop_set_defaults
Instead, qdev_property_add_static can set the default.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
qdev: Use wrapper for qdev_get_path
This makes it easier to remove it from BusInfo.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>[AF: Drop now unnecessary NULL initialization in scsibus_get_dev_path()]...
qdev: Convert busses to QEMU Object Model
This is far less interesting than it sounds. We simply add an Object to eachBusState and then register the types appropriately. Most of the interestingrefactoring will follow in the next patches.
Since we're changing fundamental type names (BusInfo -> BusClass), it all needs...
qbus: Make child devices links
Make qbus children show up as link<> properties. There is no stableaddressing for qbus children so we use an unstable naming convention.
This is okay in QOM though because the composition name is expected tobe what's stable....
qdev: Remove qdev_prop_exists()
Can be replaced everywhere with object_property_find().
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
qdev: Move bus properties to abstract superclasses
In qdev, each bus in practice identified an abstract superclass, butthis was mostly hidden. In QOM, instead, these abstract classes areexplicit so we can move bus properties there.
All bus property walks are removed, and all device property walks...
qdev: Use int32_t container for devfn property
Valid range for devfn is -1 to 255 (-1 for automatic assignment). We donot currently validate this due to devfn being stored as a uint32_t.This can lead to segfaults and other strange behavior.
We could technically just cast it to int32_t to implement the checking,...
qdev: Remove PropertyInfo range checking
Range checking in PropertyInfo is now used only for pci_devfnproperties and some error reporting. Remove all code that implementsit in the various property types, and the now unused fields.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
Merge remote-tracking branch 'qmp/queue/qmp' into staging
qdev: qdev_unplug(): use error_set()
It currently uses qerror_report(), but next commit will convertthe drive_del command to the QAPI and this requires usingerror_set().
One particularity of qerror_report() is that it knows when it'srunning on monitor context or command-line context and prints the...
qdev: add blocksize property type
Storage interfaces like virtio-blk can be configured with block sizeinformation so that the guest can take advantage of efficient I/Orequest sizes.
According to the SCSI Block Commands (SBC) standard a device's blocksize is "almost always greater than one byte and may be a multiple of...
qdev: put all devices under /machine
Avoid cluttering too much the QOM root.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qdev: let QOM free properties
Drop the special free callback. Instead, register a "regular" release method in the non-legacy property.
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
qdev: access properties via QOM
Do not poke anymore in the struct when accessing qdev properties.Instead, ask the object to set the right value.
qdev: initialize properties via QOM
Similarly, use the object properties also to set the defaultvalues of the qdev properties. This requires reorderingregistration and initialization.
qdev: remove unused fields from PropertyInfo
qdev: remove print/parse methods from LostTickPolicy properties
Also generalize the code so that we can have more enum propertiesin the future.
qdev: refactor away qdev_create_from_info
Note that the FIXME gets fixed in series 4/4. We need to convert BusState toQOM before we can make parent_bus a link.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qdev: split out UI portions into a new function
qdev-monitor.c deals with the -device, device_add, and info qdm/qtreeinterfaces.
qdev: nuke qdev_init_chardev()
I'm sure the intentions were good here, but there's no reason this should be inqdev. Move it to qemu-char where it belongs.
qom: move properties from qdev to object
This is mostly code movement although not entirely. This makes properties partof the Object base class which means that we can now start using Object in ameaningful way outside of qdev.
qdev: remove baked in notion of aliases (v2)
Limit them to the device_add functionality. Device aliases were a hack basedon the fact that virtio was modeled the wrong way. The mechanism for aliasingis very limited in that only one alias can exist for any device....
qdev: kill off DeviceInfo list
Teach the various bits of code that need to walk through available devices todo so via QOM.
Signed-off-by: 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 thenrebased it into a single step which avoids repeatedly touching every file inthe tree.
The first step was a sed-based addition of the parent type to the subclass...
qdev: kill off DeviceInfo
It is no longer used in the tree since everything is done natively throughQEMU Object Model.
qdev: remove info from class
Now DeviceInfo is no longer used after object construction. All of therelevant members have been moved to DeviceClass.
qdev: make DeviceInfo private
Introduce accessors and remove any code that directly accesses DeviceInfomembers.
qdev: Introduce lost tick policy property
Potentially tick-generating timer devices will gain a common property:lock_tick_policy. It allows to encode 4 different ways how to deal withtick events the guest did not process in time:
discard - ignore lost ticks (e.g. if the guest compensates for them...
qdev: use a wrapper to access reset and promote reset to a class method
qdev: add a interface to register subclasses
In order to introduce inheritance while still using the qdev registrationinterfaces, we need to be able to use a parent other than TYPE_DEVICE. Add anew interface that allows this.
qdev: add class_init to DeviceInfo
Since we are still dynamically creating TypeInfo, we need to chain theclass_init function in order to be able to make use of it within subclasses ofTYPE_DEVICE.
This will disappear once we register TypeInfos directly....
qdev: don't access name through info
We already have a QOM interface for this so let's use it.
qdev: move qdev->info to class
Right now, DeviceInfo acts as the class for qdev. In order to switch to aproper ObjectClass derivative, we need to ween all of the callers off ofinteracting directly with the info pointer.
qdev: integrate with QEMU Object Model (v2)
This is a very shallow integration. We register a TYPE_DEVICE but only useQOM as basically a memory allocator. This will make all devices show up asQOM objects but they will all carry the TYPE_DEVICE.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>...
vga: improve VGA logic
Improve VGA selection logic, push check for device availabilty to vl.c.Create the devices at board level unconditionally.
Remove now unused pci_try_create*() functions.
Make PCI VGA devices optional.
Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>...
qdev: fix hotplug when no -device is specified
The peripheral[-anon] containers are initialized lazily but since they sit onsysbus, they can not be created after realize. This was causing an abort() tooccur during hotplug if no -device option was used....
qom: introduce get/set methods for Property
This patch adds a visitor interface to Property. This way, QOM will beable to expose Properties that access a fixed field in a struct withoutexposing also the everything-is-a-string "feature" of qdev properties....
qom: distinguish "legacy" property type name from QOM type name
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qom: register qdev properties also as non-legacy properties
Push legacy properties into a "legacy-..." namespace, and make themavailable with correct types too.
For now, all properties come in both variants. This need not be thecase for string properties. We will revisit this after -device is...
qom: interpret the return value when setting legacy properties
qom: optimize qdev_get_canonical_path using a parent link
The full tree search was a bit unreasonable.
qom: add string property type
qdev: add a qdev_get_type() function and expose as a 'type' property
qdev: provide a path resolution (v2)
There are two types of supported paths--absolute paths and partial paths.
Absolute paths are derived from the root device and can follow child<> orlink<> properties. Since they can follow link<> properties, they can be...
qom: add child properties (composition) (v3)
Child properties express a relationship of composition.
qom: add link properties (v2)
Links represent an ephemeral relationship between devices. They are meant toreplace the qdev concept of busses by allowing more informal relationshipsbetween devices.
Links are fairly limited in their usefulness without implementing QOM-style...
qom: add a reference count to qdev objects
To ensure that a device isn't removed from the graph until all of its links arebroken.
qom: add new dynamic property infrastructure based on Visitors (v2)
qdev properties are settable only during construction and static to classes.This isn't flexible enough for QOM.
This patch introduces a property interface for qdev that provides dynamic...
qom: register legacy properties as new style properties (v2)
Expose all legacy properties through the new QOM property mechanism. The qdevproperty types are exposed through the 'legacy<>' namespace. They are alwaysvisited as strings since they do their own string parsing....
qom: introduce root device
This is based on Jan's suggestion for how to do unique naming. The root deviceis the root of composition. All devices are reachable via child<> links fromthis device.
qdev: provide an interface to return canonical path from root (v2)
The canonical path is the path in the composition tree from the root to thedevice. This is effectively the name of the device.
This is an incredibly unefficient implementation that will be optimized in...
qdev: switch children device list to QTAILQ
SCSI buses will need to read the children list first-to-last. Thisrequires using a QTAILQ, because hell breaks loose if you just tryinserting at the tail (thus reversing the order of all existingvisits from last-to-first to first-to-tail)....
scsi: remove devs array from SCSIBus
Change the devs array into a linked list, and add a scsi_device_findfunction to navigate the children list instead. This lets the SCSIbus use more complex addressing, and HBAs can talk to the correct devicewhen there are multiple LUNs per target....
qdev: Add HEX8 property
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Reviewed-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
qdev: add creation function that may fail
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
blockdev: New drive_get_next(), replacing qdev_init_bdrv()
qdev_init_bdrv() doesn't belong into qdev.c; it's about drives, notqdevs. Rename to drive_get_next, move to blockdev.c, drop the bogusDeviceState argument, and return DriveInfo instead ofBlockDriverState....
qdev: Track runtime machine modifications
Create a trivial interface to track whether the machine has beenmodified since boot. Adding or removing devices will trigger thisto return true. An example usage scenario for such an interface isthe rtl8139 driver which includes a cpu_register_io_memory() value...
qdev: export qdev_find_recursive() for later use
This patch exports qdev_find_recursive() for later use.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
qdev: remove an unused function
qbus_reset_all is unused, remove it
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
qbus: register reset handler for qbus whose parent is NULL
Stefan Weil reported the regression caused byec990eb622ad46df5ddcb1e94c418c271894d416 as follows
The second regression also occurs with MIPS malta.Networking no longer works with the default pcnet nic....
Add bootindex parameter to net/block/fd device
If bootindex is specified on command line a string that describes devicein firmware readable way is added into sorted list. Later this list willbe passed into firmware to control boot order.
Signed-off-by: Gleb Natapov <gleb@redhat.com>...
Introduce new BusInfo callback get_fw_dev_path.
New get_fw_dev_path callback will be used for build device path usableby firmware in contrast to qdev qemu internal device path.
Signed-off-by: Gleb Natapov <gleb@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Introduce fw_name field to DeviceInfo structure.
Add "fw_name" to DeviceInfo to use in device path building. Incontrast to "name" "fw_name" should refer to functionality deviceprovides instead of particular device model like "name" does.
qbus: add functions to walk both devices and busses
There are some cases where you want to walk the busses, in particular, whensearching for a bus either by name or DeviceInfo.Paolo suggested that we model the return values on how GCC's walkers work which...
qdev: reset qdev along with qdev tree
This patch changes the reset handling so that qdev has no knowledge of theglobal system reset. Instead, a new bus/device level function is introducedthat allows all devices/buses on the bus/device to be reset using a depth...
qdev: introduce reset call back for qbus level
and make it called via qbus_reset_all().The qbus reset callback will be used by pci bus reset.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
qdev: trigger reset from a given device
Introduce a helper function which triggers reset from a given device.Will be used by pci bus emulation.
Rearrange block headers
Changing block.h or blockdev.h resulted in recompiling most objects.
Move DriveInfo typedef and BlockInterfaceType enum definitionsto qemu-common.h and rearrange blockdev.h use to decrease churn.
qdev: implement qdev_prop_set_bit().
implement qdev_prop_set_bit().
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
qdev: Add a get_dev_path() function to BusInfo
This function is meant to provide a stable device path for buseswhich are able to implement it. If a bus has a globally uniqueaddresses scheme, one address level may be sufficient to providea path. Other buses may need to recursively traverse up the...
qdev: Decouple qdev_prop_drive from DriveInfo
Make the property point to BlockDriverState, cutting out the DriveInfomiddleman. This prepares the ground for block devices that don't havea DriveInfo.
Currently all user-defined ones have a DriveInfo, because the only way...
block: Catch attempt to attach multiple devices to a blockdev
For instance, -device scsi-disk,drive=foo -device scsi-disk,drive=foohappily 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,...
blockdev: Collect block device code in new blockdev.c
Anything that moves hundreds of lines out of vl.c can't be all bad.
qdev: Move declaration of qdev_init_bdrv() into qdev.h
qdev: New qdev_prop_set_string()
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 ofscsi-disk property "ver" gets leaked when hot-unplugging the disk, for...
vmstate: Add support for alias ID
Some legacy users (mostly PC devices) of vmstate_register manageinstance IDs on their own, and that unfortunately in a way that isincompatible with automatically generated ones. This so far preventsswitching those users to vmstates that are registered by qdev....
Make qemu-config available for tools
To be able to use config files for blkdebug, we need to make these functionsavailable in the tools. This involves moving two functions that can only bebuilt in the context of the emulator.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
monitor: convert do_device_del() to QObject, QError
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
monitor: convert do_device_add() to QObject
qdev: Add a DEV_NVECTORS_UNSPECIFIED enum for unspecified nr of MSI vectors
net.c used a constant to signify no MSI vectors were specified. Extendthat to all qdev devices.
Signed-off-by: Amit Shah <amit.shah@redhat.com>Reported-by: "Michael S. Tsirkin" <mst@redhat.com>...
qdev: Fix exit code for -device ?
Help was shoehorned into device creation, qdev_device_add(). Sincehelp doesn't create a device, it returns NULL, which looks to callersjust like failed device creation. Monitor handler do_device_add()doesn't care, but main() exits unsuccessfully....
qdev: add bit property type
This adds "bit" property type, which is a boolean stored in a 32 bitinteger field, with legal values on and off. Will be used by virtio forfeature bits.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>Acked-by: Gerd Hoffmann <kraxel@redhat.com>...
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: add netdev property
qdev: add vlan property