mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 14:53:54 -06:00
tests/libqos: virtio-pci driver and interface nodes
Add QOSGraphObject to QVirtioPCIDevice structure, with a basic constructor. virtio-pci is not present in qgraph, since it will be used as starting point by its subclasses (virtio-*-pci) Signed-off-by: Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
b026393c34
commit
1ce66ecec0
4 changed files with 99 additions and 28 deletions
|
@ -12,8 +12,10 @@
|
|||
|
||||
#include "libqos/virtio.h"
|
||||
#include "libqos/pci.h"
|
||||
#include "libqos/qgraph.h"
|
||||
|
||||
typedef struct QVirtioPCIDevice {
|
||||
QOSGraphObject obj;
|
||||
QVirtioDevice vdev;
|
||||
QPCIDevice *pdev;
|
||||
QPCIBar bar;
|
||||
|
@ -31,11 +33,23 @@ typedef struct QVirtQueuePCI {
|
|||
|
||||
extern const QVirtioBus qvirtio_pci;
|
||||
|
||||
void virtio_pci_init(QVirtioPCIDevice *dev, QPCIBus *bus, QPCIAddress * addr);
|
||||
QVirtioPCIDevice *virtio_pci_new(QPCIBus *bus, QPCIAddress * addr);
|
||||
QVirtioPCIDevice *qvirtio_pci_device_find(QPCIBus *bus, uint16_t device_type);
|
||||
QVirtioPCIDevice *qvirtio_pci_device_find_slot(QPCIBus *bus,
|
||||
uint16_t device_type, int slot);
|
||||
void qvirtio_pci_device_free(QVirtioPCIDevice *dev);
|
||||
|
||||
/* virtio-pci object functions available for subclasses that
|
||||
* override the original start_hw and destroy
|
||||
* function. All virtio-xxx-pci subclass that override must
|
||||
* take care of calling these two functions in the respective
|
||||
* places
|
||||
*/
|
||||
void qvirtio_pci_destructor(QOSGraphObject *obj);
|
||||
void qvirtio_pci_start_hw(QOSGraphObject *obj);
|
||||
|
||||
|
||||
void qvirtio_pci_device_enable(QVirtioPCIDevice *d);
|
||||
void qvirtio_pci_device_disable(QVirtioPCIDevice *d);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue