Commit 88b988c8 authored by Markus Armbruster's avatar Markus Armbruster
Browse files

libqtest: Replace qtest_startf() by qtest_initf()



qtest_init() creates a new QTestState, and leaves @global_qtest alone.
qtest_start() additionally assigns it to @global_qtest, but
qtest_startf() additionally assigns NULL to @global_qtest.  This makes
no sense.  Replace it by qtest_initf() that works like qtest_init(),
i.e. leaves @global_qtest alone.

Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
Reviewed-by: default avatarEric Blake <eblake@redhat.com>
Message-Id: <20180806065344.7103-23-armbru@redhat.com>
parent e3dc93be
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ static void test_a_boot_order(const char *machine,
{
    uint64_t actual;

    global_qtest = qtest_startf("-nodefaults%s%s %s",
    global_qtest = qtest_initf("-nodefaults%s%s %s",
                               machine ? " -M " : "",
                               machine ?: "",
                               test_args);
+5 −5
Original line number Diff line number Diff line
@@ -172,7 +172,7 @@ static void test_machine(const void *data)
     * Make sure that this test uses tcg if available: It is used as a
     * fast-enough smoketest for that.
     */
    global_qtest = qtest_startf("%s %s -M %s,accel=tcg:kvm "
    global_qtest = qtest_initf("%s %s -M %s,accel=tcg:kvm "
                               "-chardev file,id=serial0,path=%s "
                               "-no-shutdown -serial chardev:serial0 %s",
                               codeparam, code ? codetmp : "",
+3 −3
Original line number Diff line number Diff line
@@ -99,7 +99,7 @@ static void test_cdrom_param(gconstpointer data)
    QTestState *qts;
    char *resp;

    qts = qtest_startf("-M %s -cdrom %s", (const char *)data, isoimage);
    qts = qtest_initf("-M %s -cdrom %s", (const char *)data, isoimage);
    resp = qtest_hmp(qts, "info block");
    g_assert(strstr(resp, isoimage) != 0);
    g_free(resp);
@@ -120,7 +120,7 @@ static void test_cdboot(gconstpointer data)
{
    QTestState *qts;

    qts = qtest_startf("-accel kvm:tcg -no-shutdown %s%s", (const char *)data,
    qts = qtest_initf("-accel kvm:tcg -no-shutdown %s%s", (const char *)data,
                      isoimage);
    boot_sector_test(qts);
    qtest_quit(qts);
+12 −12
Original line number Diff line number Diff line
@@ -115,7 +115,7 @@ static void test_endianness(gconstpointer data)
{
    const TestCase *test = data;

    global_qtest = qtest_startf("-M %s%s%s -device pc-testdev",
    global_qtest = qtest_initf("-M %s%s%s -device pc-testdev",
                               test->machine,
                               test->superio ? " -device " : "",
                               test->superio ?: "");
@@ -187,7 +187,7 @@ static void test_endianness_split(gconstpointer data)
{
    const TestCase *test = data;

    global_qtest = qtest_startf("-M %s%s%s -device pc-testdev",
    global_qtest = qtest_initf("-M %s%s%s -device pc-testdev",
                               test->machine,
                               test->superio ? " -device " : "",
                               test->superio ?: "");
@@ -231,7 +231,7 @@ static void test_endianness_combine(gconstpointer data)
{
    const TestCase *test = data;

    global_qtest = qtest_startf("-M %s%s%s -device pc-testdev",
    global_qtest = qtest_initf("-M %s%s%s -device pc-testdev",
                               test->machine,
                               test->superio ? " -device " : "",
                               test->superio ?: "");
+1 −1
Original line number Diff line number Diff line
@@ -414,7 +414,7 @@ int main(int argc, char **argv)
    /* Run the tests */
    g_test_init(&argc, &argv, NULL);

    global_qtest = qtest_startf(
    global_qtest = qtest_initf(
        " -chardev socket,id=ipmi0,host=localhost,port=%d,reconnect=10"
        " -device ipmi-bmc-extern,chardev=ipmi0,id=bmc0"
        " -device isa-ipmi-bt,bmc=bmc0", emu_port);
Loading