Commit 1f3a51f3 authored by Peter Maydell's avatar Peter Maydell
Browse files

Merge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2019-08-15' into staging



- Fix for ctrl queue in the virtio-net QOS driver
- Improve Valgrind reports in the tests that use the null-co driver
- Get rid of global_qtest related code in libqtest and libqos

# gpg: Signature made Thu 15 Aug 2019 18:28:16 BST
# gpg:                using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5
# gpg:                issuer "thuth@redhat.com"
# gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full]
# gpg:                 aka "Thomas Huth <thuth@redhat.com>" [full]
# gpg:                 aka "Thomas Huth <huth@tuxfamily.org>" [full]
# gpg:                 aka "Thomas Huth <th.huth@posteo.de>" [unknown]
# Primary key fingerprint: 27B8 8847 EEE0 2501 18F3  EAB9 2ED9 D774 FE70 2DB5

* remotes/huth-gitlab/tags/pull-request-2019-08-15:
  tests/libqtest: Make qmp_assert_success() independent from global_qtest
  tests/libqtest: Make qtest_qmp_device_add/del independent from global_qtest
  tests/libqtest: Clean up qtest_cb_for_every_machine() wrt global_qtest
  tests/libqtest: Remove unused function hmp()
  tests/libqos: Make virtio-pci code independent from global_qtest
  tests/libqos: Make generic virtio code independent from global_qtest
  tests: Set read-zeroes on for null-co driver
  libqos: Account for the ctrl queue in virtio-net
  qtest: Rename qtest.c:qtest_init()

Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
parents 27608c7c 6fc9f3d3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -24,6 +24,6 @@ static inline bool qtest_enabled(void)

bool qtest_driver(void);

void qtest_init(const char *qtest_chrdev, const char *qtest_log, Error **errp);
void qtest_server_init(const char *qtest_chrdev, const char *qtest_log, Error **errp);

#endif
+1 −2
Original line number Diff line number Diff line
@@ -748,8 +748,7 @@ static void qtest_event(void *opaque, int event)
        break;
    }
}

void qtest_init(const char *qtest_chrdev, const char *qtest_log, Error **errp)
void qtest_server_init(const char *qtest_chrdev, const char *qtest_log, Error **errp)
{
    Chardev *chr;

+9 −6
Original line number Diff line number Diff line
@@ -77,18 +77,19 @@ static void test_plug_with_device_add_x86(gconstpointer data)
    const PlugTestData *td = data;
    char *args;
    unsigned int s, c, t;
    QTestState *qts;

    args = g_strdup_printf("-machine %s -cpu %s "
                           "-smp 1,sockets=%u,cores=%u,threads=%u,maxcpus=%u",
                           td->machine, td->cpu_model,
                           td->sockets, td->cores, td->threads, td->maxcpus);
    qtest_start(args);
    qts = qtest_init(args);

    for (s = 1; s < td->sockets; s++) {
        for (c = 0; c < td->cores; c++) {
            for (t = 0; t < td->threads; t++) {
                char *id = g_strdup_printf("id-%i-%i-%i", s, c, t);
                qtest_qmp_device_add(td->device_model, id,
                qtest_qmp_device_add(qts, td->device_model, id,
                                     "{'socket-id':%u, 'core-id':%u,"
                                     " 'thread-id':%u}",
                                     s, c, t);
@@ -97,7 +98,7 @@ static void test_plug_with_device_add_x86(gconstpointer data)
        }
    }

    qtest_end();
    qtest_quit(qts);
    g_free(args);
}

@@ -106,20 +107,22 @@ static void test_plug_with_device_add_coreid(gconstpointer data)
    const PlugTestData *td = data;
    char *args;
    unsigned int c;
    QTestState *qts;

    args = g_strdup_printf("-machine %s -cpu %s "
                           "-smp 1,sockets=%u,cores=%u,threads=%u,maxcpus=%u",
                           td->machine, td->cpu_model,
                           td->sockets, td->cores, td->threads, td->maxcpus);
    qtest_start(args);
    qts = qtest_init(args);

    for (c = 1; c < td->cores; c++) {
        char *id = g_strdup_printf("id-%i", c);
        qtest_qmp_device_add(td->device_model, id, "{'core-id':%u}", c);
        qtest_qmp_device_add(qts, td->device_model, id,
                             "{'core-id':%u}", c);
        g_free(id);
    }

    qtest_end();
    qtest_quit(qts);
    g_free(args);
}

+2 −1
Original line number Diff line number Diff line
@@ -121,7 +121,8 @@ static void test_drive_del_device_del(void)
    QTestState *qts;

    /* Start with a drive used by a device that unplugs instantaneously */
    qts = qtest_initf("-drive if=none,id=drive0,file=null-co://,format=raw"
    qts = qtest_initf("-drive if=none,id=drive0,file=null-co://,"
                      "file.read-zeroes=on,format=raw"
                      " -device virtio-scsi-%s"
                      " -device scsi-hd,drive=drive0,id=dev0",
                      qvirtio_get_dev_type());
+1 −1
Original line number Diff line number Diff line
@@ -235,7 +235,7 @@ static void test_e1000e_hotplug(void *obj, void *data, QGuestAllocator * alloc)
{
    QTestState *qts = global_qtest;  /* TODO: get rid of global_qtest here */

    qtest_qmp_device_add("e1000e", "e1000e_net", "{'addr': '0x06'}");
    qtest_qmp_device_add(qts, "e1000e", "e1000e_net", "{'addr': '0x06'}");
    qpci_unplug_acpi_device_test(qts, "e1000e_net", 0x06);
}

Loading