From 311e666aea7164b6d3b8a7e845fb32a509bfdf08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Mar=C3=AD?= Date: Mon, 1 Sep 2014 12:07:54 +0200 Subject: tests: Functions bus_foreach and device_find from libqos virtio API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Virtio header has been changed to compile and work with a real device. Functions bus_foreach and device_find have been implemented for PCI. Virtio-blk test case now opens a fake device. Reviewed-by: Stefan Hajnoczi Signed-off-by: Marc MarĂ­ Signed-off-by: Stefan Hajnoczi --- tests/libqos/virtio-pci.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/libqos/virtio-pci.h (limited to 'tests/libqos/virtio-pci.h') diff --git a/tests/libqos/virtio-pci.h b/tests/libqos/virtio-pci.h new file mode 100644 index 0000000000..5101abb0ec --- /dev/null +++ b/tests/libqos/virtio-pci.h @@ -0,0 +1,24 @@ +/* + * libqos virtio PCI definitions + * + * Copyright (c) 2014 Marc MarĂ­ + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ + +#ifndef LIBQOS_VIRTIO_PCI_H +#define LIBQOS_VIRTIO_PCI_H + +#include "libqos/virtio.h" +#include "libqos/pci.h" + +typedef struct QVirtioPCIDevice { + QVirtioDevice vdev; + QPCIDevice *pdev; +} QVirtioPCIDevice; + +void qvirtio_pci_foreach(QPCIBus *bus, uint16_t device_type, + void (*func)(QVirtioDevice *d, void *data), void *data); +QVirtioPCIDevice *qvirtio_pci_device_find(QPCIBus *bus, uint16_t device_type); +#endif -- cgit v1.2.3