aboutsummaryrefslogtreecommitdiff
path: root/tests/virtio-net-test.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2016-06-20 15:07:56 +0100
committerPeter Maydell <peter.maydell@linaro.org>2016-06-20 15:07:56 +0100
commitfd2590bccc0bd63833813592a3e193686cf1c623 (patch)
tree2be06d9fe8553ef621282a2f068b133e160eeec7 /tests/virtio-net-test.c
parent5edbd4e30426d3a0d712510b2509a521e35192b1 (diff)
parent5ab4b69ce29908b327a91966dc78ea0fd7424075 (diff)
Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging
# gpg: Signature made Mon 20 Jun 2016 15:05:24 BST # gpg: using RSA key 0x9CA4ABB381AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35 775A 9CA4 ABB3 81AB 73C8 * remotes/stefanha/tags/block-pull-request: backup: follow AioContext change gracefully mirror: follow AioContext change gracefully blockjob: add AioContext attached callback block: use safe iteration over AioContext notifiers blockjob: add block_job_get_aio_context() blockjob: add pause points blockjob: rename block_job_is_paused() blockjob: move iostatus reset out of block_job_enter() block: process before_write_notifiers in bdrv_co_discard block: fix race in bdrv_co_discard with drive-mirror block: fixed BdrvTrackedRequest filling in bdrv_co_discard libqos: add qvirtqueue_cleanup() libqos: drop duplicated virtio_pci.h definitions libqos: drop duplicated virtio_scsi.h definitions libqos: drop duplicated virtio_blk.h definitions libqos: drop duplicated virtio_vring.h structs libqos: drop duplicated virtio_ring.h bit definitions libqos: drop duplicated virtio_config.h definitions libqos: drop duplicated PCI vendor ID definition libqos: use virtio_ids.h for device ID definitions Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'tests/virtio-net-test.c')
-rw-r--r--tests/virtio-net-test.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/virtio-net-test.c b/tests/virtio-net-test.c
index e5c144818e..0d2c63f8ab 100644
--- a/tests/virtio-net-test.c
+++ b/tests/virtio-net-test.c
@@ -20,6 +20,8 @@
#include "libqos/malloc-generic.h"
#include "qemu/bswap.h"
#include "hw/virtio/virtio-net.h"
+#include "standard-headers/linux/virtio_ids.h"
+#include "standard-headers/linux/virtio_ring.h"
#define PCI_SLOT_HP 0x06
#define PCI_SLOT 0x04
@@ -39,9 +41,9 @@ static QVirtioPCIDevice *virtio_net_pci_init(QPCIBus *bus, int slot)
{
QVirtioPCIDevice *dev;
- dev = qvirtio_pci_device_find(bus, QVIRTIO_NET_DEVICE_ID);
+ dev = qvirtio_pci_device_find(bus, VIRTIO_ID_NET);
g_assert(dev != NULL);
- g_assert_cmphex(dev->vdev.device_type, ==, QVIRTIO_NET_DEVICE_ID);
+ g_assert_cmphex(dev->vdev.device_type, ==, VIRTIO_ID_NET);
qvirtio_pci_device_enable(dev);
qvirtio_reset(&qvirtio_pci, &dev->vdev);
@@ -69,8 +71,8 @@ static void driver_init(const QVirtioBus *bus, QVirtioDevice *dev)
features = qvirtio_get_features(bus, dev);
features = features & ~(QVIRTIO_F_BAD_FEATURE |
- QVIRTIO_F_RING_INDIRECT_DESC |
- QVIRTIO_F_RING_EVENT_IDX);
+ (1u << VIRTIO_RING_F_INDIRECT_DESC) |
+ (1u << VIRTIO_RING_F_EVENT_IDX));
qvirtio_set_features(bus, dev, features);
qvirtio_set_driver_ok(bus, dev);
@@ -227,7 +229,7 @@ static void pci_basic(gconstpointer data)
/* End test */
close(sv[0]);
- guest_free(alloc, tx->vq.desc);
+ qvirtqueue_cleanup(&qvirtio_pci, &tx->vq, alloc);
pc_alloc_uninit(alloc);
qvirtio_pci_device_disable(dev);
g_free(dev);