Skip to contentSkip to conversation

Fix regression in object creation order

PATCH Applied Daniel P. Berrange 3 participants 6 messages Nov 25, 2015

lore
Share & tools
lore
#0 lore raw

cover Fix regression in object creation order

This fixes the regression in object creation warning identified by Paolo here:

https://lists.gnu.org/archive/html/qemu-devel/2015-11/msg04994.html

It provides an alternative fix to the original problem, by simply removing the warning message in question.

Daniel P. Berrange (2):
Revert "exec: silence hugetlbfs warning under qtest"
exec: remove warning about mempath and hugetlbfs

 exec.c |  6 ------
 vl.c   | 28 ++++++++++++++--------------
 2 files changed, 14 insertions(+), 20 deletions(-)
Signature · 1 line
2.5.0
#1 lore raw

PATCH 1/2 Revert "exec: silence hugetlbfs warning under qtest"

This reverts commit 1c7ba94a184df1eddd589d5400d879568d3e5d08.

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 f08f9271bfe3f19a5eb3d7a2f48532065304d5c8
Author: Daniel P. Berrange <[email protected]>
Date: Wed May 13 17:14:04 2015 +0100

vl: Create (most) objects before creating chardev backends

---
 exec.c |  5 +----
 vl.c   | 28 ++++++++++++++--------------
 2 files changed, 15 insertions(+), 18 deletions(-)
exec.c +1 -4
index acbd4a2..b09f18b 100644
@@ -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;
 }
vl.c +14 -14
index 525929b..4211ff1 100644
@@ -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");
Signature · 1 line
2.5.0
#2 lore raw

PATCH 2/2 exec: remove warning about mempath and hugetlbfs

In reply to Daniel P. Berrange

The gethugepagesize() method in exec.c printed a warning if the file path for "-mem-path" or "-object memory-backend-file" was not on a hugetlbfs filesystem. This warning is bogus, because QEMU functions perfectly well with the path on a regular tmpfs filesystem. Use of hugetlbfs vs tmpfs is a choice for the management application or end user to make as best fits their needs. As such it is inappropriate for QEMU to have an opinion on whether the user's choice is right or wrong in this case.

---
 exec.c | 3 ---
 1 file changed, 3 deletions(-)
exec.c +0 -3
index b09f18b..de1cf19 100644
@@ -1196,9 +1196,6 @@ static long gethugepagesize(const char *path, Error **errp)
         return 0;
     }
 
-    if (fs.f_type != HUGETLBFS_MAGIC)
-        fprintf(stderr, "Warning: path not on HugeTLBFS: %s\n", path);
-
     return fs.f_bsize;
 }
 
Signature · 1 line
2.5.0
#3 lore raw
In reply to Daniel P. Berrange
Quoted 7 lines · Daniel P. Berrange

This fixes the regression in object creation warning identified by Paolo here:

https://lists.gnu.org/archive/html/qemu-devel/2015-11/msg04994.html

It provides an alternative fix to the original problem, by simply removing the warning message in question.

Paolo, pls merge this if you see fit.

Quoted 10 lines

Daniel P. Berrange (2):
Revert "exec: silence hugetlbfs warning under qtest"
exec: remove warning about mempath and hugetlbfs

 exec.c |  6 ------
 vl.c   | 28 ++++++++++++++--------------
 2 files changed, 14 insertions(+), 20 deletions(-)
Signature · 1 line
2.5.0
#4 lore raw
Quoted 4 lines · Michael S. Tsirkin
Quoted 3 lines · Daniel P. Berrange

This fixes the regression in object creation warning identified by Paolo here:

Quoted 17 lines
Quoted 4 lines

https://lists.gnu.org/archive/html/qemu-devel/2015-11/msg04994.html

It provides an alternative fix to the original problem, by simply removing the warning message in question.

Paolo, pls merge this if you see fit.

Quoted 10 lines

Daniel P. Berrange (2):
Revert "exec: silence hugetlbfs warning under qtest"
exec: remove warning about mempath and hugetlbfs

 exec.c |  6 ------
 vl.c   | 28 ++++++++++++++--------------
 2 files changed, 14 insertions(+), 20 deletions(-)
Signature · 1 line
2.5.0

Yes, will do.

Paolo

#5 lore raw
In reply to Daniel P. Berrange
Quoted 8 lines · Daniel P. Berrange

This fixes the regression in object creation warning identified by Paolo here:

https://lists.gnu.org/archive/html/qemu-devel/2015-11/msg04994.html

It provides an alternative fix to the original problem, by simply removing the warning message in question.

Quoted 8 lines

Daniel P. Berrange (2):
Revert "exec: silence hugetlbfs warning under qtest"
exec: remove warning about mempath and hugetlbfs

 exec.c |  6 ------
 vl.c   | 28 ++++++++++++++--------------
 2 files changed, 14 insertions(+), 20 deletions(-)

Queued for 2.5-rc2, thanks.

Paolo