summary refs log tree commit diff stats
path: root/hw/qdev.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* qdev: factor out driver search to qdev_find_info()Gerd Hoffmann2009-07-161-7/+15
| | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qdev: rework device properties.Gerd Hoffmann2009-07-161-121/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. * The value in the property list and the value actually used by the device can't go out of sync any more (used to happen for the pci.devfn == -1 case) because there is only one place where the value is stored. * A record describing the property is required now, you can't set random properties any more. There are bus-specific and device-specific properties. The former should be used for properties common to all bus drivers. Typical use case is bus addressing, i.e. pci.devfn and i2c.address. Properties have a PropertyInfo struct attached with name, size and function pointers to parse and print properties. A few common property types have PropertyInfos defined in qdev-properties.c. Drivers are free to implement their own very special property parsers if needed. Properties can have default values. If unset they are zero-filled. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* Update to a hopefully more future proof FSF addressBlue Swirl2009-07-161-2/+1
| | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Don't leak VLANClientState on PCI hot removeMark McLoughlin2009-07-091-2/+3
| | | | | | | | | | | | | | | destroy_nic() requires that NICInfo::private by a PCIDevice pointer, but then goes on to require that the same pointer matches VLANClientState::opaque. That is no longer the case for virtio-net since qdev and wasn't previously the case for rtl8139, ne2k_pci or eepro100. Make the situation a lot more clear by maintaining a VLANClientState pointer in NICInfo. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* qdev: remove DeviceTypeGerd Hoffmann2009-07-091-23/+15
| | | | | | | | | The only purpose DeviceType serves is creating a linked list of DeviceInfo structs. This removes DeviceType and add a next field to DeviceInfo instead, so the DeviceInfo structs can be changed that way. Elimitates a pointless extra level of indirection. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* qdev: replace bus_type enum with bus_info struct.Gerd Hoffmann2009-07-091-38/+20
| | | | | | | | | | | | | | | BusInfo is filled with name and size (pretty much like I did for DeviceInfo as well). There is also a function pointer to print bus-specific device information to the monitor. sysbus is hooked up there, I've also added a print function for PCI. Device creation is slightly modified as well: The device type search loop now also checks the bus type while scanning the list instead of complaining thereafter in case of a mismatch. This effectively gives each bus a private namespace for device names. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Paul Brook <paul@codesourcery.com>
* qdev: move name+size into DeviceInfo (v2)Gerd Hoffmann2009-06-111-11/+7
| | | | | | | | Rationale: move device information from code to data structures. v2: Adapt the drivers missed in the first version. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* Merge branch 'net-queue'Anthony Liguori2009-06-101-4/+5
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * net-queue: (28 commits) virtio-net: Increase filter and control limits virtio-net: Add new RX filter controls virtio-net: MAC filter optimization virtio-net: Fix MAC filter overflow handling virtio-net: reorganize receive_filter() virtio-net: Use a byte to store RX mode flags virtio-net: Add version_id 7 placeholder for vnet header support virtio-net: implement rx packet queueing net: make use of async packet sending API in tap client net: add qemu_send_packet_async() net: split out packet queueing and flushing into separate functions net: return status from qemu_deliver_packet() net: add return value to packet receive handler net: pass VLANClientState* as first arg to receive handlers net: re-name vc->fd_read() to vc->receive() net: add fd_readv() handler to qemu_new_vlan_client() args net: only read from tapfd when we can send net: vlan clients with no fd_can_read() can always receive net: move the tap buffer into TAPState net: factor tap_read_packet() out of tap_send() ... Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
| * net: re-name vc->fd_read() to vc->receive()Mark McLoughlin2009-06-091-5/+5
| | | | | | | | | | | | | | | | | | VLANClientState's fd_read() handler doesn't read from file descriptors, it adds a buffer to the client's receive queue. Re-name the handlers to make things a little less confusing. Signed-off-by: Mark McLoughlin <markmc@redhat.com>
| * net: add fd_readv() handler to qemu_new_vlan_client() argsMark McLoughlin2009-06-091-3/+4
| | | | | | | | | | | | | | This, apparently, is the style we prefer - all VLANClientState should be an argument to qemu_new_vlan_client(). Signed-off-by: Mark McLoughlin <markmc@redhat.com>
* | Fix Sparse warningBlue Swirl2009-06-091-1/+1
|/ | | | Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* qdev: c99 initilaizers for bus_type_namesGerd Hoffmann2009-06-081-5/+5
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* Fix typoPaul Brook2009-06-061-1/+1
| | | | Signed-off-by: Paul Brook <paul@codesourcery.com>
* qdev: add monitor command to dump the tree.Gerd Hoffmann2009-06-051-0/+73
| | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Paul Brook <paul@codesourcery.com>
* Record device property typesPaul Brook2009-06-051-7/+32
| | | | | | | | | Record device property types, and provide a list of properties at device registration time. Add a "device" property type that holds a reference to annother device. Signed-off-by: Paul Brook <paul@codesourcery.com>
* qdev: kill DeviceState->nameGerd Hoffmann2009-06-041-2/+1
| | | | | | is redundant with DeviceState->type->name Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* Remove qdev irq sink handlingPaul Brook2009-05-261-13/+0
| | | | | | | We have both IRQ sinks and GPIO inputs. These are in principle exactly the same thing, so remove the former. Signed-off-by: Paul Brook <paul@codesourcery.com>
* Add common BusStatePaul Brook2009-05-231-36/+53
| | | | | | | | | | | Implement and use a common device bus state. The main side-effect is that creating a bus and attaching it to a parent device are no longer separate operations. For legacy code we allow a NULL parent, but that should go away eventually. Also tweak creation code to veriry theat a device in on the right bus. Signed-off-by: Paul Brook <paul@codesourcery.com>
* Consistently use uint64_t for int propertiesPaul Brook2009-05-171-2/+2
| | | | | | I apparently failed to do this properly on the first attempt. Signed-off-by: Paul Brook <paul@codesourcery.com>
* PCI network qdev conversionPaul Brook2009-05-141-0/+25
| | | | Signed-off-by: Paul Brook <paul@codesourcery.com>
* qdev scsi bus infrastructurePaul Brook2009-05-141-0/+19
| | | | Signed-off-by: Paul Brook <paul@codesourcery.com>
* qdev child bus supportPaul Brook2009-05-141-0/+30
| | | | Signed-off-by: Paul Brook <paul@codesourcery.com>
* Basic qdev infrastructure.Paul Brook2009-05-141-0/+237
Signed-off-by: Paul Brook <paul@codesourcery.com>