mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
tests/libqos: virtio-blk driver and interface nodes
Add qgraph nodes for virtio-blk-pci and virtio-blk-device. Both nodes produce virtio-blk, but virtio-blk-pci receives a pci-bus and uses virtio-pci QOSGraphObject and functions, while virtio-blk-device receives a virtio and implements its own functions Signed-off-by: Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
a25f56aebe
commit
a371349303
3 changed files with 165 additions and 0 deletions
40
tests/libqos/virtio-blk.h
Normal file
40
tests/libqos/virtio-blk.h
Normal file
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* libqos driver framework
|
||||
*
|
||||
* Copyright (c) 2018 Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License version 2 as published by the Free Software Foundation.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
#include "libqos/qgraph.h"
|
||||
#include "libqos/virtio.h"
|
||||
#include "libqos/virtio-pci.h"
|
||||
|
||||
typedef struct QVirtioBlk QVirtioBlk;
|
||||
typedef struct QVirtioBlkPCI QVirtioBlkPCI;
|
||||
typedef struct QVirtioBlkDevice QVirtioBlkDevice;
|
||||
|
||||
/* virtqueue is created in each test */
|
||||
struct QVirtioBlk {
|
||||
QVirtioDevice *vdev;
|
||||
};
|
||||
|
||||
struct QVirtioBlkPCI {
|
||||
QVirtioPCIDevice pci_vdev;
|
||||
QVirtioBlk blk;
|
||||
};
|
||||
|
||||
struct QVirtioBlkDevice {
|
||||
QOSGraphObject obj;
|
||||
QVirtioBlk blk;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue