This allows flexibility to be reused for all kinds of command line
used by other tests.
Signed-off-by: Jason Wang <address@hidden>
---
tests/virtio-net-test.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/tests/virtio-net-test.c b/tests/virtio-net-test.c
index 231e7c767e..33d26ab079 100644
--- a/tests/virtio-net-test.c
+++ b/tests/virtio-net-test.c
@@ -51,17 +51,20 @@ static QVirtioPCIDevice *virtio_net_pci_init(QPCIBus *bus,
int slot)
return dev;
}
-static QOSState *pci_test_start(int socket)
+static QOSState *pci_test_start(const char *cmd, ...)
@@ -218,11 +221,13 @@ static void pci_basic(gconstpointer data)
QVirtQueue *tvq,
int socket) = data;
int sv[2], ret;
+ const char *cmd = "-netdev socket,fd=%d,id=hs0 -device "
+ "virtio-net-pci,netdev=hs0";
ret = socketpair(PF_UNIX, SOCK_STREAM, 0, sv);
g_assert_cmpint(ret, !=, -1);
- qs = pci_test_start(sv[1]);
+ qs = pci_test_start(cmd, sv[1]);