Skip to contentSkip to conversation

qtests and misc patches

GIT PULL Thomas Huth 2 participants 11 messages Sep 5, 2019

lore
Share & tools
lore
#0 lore raw

Hi Peter,

the following changes since commit a8b5ad8e1faef0d1bb3e550530328e8ec76fe87c:

Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging (2019-09-04 17:22:34 +0100)

are available in the Git repository at:

https://gitlab.com/huth/qemu.git tags/pull-request-2019-09-05

for you to fetch changes up to 7bb21c0ac301e423b483dd7fc171b0d7b56de2cf:

qemu-doc: Do not hard-code the name of the QEMU binary (2019-09-05 09:45:09 +0200)

----------------------------------------------------------------
- Make the core libqtest library independent from global_qtest
- Clean up docs from hard-coded qemu-system-* names
----------------------------------------------------------------

Thomas Huth (8):
tests/migration: Do not use functions anymore that rely on global_qtest tests/libqos/e1000e: Make e1000e libqos functions independent from global_qtest tests/libqos: Replace clock_step with qtest_clock_step in virtio code
tests: Remove unnecessary global_qtest references
tests/libqtest: Move global_test wrapper function into a separate header tests/libqtest: Use libqtest-single.h in tests that require global_qtest tests/vm: Take the J=x setting into account for the vm-boot-ssh targets, too
qemu-doc: Do not hard-code the name of the QEMU binary

 MAINTAINERS                   |   2 +-
 docs/qemu-block-drivers.texi  |  72 +++++-----
 docs/qemu-cpu-models.texi     |  10 +-
 qemu-doc.texi                 |  81 +++++------
 qemu-options.hx               | 128 ++++++++---------
 tests/ahci-test.c             |   1 -
 tests/bios-tables-test.c      |   1 -
 tests/cpu-plug-test.c         |   2 +-
 tests/display-vga-test.c      |   2 +-
 tests/e1000e-test.c           |   2 +-
 tests/fdc-test.c              |   2 +-
 tests/i440fx-test.c           |   2 +-
 tests/i82801b11-test.c        |   2 +-
 tests/intel-hda-test.c        |   2 +-
 tests/ioh3420-test.c          |   2 +-
 tests/ipmi-kcs-test.c         |   3 +-
 tests/ivshmem-test.c          |   3 -
 tests/libqos/e1000e.c         |  16 ++-
 tests/libqos/virtio-mmio.c    |  14 +-
 tests/libqos/virtio-pci.c     |  14 +-
 tests/libqos/virtio.c         |  20 +--
 tests/libqos/virtio.h         |   6 +-
 tests/libqtest-single.h       | 315 ++++++++++++++++++++++++++++++++++++++++++
 tests/libqtest.c              |  13 --
 tests/libqtest.h              | 289 --------------------------------------
 tests/m25p80-test.c           |   2 +-
 tests/migration-test.c        |   6 +-
 tests/qos-test.c              |   2 +-
 tests/rtas-test.c             |   1 -
 tests/rtc-test.c              |   2 +-
 tests/rtl8139-test.c          |   2 +-
 tests/test-arm-mptimer.c      |   2 +-
 tests/test-netfilter.c        |   2 +-
 tests/test-x86-cpuid-compat.c |   2 +-
 tests/tmp105-test.c           |   2 +-
 tests/tpm-crb-test.c          |   2 +-
 tests/tpm-tests.c             |   2 +-
 tests/tpm-tis-test.c          |   2 +-
 tests/usb-hcd-ohci-test.c     |   2 +-
 tests/usb-hcd-uhci-test.c     |   2 +-
 tests/usb-hcd-xhci-test.c     |   2 +-
 tests/vhost-user-test.c       |   2 +-
 tests/virtio-blk-test.c       |   5 +-
 tests/virtio-ccw-test.c       |   2 +-
 tests/virtio-net-test.c       |   2 +-
 tests/virtio-scsi-test.c      |   2 +-
 tests/virtio-serial-test.c    |   2 +-
 tests/vm/Makefile.include     |   1 +
 48 files changed, 546 insertions(+), 509 deletions(-)
 create mode 100644 tests/libqtest-single.h
#1 lore raw

[Qemu-devel] [PULL 5/8] tests/libqtest: Move global_test wrapper function into a separate header

We want libqtest.h to become completely independent from global_qtest (so that the wrapper functions are not used by accident anymore). As a first step, move the wrapper functions into a separate header file.

The new header is only included from libqtest.h for now, so that there is no difference to the users of libqtest.h yet. In the next patch, we will switch this, so that the users of the global_qtest-related functions will be using libqtest-single.h directly and libqtest.h becomes completely independent of this.

Message-Id: <[email protected]>

---
 MAINTAINERS             |   2 +-
 tests/libqtest-single.h | 311 ++++++++++++++++++++++++++++++++++++++++
 tests/libqtest.c        |  11 --
 tests/libqtest.h        | 287 +-----------------------------------
 4 files changed, 313 insertions(+), 298 deletions(-)
 create mode 100644 tests/libqtest-single.h
MAINTAINERS +1 -1
index c4c90f732d..65d8a7c2d2 100644
@@ -2079,7 +2079,7 @@ R: Paolo Bonzini <[email protected]>
 S: Maintained
 F: qtest.c
 F: accel/qtest.c
-F: tests/libqtest.*
+F: tests/libqtest*
 F: tests/libqos/
 F: tests/*-test.c
 
tests/libqtest-single.h new file +311 -0

311 lines not on this page · raw message

tests/libqtest.c +0 -11
index 2713b86cf7..e5101d9d3a 100644
@@ -1106,17 +1106,6 @@ void qtest_memset(QTestState *s, uint64_t addr, uint8_t pattern, size_t size)
     qtest_rsp(s, 0);
 }
 
-QDict *qmp(const char *fmt, ...)
-{
-    va_list ap;
-    QDict *response;
-
-    va_start(ap, fmt);
-    response = qtest_vqmp(global_qtest, fmt, ap);
-    va_end(ap);
-    return response;
-}
-
 void qtest_qmp_assert_success(QTestState *qts, const char *fmt, ...)
 {
     va_list ap;
tests/libqtest.h +1 -286

299 lines not on this page · raw message

Signature · 1 line
2.18.1
#2 lore raw

[Qemu-devel] [PULL 3/8] tests/libqos: Replace clock_step with qtest_clock_step in virtio code

In reply to Thomas Huth

Library functions should not rely on functions that require global_qtest (since they might get used in tests that deal with multiple states). Commit 1999a70a05ad603d ("Make generic virtio code independent from global_qtest") already tried to clean the libqos virtio code, but I missed to replace the clock_step() function. Thus change it now to qtest_clock_step() instead.
The logic of the qvirtio_wait_config_isr() function is now pushed to the virtio-mmio.c and virtio-pci.c files instead, since we can get the QTestState here easily.

Message-Id: <[email protected]>

---
 tests/libqos/virtio-mmio.c | 14 +++++++++++++-
 tests/libqos/virtio-pci.c  | 14 +++++++++++++-
 tests/libqos/virtio.c      | 20 ++++++--------------
 tests/libqos/virtio.h      |  6 +++---
 tests/virtio-blk-test.c    |  3 ++-
 5 files changed, 37 insertions(+), 20 deletions(-)
tests/libqos/virtio-mmio.c +13 -1
index 5f37b51129..d0047876a8 100644
@@ -101,6 +101,18 @@ static bool qvirtio_mmio_get_config_isr_status(QVirtioDevice *d)
     return false;
 }
 
+static void qvirtio_mmio_wait_config_isr_status(QVirtioDevice *d,
+                                                gint64 timeout_us)
+{
+    QVirtioMMIODevice *dev = container_of(d, QVirtioMMIODevice, vdev);
+    gint64 start_time = g_get_monotonic_time();
+
+    do {
+        g_assert(g_get_monotonic_time() - start_time <= timeout_us);
+        qtest_clock_step(dev->qts, 100);
+    } while (!qvirtio_mmio_get_config_isr_status(d));
+}
+
 static void qvirtio_mmio_queue_select(QVirtioDevice *d, uint16_t index)
 {
     QVirtioMMIODevice *dev = container_of(d, QVirtioMMIODevice, vdev);
@@ -179,7 +191,7 @@ const QVirtioBus qvirtio_mmio = {
     .get_status = qvirtio_mmio_get_status,
     .set_status = qvirtio_mmio_set_status,
     .get_queue_isr_status = qvirtio_mmio_get_queue_isr_status,
-    .get_config_isr_status = qvirtio_mmio_get_config_isr_status,
+    .wait_config_isr_status = qvirtio_mmio_wait_config_isr_status,
     .queue_select = qvirtio_mmio_queue_select,
     .get_queue_size = qvirtio_mmio_get_queue_size,
     .set_queue_address = qvirtio_mmio_set_queue_address,
tests/libqos/virtio-pci.c +13 -1
index 3f55c047a0..50499e75ef 100644
@@ -175,6 +175,18 @@ static bool qvirtio_pci_get_config_isr_status(QVirtioDevice *d)
     }
 }
 
+static void qvirtio_pci_wait_config_isr_status(QVirtioDevice *d,
+                                               gint64 timeout_us)
+{
+    QVirtioPCIDevice *dev = container_of(d, QVirtioPCIDevice, vdev);
+    gint64 start_time = g_get_monotonic_time();
+
+    do {
+        g_assert(g_get_monotonic_time() - start_time <= timeout_us);
+        qtest_clock_step(dev->pdev->bus->qts, 100);
+    } while (!qvirtio_pci_get_config_isr_status(d));
+}
+
 static void qvirtio_pci_queue_select(QVirtioDevice *d, uint16_t index)
 {
     QVirtioPCIDevice *dev = container_of(d, QVirtioPCIDevice, vdev);
@@ -257,7 +269,7 @@ const QVirtioBus qvirtio_pci = {
     .get_status = qvirtio_pci_get_status,
     .set_status = qvirtio_pci_set_status,
     .get_queue_isr_status = qvirtio_pci_get_queue_isr_status,
-    .get_config_isr_status = qvirtio_pci_get_config_isr_status,
+    .wait_config_isr_status = qvirtio_pci_wait_config_isr_status,
     .queue_select = qvirtio_pci_queue_select,
     .get_queue_size = qvirtio_pci_get_queue_size,
     .set_queue_address = qvirtio_pci_set_queue_address,
tests/libqos/virtio.c +6 -14
index 91ce06954b..0ae9956fc8 100644
@@ -82,13 +82,13 @@ void qvirtio_set_driver_ok(QVirtioDevice *d)
                     VIRTIO_CONFIG_S_DRIVER | VIRTIO_CONFIG_S_ACKNOWLEDGE);
 }
 
-void qvirtio_wait_queue_isr(QVirtioDevice *d,
+void qvirtio_wait_queue_isr(QTestState *qts, QVirtioDevice *d,
                             QVirtQueue *vq, gint64 timeout_us)
 {
     gint64 start_time = g_get_monotonic_time();
 
     for (;;) {
-        clock_step(100);
+        qtest_clock_step(qts, 100);
         if (d->bus->get_queue_isr_status(d, vq)) {
             return;
         }
@@ -109,8 +109,8 @@ uint8_t qvirtio_wait_status_byte_no_isr(QTestState *qts, QVirtioDevice *d,
     gint64 start_time = g_get_monotonic_time();
     uint8_t val;
 
-    while ((val = readb(addr)) == 0xff) {
-        clock_step(100);
+    while ((val = qtest_readb(qts, addr)) == 0xff) {
+        qtest_clock_step(qts, 100);
         g_assert(!d->bus->get_queue_isr_status(d, vq));
         g_assert(g_get_monotonic_time() - start_time <= timeout_us);
     }
@@ -137,7 +137,7 @@ void qvirtio_wait_used_elem(QTestState *qts, QVirtioDevice *d,
     for (;;) {
         uint32_t got_desc_idx;
 
-        clock_step(100);
+        qtest_clock_step(qts, 100);
 
         if (d->bus->get_queue_isr_status(d, vq) &&
             qvirtqueue_get_buf(qts, vq, &got_desc_idx, len)) {
@@ -151,15 +151,7 @@ void qvirtio_wait_used_elem(QTestState *qts, QVirtioDevice *d,
 
 void qvirtio_wait_config_isr(QVirtioDevice *d, gint64 timeout_us)
 {
-    gint64 start_time = g_get_monotonic_time();
-
-    for (;;) {
-        clock_step(100);
-        if (d->bus->get_config_isr_status(d)) {
-            return;
-        }
-        g_assert(g_get_monotonic_time() - start_time <= timeout_us);
-    }
+    d->bus->wait_config_isr_status(d, timeout_us);
 }
 
 void qvring_init(QTestState *qts, const QGuestAllocator *alloc, QVirtQueue *vq,
tests/libqos/virtio.h +3 -3
index 037176dbd8..2cb2448f46 100644
@@ -69,8 +69,8 @@ struct QVirtioBus {
     /* Get the queue ISR status of the device */
     bool (*get_queue_isr_status)(QVirtioDevice *d, QVirtQueue *vq);
 
-    /* Get the configuration ISR status of the device */
-    bool (*get_config_isr_status)(QVirtioDevice *d);
+    /* Wait for the configuration ISR status of the device */
+    void (*wait_config_isr_status)(QVirtioDevice *d, gint64 timeout_us);
 
     /* Select a queue to work on */
     void (*queue_select)(QVirtioDevice *d, uint16_t index);
@@ -112,7 +112,7 @@ void qvirtio_set_acknowledge(QVirtioDevice *d);
 void qvirtio_set_driver(QVirtioDevice *d);
 void qvirtio_set_driver_ok(QVirtioDevice *d);
 
-void qvirtio_wait_queue_isr(QVirtioDevice *d,
+void qvirtio_wait_queue_isr(QTestState *qts, QVirtioDevice *d,
                             QVirtQueue *vq, gint64 timeout_us);
 uint8_t qvirtio_wait_status_byte_no_isr(QTestState *qts, QVirtioDevice *d,
                                         QVirtQueue *vq,
tests/virtio-blk-test.c +2 -1
index 982ff1538c..45375dc4ff 100644
@@ -737,6 +737,7 @@ static void resize(void *obj, void *data, QGuestAllocator *t_alloc)
     int n_size = TEST_IMAGE_SIZE / 2;
     uint64_t capacity;
     QVirtQueue *vq;
+    QTestState *qts = global_qtest;
 
     vq = qvirtqueue_setup(dev, t_alloc, 0);
 
@@ -746,7 +747,7 @@ static void resize(void *obj, void *data, QGuestAllocator *t_alloc)
                          " 'arguments': { 'device': 'drive0', "
                          " 'size': %d } }", n_size);
 
-    qvirtio_wait_queue_isr(dev, vq, QVIRTIO_BLK_TIMEOUT_US);
+    qvirtio_wait_queue_isr(qts, dev, vq, QVIRTIO_BLK_TIMEOUT_US);
 
     capacity = qvirtio_config_readq(dev, 0);
     g_assert_cmpint(capacity, ==, n_size / 512);
Signature · 1 line
2.18.1
#3 lore raw

[Qemu-devel] [PULL 2/8] tests/libqos/e1000e: Make e1000e libqos functions independent from global_qtest

In reply to Thomas Huth

libqos library functions should never depend on functions (like memread(), memwrite() or clock_step()) that require global_qtest to be set, since library functions might get used in qtests that track multiple states, too. Thus let's replace the global_qtest-related functions with their independent counterparts.

Message-Id: <[email protected]>

---
 tests/libqos/e1000e.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
tests/libqos/e1000e.c +11 -5
index 1d0592974e..560e7a2bb2 100644
@@ -85,26 +85,32 @@ static uint32_t e1000e_macreg_read(QE1000E *d, uint32_t reg)
 
 void e1000e_tx_ring_push(QE1000E *d, void *descr)
 {
+    QE1000E_PCI *d_pci = container_of(d, QE1000E_PCI, e1000e);
     uint32_t tail = e1000e_macreg_read(d, E1000E_TDT);
     uint32_t len = e1000e_macreg_read(d, E1000E_TDLEN) / E1000E_TXD_LEN;
 
-    memwrite(d->tx_ring + tail * E1000E_TXD_LEN, descr, E1000E_TXD_LEN);
+    qtest_memwrite(d_pci->pci_dev.bus->qts, d->tx_ring + tail * E1000E_TXD_LEN,
+                   descr, E1000E_TXD_LEN);
     e1000e_macreg_write(d, E1000E_TDT, (tail + 1) % len);
 
     /* Read WB data for the packet transmitted */
-    memread(d->tx_ring + tail * E1000E_TXD_LEN, descr, E1000E_TXD_LEN);
+    qtest_memread(d_pci->pci_dev.bus->qts, d->tx_ring + tail * E1000E_TXD_LEN,
+                  descr, E1000E_TXD_LEN);
 }
 
 void e1000e_rx_ring_push(QE1000E *d, void *descr)
 {
+    QE1000E_PCI *d_pci = container_of(d, QE1000E_PCI, e1000e);
     uint32_t tail = e1000e_macreg_read(d, E1000E_RDT);
     uint32_t len = e1000e_macreg_read(d, E1000E_RDLEN) / E1000E_RXD_LEN;
 
-    memwrite(d->rx_ring + tail * E1000E_RXD_LEN, descr, E1000E_RXD_LEN);
+    qtest_memwrite(d_pci->pci_dev.bus->qts, d->rx_ring + tail * E1000E_RXD_LEN,
+                   descr, E1000E_RXD_LEN);
     e1000e_macreg_write(d, E1000E_RDT, (tail + 1) % len);
 
     /* Read WB data for the packet received */
-    memread(d->rx_ring + tail * E1000E_RXD_LEN, descr, E1000E_RXD_LEN);
+    qtest_memread(d_pci->pci_dev.bus->qts, d->rx_ring + tail * E1000E_RXD_LEN,
+                  descr, E1000E_RXD_LEN);
 }
 
 static void e1000e_foreach_callback(QPCIDevice *dev, int devfn, void *data)
@@ -123,7 +129,7 @@ void e1000e_wait_isr(QE1000E *d, uint16_t msg_id)
         if (qpci_msix_pending(&d_pci->pci_dev, msg_id)) {
             return;
         }
-        clock_step(10000);
+        qtest_clock_step(d_pci->pci_dev.bus->qts, 10000);
     } while (g_get_monotonic_time() < end_time);
 
     g_error("Timeout expired");
Signature · 1 line
2.18.1
#4 lore raw

[Qemu-devel] [PULL 7/8] tests/vm: Take the J=x setting into account for the vm-boot-ssh targets, too

In reply to Thomas Huth

For testing whether the VMs can deal with multiple CPUs correctly, it is useful to be able to use the "J=<cpus>" setting for the vm-boot-ssh targets, too.

Message-Id: <[email protected]>

---
 tests/vm/Makefile.include | 1 +
 1 file changed, 1 insertion(+)
tests/vm/Makefile.include +1 -0
index 3560716092..fea348e845 100644
@@ -80,6 +80,7 @@ vm-boot-serial-%: $(IMAGES_DIR)/%.img
 vm-boot-ssh-%: $(IMAGES_DIR)/%.img
 	$(call quiet-command, \
 		$(SRC_PATH)/tests/vm/$* \
+		$(if $(J),--jobs $(J)) \
 		--image "$<" \
 		--interactive \
 		false, \
Signature · 1 line
2.18.1
#5 lore raw

[Qemu-devel] [PULL 4/8] tests: Remove unnecessary global_qtest references

In reply to Thomas Huth

We are going to remove global_qtest from the main libqtest library soon, so tests that do not urgently need global_qtest anymore should be cleaned from the unnecessary references.

Message-Id: <[email protected]>

---
 tests/ahci-test.c        | 1 -
 tests/bios-tables-test.c | 1 -
 tests/ivshmem-test.c     | 3 ---
 tests/rtas-test.c        | 1 -
 4 files changed, 6 deletions(-)
tests/ahci-test.c +0 -1
index 086811e602..c8d42ceea0 100644
@@ -200,7 +200,6 @@ static void ahci_shutdown(AHCIQState *ahci)
 {
     QOSState *qs = ahci->parent;
 
-    assert(!global_qtest);
     ahci_clean_mem(ahci);
     free_ahci_device(ahci->dev);
     g_free(ahci);
tests/bios-tables-test.c +0 -1
index a356ac3489..9b3d8b0d1b 100644
@@ -626,7 +626,6 @@ static void test_acpi_one(const char *params, test_data *data)
         test_smbios_structs(data);
     }
 
-    assert(!global_qtest);
     qtest_quit(data->qts);
     g_free(args);
 }
tests/ivshmem-test.c +0 -3
index b76457948b..be9aa92a61 100644
@@ -100,7 +100,6 @@ static inline void write_mem(IVState *s, uint64_t off,
 
 static void cleanup_vm(IVState *s)
 {
-    assert(!global_qtest);
     g_free(s->dev);
     qtest_shutdown(s->qs);
 }
@@ -388,7 +387,6 @@ static void test_ivshmem_hotplug(void)
 
     qts = qtest_init("-object memory-backend-ram,size=1M,id=mb1");
 
-    global_qtest = qts;  /* TODO: Get rid of global_qtest here */
     qtest_qmp_device_add(qts, "ivshmem-plain", "iv1",
                          "{'addr': %s, 'memdev': 'mb1'}",
                          stringify(PCI_SLOT_HP));
@@ -397,7 +395,6 @@ static void test_ivshmem_hotplug(void)
     }
 
     qtest_quit(qts);
-    global_qtest = NULL;
 }
 
 static void test_ivshmem_memdev(void)
tests/rtas-test.c +0 -1
index ee888676ed..167b42db38 100644
@@ -14,7 +14,6 @@ static void test_rtas_get_time_of_day(void)
     time_t t1, t2;
 
     qs = qtest_spapr_boot("-machine pseries");
-    global_qtest = qs->qts;
 
     t1 = time(NULL);
     ret = qrtas_get_time_of_day(qs->qts, &qs->alloc, &tm, &ns);
Signature · 1 line
2.18.1
#6 lore raw

[Qemu-devel] [PULL 1/8] tests/migration: Do not use functions anymore that rely on global_qtest

In reply to Thomas Huth

The migration tests deal with multiple test states, so we really should not use functions here that rely on the single global_qtest variable. Switch from qtest_start() to qtest_init() to make sure that global_qtest is not set anymore. This also revealed a regression in the migrate()
function: It has once been converted to use the qtest_qmp() function, but commit b5bbd3f315d686bd511 ("Clean up string interpolation into QMP, part 2") accidentally reverted it back to qmp().

Message-Id: <[email protected]>

---
 tests/migration-test.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
tests/migration-test.c +3 -3
index b87ba99a9e..a9f81cc185 100644
@@ -490,7 +490,7 @@ static void migrate(QTestState *who, const char *uri, const char *fmt, ...)
     g_assert(!qdict_haskey(args, "uri"));
     qdict_put_str(args, "uri", uri);
 
-    rsp = qmp("{ 'execute': 'migrate', 'arguments': %p}", args);
+    rsp = qtest_qmp(who, "{ 'execute': 'migrate', 'arguments': %p}", args);
 
     g_assert(qdict_haskey(rsp, "return"));
     qobject_unref(rsp);
@@ -625,7 +625,7 @@ static int test_migrate_start(QTestState **from, QTestState **to,
         cmd_dst = tmp;
     }
 
-    *from = qtest_start(cmd_src);
+    *from = qtest_init(cmd_src);
     g_free(cmd_src);
 
     *to = qtest_init(cmd_dst);
@@ -715,7 +715,7 @@ static void test_deprecated(void)
 {
     QTestState *from;
 
-    from = qtest_start("-machine none");
+    from = qtest_init("-machine none");
 
     deprecated_set_downtime(from, 0.12345);
     deprecated_set_speed(from, 12345);
Signature · 1 line
2.18.1
#7 lore raw

[Qemu-devel] [PULL 6/8] tests/libqtest: Use libqtest-single.h in tests that require global_qtest

In reply to Thomas Huth

Tests that require global_qtest or the related wrapper functions now use the libqtest-single.h header that is dedicated for everything related to global_qtest. The core libqtest.c and libqtest.h files are now completely indepedent from global_qtest, so that the core library is now not depending on a global state anymore.

Message-Id: <[email protected]>

---
 tests/cpu-plug-test.c         | 2 +-
 tests/display-vga-test.c      | 2 +-
 tests/e1000e-test.c           | 2 +-
 tests/fdc-test.c              | 2 +-
 tests/i440fx-test.c           | 2 +-
 tests/i82801b11-test.c        | 2 +-
 tests/intel-hda-test.c        | 2 +-
 tests/ioh3420-test.c          | 2 +-
 tests/ipmi-kcs-test.c         | 3 +--
 tests/libqtest-single.h       | 4 ++++
 tests/libqtest.c              | 2 --
 tests/libqtest.h              | 4 ----
 tests/m25p80-test.c           | 2 +-
 tests/qos-test.c              | 2 +-
 tests/rtc-test.c              | 2 +-
 tests/rtl8139-test.c          | 2 +-
 tests/test-arm-mptimer.c      | 2 +-
 tests/test-netfilter.c        | 2 +-
 tests/test-x86-cpuid-compat.c | 2 +-
 tests/tmp105-test.c           | 2 +-
 tests/tpm-crb-test.c          | 2 +-
 tests/tpm-tests.c             | 2 +-
 tests/tpm-tis-test.c          | 2 +-
 tests/usb-hcd-ohci-test.c     | 2 +-
 tests/usb-hcd-uhci-test.c     | 2 +-
 tests/usb-hcd-xhci-test.c     | 2 +-
 tests/vhost-user-test.c       | 2 +-
 tests/virtio-blk-test.c       | 2 +-
 tests/virtio-ccw-test.c       | 2 +-
 tests/virtio-net-test.c       | 2 +-
 tests/virtio-scsi-test.c      | 2 +-
 tests/virtio-serial-test.c    | 2 +-
 32 files changed, 33 insertions(+), 36 deletions(-)
tests/cpu-plug-test.c +1 -1
index 3049620854..776407e1b6 100644
@@ -10,7 +10,7 @@
 #include "qemu/osdep.h"
 
 #include "qemu-common.h"
-#include "libqtest.h"
+#include "libqtest-single.h"
 #include "qapi/qmp/qdict.h"
 
 struct PlugTestData {
tests/display-vga-test.c +1 -1
index bd176dcf3a..ace3bb28e0 100644
@@ -8,7 +8,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqtest-single.h"
 
 static void pci_cirrus(void)
 {
tests/e1000e-test.c +1 -1
index 93628c588d..1a232a663a 100644
@@ -26,7 +26,7 @@
 
 #include "qemu/osdep.h"
 #include "qemu-common.h"
-#include "libqtest.h"
+#include "libqtest-single.h"
 #include "qemu-common.h"
 #include "libqos/pci-pc.h"
 #include "qemu/sockets.h"
tests/fdc-test.c +1 -1
index 31cd3295c1..26b69f7c5c 100644
@@ -25,7 +25,7 @@
 #include "qemu/osdep.h"
 
 
-#include "libqtest.h"
+#include "libqtest-single.h"
 #include "qapi/qmp/qdict.h"
 #include "qemu-common.h"
 
tests/i440fx-test.c +1 -1
index 69205b58a8..1f57d9684b 100644
@@ -14,7 +14,7 @@
 
 #include "qemu/osdep.h"
 
-#include "libqtest.h"
+#include "libqtest-single.h"
 #include "libqos/pci.h"
 #include "libqos/pci-pc.h"
 #include "hw/pci/pci_regs.h"
tests/i82801b11-test.c +1 -1
index a6e31594c9..4345da338b 100644
@@ -8,7 +8,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqtest-single.h"
 
 /* Tests only initialization so far. TODO: Replace with functional tests */
 static void nop(void)
tests/intel-hda-test.c +1 -1
index b782b2e944..fc25ccc33c 100644
@@ -8,7 +8,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqtest-single.h"
 
 #define HDA_ID "hda0"
 #define CODEC_DEVICES " -device hda-output,bus=" HDA_ID ".0" \
tests/ioh3420-test.c +1 -1
index b54c4b9f11..f6ca43cca7 100644
@@ -8,7 +8,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqtest-single.h"
 
 /* Tests only initialization so far. TODO: Replace with functional tests */
 static void nop(void)
tests/ipmi-kcs-test.c +1 -2
index a2354c10c7..693a6aacb5 100644
@@ -24,8 +24,7 @@
 
 #include "qemu/osdep.h"
 
-
-#include "libqtest.h"
+#include "libqtest-single.h"
 
 #define IPMI_IRQ        5
 
tests/libqtest-single.h +4 -0
index 49259558a5..6f1bb1331c 100644
@@ -11,6 +11,10 @@
 #ifndef LIBQTEST_SINGLE_H
 #define LIBQTEST_SINGLE_H
 
+#include "libqtest.h"
+
+QTestState *global_qtest __attribute__((common, weak));
+
 /**
  * qtest_start:
  * @args: other arguments to pass to QEMU
tests/libqtest.c +0 -2
index e5101d9d3a..0a6b91737e 100644
@@ -35,8 +35,6 @@
 #define SOCKET_TIMEOUT 50
 #define SOCKET_MAX_FDS 16
 
-QTestState *global_qtest;
-
 struct QTestState
 {
     int fd;
tests/libqtest.h +0 -4
index 6a7d7e41ad..c8cffe5d68 100644
@@ -22,8 +22,6 @@
 
 typedef struct QTestState QTestState;
 
-extern QTestState *global_qtest;
-
 /**
  * qtest_initf:
  * @fmt...: Format for creating other arguments to pass to QEMU, formatted
@@ -641,8 +639,6 @@ void qtest_add_abrt_handler(GHookFunc fn, const void *data);
 void qtest_qmp_assert_success(QTestState *qts, const char *fmt, ...)
     GCC_FMT_ATTR(2, 3);
 
-#include "libqtest-single.h"
-
 QDict *qmp_fd_receive(int fd);
 void qmp_fd_vsend_fds(int fd, int *fds, size_t fds_num,
                       const char *fmt, va_list ap) GCC_FMT_ATTR(4, 0);
tests/m25p80-test.c +1 -1
index 055f7246a8..50c6b79fb3 100644
@@ -25,7 +25,7 @@
 
 #include "qemu/osdep.h"
 #include "qemu/bswap.h"
-#include "libqtest.h"
+#include "libqtest-single.h"
 
 /*
  * ASPEED SPI Controller registers
tests/qos-test.c +1 -1
index 3c0071b3b7..fd70d73ea5 100644
@@ -18,7 +18,7 @@
 
 #include "qemu/osdep.h"
 #include <getopt.h>
-#include "libqtest.h"
+#include "libqtest-single.h"
 #include "qapi/qmp/qdict.h"
 #include "qapi/qmp/qbool.h"
 #include "qapi/qmp/qstring.h"
tests/rtc-test.c +1 -1
index 509be707e3..6309b0ef6c 100644
@@ -13,7 +13,7 @@
 
 #include "qemu/osdep.h"
 
-#include "libqtest.h"
+#include "libqtest-single.h"
 #include "qemu/timer.h"
 #include "hw/timer/mc146818rtc_regs.h"
 
tests/rtl8139-test.c +1 -1
index d6d0c24909..4506049264 100644
@@ -8,7 +8,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqtest-single.h"
 #include "libqos/pci-pc.h"
 #include "qemu/timer.h"
 #include "qemu-common.h"
tests/test-arm-mptimer.c +1 -1
index 156a39f50d..7a56d56da9 100644
@@ -9,7 +9,7 @@
 
 #include "qemu/osdep.h"
 #include "qemu/timer.h"
-#include "libqtest.h"
+#include "libqtest-single.h"
 
 #define TIMER_BLOCK_SCALE(s)    ((((s) & 0xff) + 1) * 10)
 
tests/test-netfilter.c +1 -1
index e47075dd06..22927ee6ab 100644
@@ -9,7 +9,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqtest-single.h"
 #include "qapi/qmp/qdict.h"
 
 /* add a netfilter to a netdev and then remove it */
tests/test-x86-cpuid-compat.c +1 -1
index e75b959950..772287bdb4 100644
@@ -4,7 +4,7 @@
 #include "qapi/qmp/qlist.h"
 #include "qapi/qmp/qnum.h"
 #include "qapi/qmp/qbool.h"
-#include "libqtest.h"
+#include "libqtest-single.h"
 
 static char *get_cpu0_qom_path(void)
 {
tests/tmp105-test.c +1 -1
index f599309a4a..f930a96b83 100644
@@ -9,7 +9,7 @@
 
 #include "qemu/osdep.h"
 
-#include "libqtest.h"
+#include "libqtest-single.h"
 #include "libqos/qgraph.h"
 #include "libqos/i2c.h"
 #include "qapi/qmp/qdict.h"
tests/tpm-crb-test.c +1 -1
index a139caa51d..632fb7fbd8 100644
@@ -15,7 +15,7 @@
 
 #include "hw/acpi/tpm.h"
 #include "io/channel-socket.h"
-#include "libqtest.h"
+#include "libqtest-single.h"
 #include "qemu/module.h"
 #include "tpm-emu.h"
 
tests/tpm-tests.c +1 -1
index e640777aa9..6e45a0ba85 100644
@@ -15,7 +15,7 @@
 #include "qemu/osdep.h"
 #include <glib/gstdio.h>
 
-#include "libqtest.h"
+#include "libqtest-single.h"
 #include "tpm-tests.h"
 
 static bool
tests/tpm-tis-test.c +1 -1
index 92a7e95aad..dcf30e05b7 100644
@@ -17,7 +17,7 @@
 
 #include "hw/acpi/tpm.h"
 #include "io/channel-socket.h"
-#include "libqtest.h"
+#include "libqtest-single.h"
 #include "qemu/module.h"
 #include "tpm-emu.h"
 
tests/usb-hcd-ohci-test.c +1 -1
index 0cd73b7363..19d760f3fb 100644
@@ -8,7 +8,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqtest-single.h"
 #include "qemu/module.h"
 #include "libqos/usb.h"
 #include "libqos/qgraph.h"
tests/usb-hcd-uhci-test.c +1 -1
index 2eef8e3d1c..7a117b64d9 100644
@@ -8,7 +8,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqtest-single.h"
 #include "libqos/libqos.h"
 #include "libqos/usb.h"
 #include "libqos/libqos-pc.h"
tests/usb-hcd-xhci-test.c +1 -1
index 01845371f9..10ef9d2a91 100644
@@ -8,7 +8,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqtest-single.h"
 #include "libqos/usb.h"
 
 
tests/vhost-user-test.c +1 -1
index 6ae8a23688..91ea373ba5 100644
@@ -10,7 +10,7 @@
 
 #include "qemu/osdep.h"
 
-#include "libqtest.h"
+#include "libqtest-single.h"
 #include "qapi/error.h"
 #include "qapi/qmp/qdict.h"
 #include "qemu/config-file.h"
tests/virtio-blk-test.c +1 -1
index 45375dc4ff..ed13167392 100644
@@ -9,7 +9,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqtest-single.h"
 #include "qemu/bswap.h"
 #include "qemu/module.h"
 #include "standard-headers/linux/virtio_blk.h"
tests/virtio-ccw-test.c +1 -1
index 9f445ef4ad..d05236407b 100644
@@ -14,7 +14,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqtest-single.h"
 #include "libqos/virtio.h"
 
 static void virtio_balloon_nop(void)
tests/virtio-net-test.c +1 -1
index 840875aaae..a08e2ffe12 100644
@@ -9,7 +9,7 @@
 
 #include "qemu/osdep.h"
 #include "qemu-common.h"
-#include "libqtest.h"
+#include "libqtest-single.h"
 #include "qemu/iov.h"
 #include "qemu/module.h"
 #include "qapi/qmp/qdict.h"
tests/virtio-scsi-test.c +1 -1
index 09348765d7..7c8f9b27f8 100644
@@ -9,7 +9,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqtest-single.h"
 #include "qemu/module.h"
 #include "scsi/constants.h"
 #include "libqos/libqos-pc.h"
tests/virtio-serial-test.c +1 -1
index e584ad76e8..2541034822 100644
@@ -8,7 +8,7 @@
  */
 
 #include "qemu/osdep.h"
-#include "libqtest.h"
+#include "libqtest-single.h"
 #include "qemu/module.h"
 #include "libqos/virtio-serial.h"
 
Signature · 1 line
2.18.1
#8 lore raw

[Qemu-devel] [PULL 8/8] qemu-doc: Do not hard-code the name of the QEMU binary

In reply to Thomas Huth

In our documentation, we use a mix of "$QEMU", "qemu-system-i386" and "qemu-system-x86_64" when we give examples to the users how to run QEMU. Some more consistency would be good here. Also some distributions use different names for the QEMU binary (e.g. "qemu-kvm" in RHEL), so providing more flexibility here would also be good. Thus let's define some variables for the names of the QEMU command and use those in the documentation instead: @value{qemu_system} for generic examples, and @value{qemu_system_x86} for examples that only work with the x86 binaries.

Message-Id: <[email protected]>

---
 docs/qemu-block-drivers.texi |  72 ++++++++++----------
 docs/qemu-cpu-models.texi    |  10 +--
 qemu-doc.texi                |  81 +++++++++++-----------
 qemu-options.hx              | 128 +++++++++++++++++------------------
 4 files changed, 149 insertions(+), 142 deletions(-)
docs/qemu-block-drivers.texi +37 -35
index c02547e28c..2c7ea49c32 100644
@@ -2,6 +2,8 @@
 QEMU block driver reference manual
 @c man end
 
+@set qemu_system qemu-system-x86_64
+
 @c man begin DESCRIPTION
 
 @node disk_images_formats
@@ -405,7 +407,7 @@ QEMU can automatically create a virtual FAT disk image from a
 directory tree. In order to use it, just type:
 
 @example
-qemu-system-i386 linux.img -hdb fat:/my_directory
+@value{qemu_system} linux.img -hdb fat:/my_directory
 @end example
 
 Then you access access to all the files in the @file{/my_directory}
@@ -415,14 +417,14 @@ them via SAMBA or NFS. The default access is @emph{read-only}.
 Floppies can be emulated with the @code{:floppy:} option:
 
 @example
-qemu-system-i386 linux.img -fda fat:floppy:/my_directory
+@value{qemu_system} linux.img -fda fat:floppy:/my_directory
 @end example
 
 A read/write support is available for testing (beta stage) with the
 @code{:rw:} option:
 
 @example
-qemu-system-i386 linux.img -fda fat:floppy:rw:/my_directory
+@value{qemu_system} linux.img -fda fat:floppy:rw:/my_directory
 @end example
 
 What you should @emph{never} do:
@@ -440,14 +442,14 @@ QEMU can access directly to block device exported using the Network Block Device
 protocol.
 
 @example
-qemu-system-i386 linux.img -hdb nbd://my_nbd_server.mydomain.org:1024/
+@value{qemu_system} linux.img -hdb nbd://my_nbd_server.mydomain.org:1024/
 @end example
 
 If the NBD server is located on the same host, you can use an unix socket instead
 of an inet socket:
 
 @example
-qemu-system-i386 linux.img -hdb nbd+unix://?socket=/tmp/my_socket
+@value{qemu_system} linux.img -hdb nbd+unix://?socket=/tmp/my_socket
 @end example
 
 In this case, the block device must be exported using qemu-nbd:
@@ -464,23 +466,23 @@ qemu-nbd --socket=/tmp/my_socket --share=2 my_disk.qcow2
 @noindent
 and then you can use it with two guests:
 @example
-qemu-system-i386 linux1.img -hdb nbd+unix://?socket=/tmp/my_socket
-qemu-system-i386 linux2.img -hdb nbd+unix://?socket=/tmp/my_socket
+@value{qemu_system} linux1.img -hdb nbd+unix://?socket=/tmp/my_socket
+@value{qemu_system} linux2.img -hdb nbd+unix://?socket=/tmp/my_socket
 @end example
 
 If the nbd-server uses named exports (supported since NBD 2.9.18, or with QEMU's
 own embedded NBD server), you must specify an export name in the URI:
 @example
-qemu-system-i386 -cdrom nbd://localhost/debian-500-ppc-netinst
-qemu-system-i386 -cdrom nbd://localhost/openSUSE-11.1-ppc-netinst
+@value{qemu_system} -cdrom nbd://localhost/debian-500-ppc-netinst
+@value{qemu_system} -cdrom nbd://localhost/openSUSE-11.1-ppc-netinst
 @end example
 
 The URI syntax for NBD is supported since QEMU 1.3.  An alternative syntax is
 also available.  Here are some example of the older syntax:
 @example
-qemu-system-i386 linux.img -hdb nbd:my_nbd_server.mydomain.org:1024
-qemu-system-i386 linux2.img -hdb nbd:unix:/tmp/my_socket
-qemu-system-i386 -cdrom nbd:localhost:10809:exportname=debian-500-ppc-netinst
+@value{qemu_system} linux.img -hdb nbd:my_nbd_server.mydomain.org:1024
+@value{qemu_system} linux2.img -hdb nbd:unix:/tmp/my_socket
+@value{qemu_system} -cdrom nbd:localhost:10809:exportname=debian-500-ppc-netinst
 @end example
 
 @node disk_images_sheepdog
@@ -505,7 +507,7 @@ qemu-img convert @var{filename} sheepdog:///@var{image}
 
 You can boot from the Sheepdog disk image with the command:
 @example
-qemu-system-i386 sheepdog:///@var{image}
+@value{qemu_system} sheepdog:///@var{image}
 @end example
 
 You can also create a snapshot of the Sheepdog image like qcow2.
@@ -517,7 +519,7 @@ where @var{tag} is a tag name of the newly created snapshot.
 To boot from the Sheepdog snapshot, specify the tag name of the
 snapshot.
 @example
-qemu-system-i386 sheepdog:///@var{image}#@var{tag}
+@value{qemu_system} sheepdog:///@var{image}#@var{tag}
 @end example
 
 You can create a cloned image from the existing snapshot.
@@ -530,14 +532,14 @@ is its tag name.
 You can use an unix socket instead of an inet socket:
 
 @example
-qemu-system-i386 sheepdog+unix:///@var{image}?socket=@var{path}
+@value{qemu_system} sheepdog+unix:///@var{image}?socket=@var{path}
 @end example
 
 If the Sheepdog daemon doesn't run on the local host, you need to
 specify one of the Sheepdog servers to connect to.
 @example
 qemu-img create sheepdog://@var{hostname}:@var{port}/@var{image} @var{size}
-qemu-system-i386 sheepdog://@var{hostname}:@var{port}/@var{image}
+@value{qemu_system} sheepdog://@var{hostname}:@var{port}/@var{image}
 @end example
 
 @node disk_images_iscsi
@@ -627,7 +629,7 @@ cat >iscsi.conf <<EOF
   header-digest = "CRC32C"
 EOF
 
-qemu-system-i386 -drive file=iscsi://127.0.0.1/iqn.qemu.test/1 \
+@value{qemu_system} -drive file=iscsi://127.0.0.1/iqn.qemu.test/1 \
     -readconfig iscsi.conf
 @end example
 
@@ -646,7 +648,7 @@ tgtadm --lld iscsi --mode logicalunit --op new --tid 1 --lun 2 \
     -b /IMAGES/cd.iso --device-type=cd
 tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL
 
-qemu-system-i386 -iscsi initiator-name=iqn.qemu.test:my-initiator \
+@value{qemu_system} -iscsi initiator-name=iqn.qemu.test:my-initiator \
     -boot d -drive file=iscsi://127.0.0.1/iqn.qemu.test/1 \
     -cdrom iscsi://127.0.0.1/iqn.qemu.test/2
 @end example
@@ -659,11 +661,11 @@ GlusterFS is a user space distributed file system.
 You can boot from the GlusterFS disk image with the command:
 @example
 URI:
-qemu-system-x86_64 -drive file=gluster[+@var{type}]://[@var{host}[:@var{port}]]/@var{volume}/@var{path}
+@value{qemu_system} -drive file=gluster[+@var{type}]://[@var{host}[:@var{port}]]/@var{volume}/@var{path}
                                [?socket=...][,file.debug=9][,file.logfile=...]
 
 JSON:
-qemu-system-x86_64 'json:@{"driver":"qcow2",
+@value{qemu_system} 'json:@{"driver":"qcow2",
                            "file":@{"driver":"gluster",
                                     "volume":"testvol","path":"a.img","debug":9,"logfile":"...",
                                     "server":[@{"type":"tcp","host":"...","port":"..."@},
@@ -711,22 +713,22 @@ qemu-img create gluster://@var{host}/@var{volume}/@var{path} @var{size}
 
 Examples
 @example
-qemu-system-x86_64 -drive file=gluster://1.2.3.4/testvol/a.img
-qemu-system-x86_64 -drive file=gluster+tcp://1.2.3.4/testvol/a.img
-qemu-system-x86_64 -drive file=gluster+tcp://1.2.3.4:24007/testvol/dir/a.img
-qemu-system-x86_64 -drive file=gluster+tcp://[1:2:3:4:5:6:7:8]/testvol/dir/a.img
-qemu-system-x86_64 -drive file=gluster+tcp://[1:2:3:4:5:6:7:8]:24007/testvol/dir/a.img
-qemu-system-x86_64 -drive file=gluster+tcp://server.domain.com:24007/testvol/dir/a.img
-qemu-system-x86_64 -drive file=gluster+unix:///testvol/dir/a.img?socket=/tmp/glusterd.socket
-qemu-system-x86_64 -drive file=gluster+rdma://1.2.3.4:24007/testvol/a.img
-qemu-system-x86_64 -drive file=gluster://1.2.3.4/testvol/a.img,file.debug=9,file.logfile=/var/log/qemu-gluster.log
-qemu-system-x86_64 'json:@{"driver":"qcow2",
+@value{qemu_system} -drive file=gluster://1.2.3.4/testvol/a.img
+@value{qemu_system} -drive file=gluster+tcp://1.2.3.4/testvol/a.img
+@value{qemu_system} -drive file=gluster+tcp://1.2.3.4:24007/testvol/dir/a.img
+@value{qemu_system} -drive file=gluster+tcp://[1:2:3:4:5:6:7:8]/testvol/dir/a.img
+@value{qemu_system} -drive file=gluster+tcp://[1:2:3:4:5:6:7:8]:24007/testvol/dir/a.img
+@value{qemu_system} -drive file=gluster+tcp://server.domain.com:24007/testvol/dir/a.img
+@value{qemu_system} -drive file=gluster+unix:///testvol/dir/a.img?socket=/tmp/glusterd.socket
+@value{qemu_system} -drive file=gluster+rdma://1.2.3.4:24007/testvol/a.img
+@value{qemu_system} -drive file=gluster://1.2.3.4/testvol/a.img,file.debug=9,file.logfile=/var/log/qemu-gluster.log
+@value{qemu_system} 'json:@{"driver":"qcow2",
                            "file":@{"driver":"gluster",
                                     "volume":"testvol","path":"a.img",
                                     "debug":9,"logfile":"/var/log/qemu-gluster.log",
                                     "server":[@{"type":"tcp","host":"1.2.3.4","port":24007@},
                                               @{"type":"unix","socket":"/var/run/glusterd.socket"@}]@}@}'
-qemu-system-x86_64 -drive driver=qcow2,file.driver=gluster,file.volume=testvol,file.path=/path/a.img,
+@value{qemu_system} -drive driver=qcow2,file.driver=gluster,file.volume=testvol,file.path=/path/a.img,
                                        file.debug=9,file.logfile=/var/log/qemu-gluster.log,
                                        file.server.0.type=tcp,file.server.0.host=1.2.3.4,file.server.0.port=24007,
                                        file.server.1.type=unix,file.server.1.socket=/var/run/glusterd.socket
@@ -739,13 +741,13 @@ You can access disk images located on a remote ssh server
 by using the ssh protocol:
 
 @example
-qemu-system-x86_64 -drive file=ssh://[@var{user}@@]@var{server}[:@var{port}]/@var{path}[?host_key_check=@var{host_key_check}]
+@value{qemu_system} -drive file=ssh://[@var{user}@@]@var{server}[:@var{port}]/@var{path}[?host_key_check=@var{host_key_check}]
 @end example
 
 Alternative syntax using properties:
 
 @example
-qemu-system-x86_64 -drive file.driver=ssh[,file.user=@var{user}],file.host=@var{server}[,file.port=@var{port}],file.path=@var{path}[,file.host_key_check=@var{host_key_check}]
+@value{qemu_system} -drive file.driver=ssh[,file.user=@var{user}],file.host=@var{server}[,file.port=@var{port}],file.path=@var{path}[,file.host_key_check=@var{host_key_check}]
 @end example
 
 @var{ssh} is the protocol.
@@ -808,13 +810,13 @@ driver.  For example:
 # echo 0000:06:0d.0 > /sys/bus/pci/devices/0000:06:0d.0/driver/unbind
 # echo 1102 0002 > /sys/bus/pci/drivers/vfio-pci/new_id
 
-# qemu-system-x86_64 -drive file=nvme://@var{host}:@var{bus}:@var{slot}.@var{func}/@var{namespace}
+# @value{qemu_system} -drive file=nvme://@var{host}:@var{bus}:@var{slot}.@var{func}/@var{namespace}
 @end example
 
 Alternative syntax using properties:
 
 @example
-qemu-system-x86_64 -drive file.driver=nvme,file.device=@var{host}:@var{bus}:@var{slot}.@var{func},file.namespace=@var{namespace}
+@value{qemu_system} -drive file.driver=nvme,file.device=@var{host}:@var{bus}:@var{slot}.@var{func},file.namespace=@var{namespace}
 @end example
 
 @var{host}:@var{bus}:@var{slot}.@var{func} is the NVMe controller's PCI device
docs/qemu-cpu-models.texi +6 -4
index ad040cfc98..f88a1def0d 100644
@@ -2,6 +2,8 @@
 QEMU / KVM CPU model configuration
 @c man end
 
+@set qemu_system_x86 qemu-system-x86_64
+
 @c man begin DESCRIPTION
 
 @menu
@@ -578,25 +580,25 @@ CPU models / features in QEMU and libvirt
 @item Host passthrough
 
 @example
-   $ qemu-system-x86_64 -cpu host
+   $ @value{qemu_system_x86} -cpu host
 @end example
 
 With feature customization:
 
 @example
-   $ qemu-system-x86_64 -cpu host,-vmx,...
+   $ @value{qemu_system_x86} -cpu host,-vmx,...
 @end example
 
 @item Named CPU models
 
 @example
-   $ qemu-system-x86_64 -cpu Westmere
+   $ @value{qemu_system_x86} -cpu Westmere
 @end example
 
 With feature customization:
 
 @example
-   $ qemu-system-x86_64 -cpu Westmere,+pcid,...
+   $ @value{qemu_system_x86} -cpu Westmere,+pcid,...
 @end example
 
 @end table
qemu-doc.texi +42 -39

291 lines not on this page · raw message

qemu-options.hx +64 -64

378 lines not on this page · raw message

Signature · 1 line
2.18.1
#9 lore raw
In reply to Thomas Huth
Quoted 20 lines · Thomas Huth

Hi Peter,

the following changes since commit a8b5ad8e1faef0d1bb3e550530328e8ec76fe87c:

Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging (2019-09-04 17:22:34 +0100)

are available in the Git repository at:

https://gitlab.com/huth/qemu.git tags/pull-request-2019-09-05

for you to fetch changes up to 7bb21c0ac301e423b483dd7fc171b0d7b56de2cf:

qemu-doc: Do not hard-code the name of the QEMU binary (2019-09-05 09:45:09 +0200)

----------------------------------------------------------------
- Make the core libqtest library independent from global_qtest
- Clean up docs from hard-coded qemu-system-* names
----------------------------------------------------------------

Quoted 9 lines

Thomas Huth (8):
tests/migration: Do not use functions anymore that rely on global_qtest tests/libqos/e1000e: Make e1000e libqos functions independent from global_qtest tests/libqos: Replace clock_step with qtest_clock_step in virtio code
tests: Remove unnecessary global_qtest references
tests/libqtest: Move global_test wrapper function into a separate header tests/libqtest: Use libqtest-single.h in tests that require global_qtest tests/vm: Take the J=x setting into account for the vm-boot-ssh targets, too
qemu-doc: Do not hard-code the name of the QEMU binary

Hi; I'm afraid this fails to build:

/home/pm/qemu/tests/virtio-9p-test.c: In function ‘v9fs_req_init’:
/home/pm/qemu/tests/virtio-9p-test.c:162:16: error: ‘global_qtest’ undeclared (first use in this function); did you mean ‘g_file_test’?

     req->qts = global_qtest;
                ^~~~~~~~~~~~
                g_file_test

/home/pm/qemu/tests/virtio-9p-test.c:162:16: note: each undeclared identifier is reported only once for each function it appears in /home/pm/qemu/rules.mak:69: recipe for target 'tests/virtio-9p-test.o' failed

thanks
-- PMM

#10 lore raw
Quoted 36 lines · Peter Maydell
Quoted 20 lines · Thomas Huth

Hi Peter,

the following changes since commit a8b5ad8e1faef0d1bb3e550530328e8ec76fe87c:

Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging (2019-09-04 17:22:34 +0100)

are available in the Git repository at:

https://gitlab.com/huth/qemu.git tags/pull-request-2019-09-05

for you to fetch changes up to 7bb21c0ac301e423b483dd7fc171b0d7b56de2cf:

qemu-doc: Do not hard-code the name of the QEMU binary (2019-09-05 09:45:09 +0200)

----------------------------------------------------------------
- Make the core libqtest library independent from global_qtest
- Clean up docs from hard-coded qemu-system-* names
----------------------------------------------------------------

Quoted 9 lines

Thomas Huth (8):
tests/migration: Do not use functions anymore that rely on global_qtest tests/libqos/e1000e: Make e1000e libqos functions independent from global_qtest tests/libqos: Replace clock_step with qtest_clock_step in virtio code
tests: Remove unnecessary global_qtest references
tests/libqtest: Move global_test wrapper function into a separate header tests/libqtest: Use libqtest-single.h in tests that require global_qtest tests/vm: Take the J=x setting into account for the vm-boot-ssh targets, too
qemu-doc: Do not hard-code the name of the QEMU binary

Hi; I'm afraid this fails to build:

/home/pm/qemu/tests/virtio-9p-test.c: In function ‘v9fs_req_init’:
/home/pm/qemu/tests/virtio-9p-test.c:162:16: error: ‘global_qtest’ undeclared (first use in this function); did you mean ‘g_file_test’?

Quoted 6 lines
     req->qts = global_qtest;
                ^~~~~~~~~~~~
                g_file_test

/home/pm/qemu/tests/virtio-9p-test.c:162:16: note: each undeclared identifier is reported only once for each function it appears in /home/pm/qemu/rules.mak:69: recipe for target 'tests/virtio-9p-test.o' failed

Oh, that's unexpected since my gitlab-ci pipeline worked fine:

https://gitlab.com/huth/qemu/pipelines/80403573

Looks like both, my local system and the gitlab-ci are missing libcap-devel and/or libattr-devel, so that the 9P stuff does not get built :-(

Time for some fix-up patches ...

Thomas