Commit 2c189a4e authored by Daniel P. Berrangé's avatar Daniel P. Berrangé Committed by Paolo Bonzini
Browse files

Revert "exec: silence hugetlbfs warning under qtest"



This reverts commit 1c7ba94a.

That commit changed QEMU initialization order from

 - object-initial, chardev, qtest, object-late

to

 - chardev, qtest, object-initial, object-late

This breaks chardev setups which need to rely on objects
having been created. For example, when chardevs use TLS
encryption in the future, they need to have tls credential
objects created first.

This revert, restores the ordering introduced in

  commit f08f9271
  Author: Daniel P. Berrange <berrange@redhat.com>
  Date:   Wed May 13 17:14:04 2015 +0100

    vl: Create (most) objects before creating chardev backends

Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
Message-Id: <1448448749-1332-2-git-send-email-berrange@redhat.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent b2780d32
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -51,7 +51,6 @@
#include "qemu/main-loop.h"
#include "translate-all.h"
#include "sysemu/replay.h"
#include "sysemu/qtest.h"

#include "exec/memory-internal.h"
#include "exec/ram_addr.h"
@@ -1197,10 +1196,8 @@ static long gethugepagesize(const char *path, Error **errp)
        return 0;
    }

    if (!qtest_driver() &&
        fs.f_type != HUGETLBFS_MAGIC) {
    if (fs.f_type != HUGETLBFS_MAGIC)
        fprintf(stderr, "Warning: path not on HugeTLBFS: %s\n", path);
    }

    return fs.f_bsize;
}
+14 −14
Original line number Diff line number Diff line
@@ -4291,26 +4291,17 @@ int main(int argc, char **argv, char **envp)
    page_size_init();
    socket_init();

    if (qemu_opts_foreach(qemu_find_opts("chardev"),
                          chardev_init_func, NULL, NULL)) {
        exit(1);
    }

    if (qtest_chrdev) {
        Error *local_err = NULL;
        qtest_init(qtest_chrdev, qtest_log, &local_err);
        if (local_err) {
            error_report_err(local_err);
            exit(1);
        }
    }

    if (qemu_opts_foreach(qemu_find_opts("object"),
                          object_create,
                          object_create_initial, NULL)) {
        exit(1);
    }

    if (qemu_opts_foreach(qemu_find_opts("chardev"),
                          chardev_init_func, NULL, NULL)) {
        exit(1);
    }

#ifdef CONFIG_VIRTFS
    if (qemu_opts_foreach(qemu_find_opts("fsdev"),
                          fsdev_init_func, NULL, NULL)) {
@@ -4337,6 +4328,15 @@ int main(int argc, char **argv, char **envp)

    configure_accelerator(current_machine);

    if (qtest_chrdev) {
        Error *local_err = NULL;
        qtest_init(qtest_chrdev, qtest_log, &local_err);
        if (local_err) {
            error_report_err(local_err);
            exit(1);
        }
    }

    machine_opts = qemu_get_machine_opts();
    kernel_filename = qemu_opt_get(machine_opts, "kernel");
    initrd_filename = qemu_opt_get(machine_opts, "initrd");