From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49952) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0v6x-0003E4-Mj for qemu-devel@nongnu.org; Mon, 23 Nov 2015 12:41:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a0v6u-00083b-8C for qemu-devel@nongnu.org; Mon, 23 Nov 2015 12:41:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48951) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0v6u-00083X-0n for qemu-devel@nongnu.org; Mon, 23 Nov 2015 12:41:04 -0500 References: <1447694618-17177-3-git-send-email-marcandre.lureau@redhat.com> <1447837378-25222-1-git-send-email-marcandre.lureau@redhat.com> <20151118224821-mutt-send-email-mst@redhat.com> From: Paolo Bonzini Message-ID: <56534FAA.4090101@redhat.com> Date: Mon, 23 Nov 2015 18:40:58 +0100 MIME-Version: 1.0 In-Reply-To: <20151118224821-mutt-send-email-mst@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] exec: silence hugetlbfs warning under qtest List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" , marcandre.lureau@redhat.com Cc: Amit Shah , Peter Maydell , qemu-devel@nongnu.org On 18/11/2015 21:49, Michael S. Tsirkin wrote: > On Wed, Nov 18, 2015 at 10:02:58AM +0100, marcandre.lureau@redhat.com w= rote: >> From: Marc-Andr=E9 Lureau >> >> vhost-user-test prints a warning. A test should not need to run on >> hugetlbfs, let's silence the warning under qtest. The >> condition can't check on qtest_enabled() since vhost-user-test actuall= y >> doesn't use qtest accel. However, qtest_driver() can be used, if >> qtest_init() is called early enough. For that reason, move chardev and >> qtest initialization early. >> >> Signed-off-by: Marc-Andr=E9 Lureau >=20 > Seems ok, and let us bring back the 2.4 test that was > dropped in 2.5, but I'd like an ack on this from someone else. I wonder if we need the warning at all, but this patch is okay. Anyhow: - if (qemu_opts_foreach(qemu_find_opts("object"), - object_create, - object_create_initial, NULL)) { + if (qemu_opts_foreach(qemu_find_opts("chardev"), + chardev_init_func, NULL, NULL)) { exit(1); } - if (qemu_opts_foreach(qemu_find_opts("chardev"), - chardev_init_func, NULL, NULL)) { + if (qtest_chrdev) { + Error *local_err =3D 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); } Before: object-initial, chardev, qtest, object-late (not in the patch) After: chardev, qtest, object-initial, object-late (not in the patch) Objects must be initialized before chardev (except rng-egd) since in the future chardev will need to use objects, in particular secret objects. Was the swap intentional? Paolo @@ -4325,15 +4334,6 @@ int main(int argc, char **argv, char **envp) configure_accelerator(current_machine); - if (qtest_chrdev) { - Error *local_err =3D NULL; - qtest_init(qtest_chrdev, qtest_log, &local_err); - if (local_err) { - error_report_err(local_err); - exit(1); - } - } > Anyone? >=20 >> --- >> exec.c | 5 ++++- >> vl.c | 28 ++++++++++++++-------------- >> 2 files changed, 18 insertions(+), 15 deletions(-) >> >> diff --git a/exec.c b/exec.c >> index b09f18b..acbd4a2 100644 >> --- a/exec.c >> +++ b/exec.c >> @@ -51,6 +51,7 @@ >> #include "qemu/main-loop.h" >> #include "translate-all.h" >> #include "sysemu/replay.h" >> +#include "sysemu/qtest.h" >> =20 >> #include "exec/memory-internal.h" >> #include "exec/ram_addr.h" >> @@ -1196,8 +1197,10 @@ static long gethugepagesize(const char *path, E= rror **errp) >> return 0; >> } >> =20 >> - if (fs.f_type !=3D HUGETLBFS_MAGIC) >> + if (!qtest_driver() && >> + fs.f_type !=3D HUGETLBFS_MAGIC) { >> fprintf(stderr, "Warning: path not on HugeTLBFS: %s\n", path)= ; >> + } >> =20 >> return fs.f_bsize; >> } >> diff --git a/vl.c b/vl.c >> index 7d993a5..f9c661a 100644 >> --- a/vl.c >> +++ b/vl.c >> @@ -4288,14 +4288,23 @@ int main(int argc, char **argv, char **envp) >> page_size_init(); >> socket_init(); >> =20 >> - if (qemu_opts_foreach(qemu_find_opts("object"), >> - object_create, >> - object_create_initial, NULL)) { >> + if (qemu_opts_foreach(qemu_find_opts("chardev"), >> + chardev_init_func, NULL, NULL)) { >> exit(1); >> } >> =20 >> - if (qemu_opts_foreach(qemu_find_opts("chardev"), >> - chardev_init_func, NULL, NULL)) { >> + if (qtest_chrdev) { >> + Error *local_err =3D 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); >> } >> =20 >> @@ -4325,15 +4334,6 @@ int main(int argc, char **argv, char **envp) >> =20 >> configure_accelerator(current_machine); >> =20 >> - if (qtest_chrdev) { >> - Error *local_err =3D NULL; >> - qtest_init(qtest_chrdev, qtest_log, &local_err); >> - if (local_err) { >> - error_report_err(local_err); >> - exit(1); >> - } >> - } >> - >> machine_opts =3D qemu_get_machine_opts(); >> kernel_filename =3D qemu_opt_get(machine_opts, "kernel"); >> initrd_filename =3D qemu_opt_get(machine_opts, "initrd"); >> --=20 >> 2.5.0