From: Paolo Bonzini <pbonzini@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>, marcandre.lureau@redhat.com
Cc: Amit Shah <amit.shah@redhat.com>,
Peter Maydell <peter.maydell@linaro.org>,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] exec: silence hugetlbfs warning under qtest
Date: Mon, 23 Nov 2015 18:40:58 +0100 [thread overview]
Message-ID: <56534FAA.4090101@redhat.com> (raw)
In-Reply-To: <20151118224821-mutt-send-email-mst@redhat.com>
On 18/11/2015 21:49, Michael S. Tsirkin wrote:
> On Wed, Nov 18, 2015 at 10:02:58AM +0100, marcandre.lureau@redhat.com wrote:
>> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>>
>> 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 actually
>> 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é Lureau <marcandre.lureau@redhat.com>
>
> 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 = 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 = NULL;
- qtest_init(qtest_chrdev, qtest_log, &local_err);
- if (local_err) {
- error_report_err(local_err);
- exit(1);
- }
- }
> Anyone?
>
>> ---
>> 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"
>>
>> #include "exec/memory-internal.h"
>> #include "exec/ram_addr.h"
>> @@ -1196,8 +1197,10 @@ static long gethugepagesize(const char *path, Error **errp)
>> return 0;
>> }
>>
>> - if (fs.f_type != HUGETLBFS_MAGIC)
>> + if (!qtest_driver() &&
>> + fs.f_type != HUGETLBFS_MAGIC) {
>> fprintf(stderr, "Warning: path not on HugeTLBFS: %s\n", path);
>> + }
>>
>> 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();
>>
>> - 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 = 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);
>> }
>>
>> @@ -4325,15 +4334,6 @@ 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");
>> --
>> 2.5.0
next prev parent reply other threads:[~2015-11-23 17:41 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-16 17:23 [Qemu-devel] [PATCH 1/3] tests: define qtest-obj-y before using it marcandre.lureau
2015-11-16 17:23 ` [Qemu-devel] [PATCH 2/3] tests: re-enable vhost-user-test marcandre.lureau
2015-11-16 17:23 ` [Qemu-devel] [PATCH 3/3] exec: silence hugetlbfs warning under qtest marcandre.lureau
2015-11-16 21:50 ` Michael S. Tsirkin
2015-11-17 21:32 ` Marc-André Lureau
2015-11-18 8:32 ` Markus Armbruster
2015-11-18 9:02 ` [Qemu-devel] [PATCH] " marcandre.lureau
2015-11-18 20:49 ` Michael S. Tsirkin
2015-11-23 17:40 ` Paolo Bonzini [this message]
2015-11-23 17:46 ` Daniel P. Berrange
2015-11-23 17:49 ` Daniel P. Berrange
2015-11-23 18:01 ` Marc-André Lureau
2015-11-23 18:10 ` Daniel P. Berrange
2015-11-24 14:10 ` Michael S. Tsirkin
2015-11-24 14:19 ` Daniel P. Berrange
2015-11-24 14:25 ` Michael S. Tsirkin
2015-11-24 14:30 ` Daniel P. Berrange
2015-11-24 14:30 ` Paolo Bonzini
2015-11-24 15:29 ` Michael S. Tsirkin
2015-11-24 15:09 ` Markus Armbruster
2015-11-24 14:12 ` Michael S. Tsirkin
-- strict thread matches above, loose matches on Subject: below --
2015-10-27 16:29 marcandre.lureau
2015-10-27 18:37 ` Michael S. Tsirkin
2015-10-29 9:10 ` Michael S. Tsirkin
2015-11-08 17:02 ` Michael S. Tsirkin
2015-11-09 7:50 ` Markus Armbruster
2015-11-12 11:54 ` Michael S. Tsirkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56534FAA.4090101@redhat.com \
--to=pbonzini@redhat.com \
--cc=amit.shah@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=mst@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.