qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/1] NUMA queue, 2015-07-22
@ 2015-07-22 18:11 Eduardo Habkost
  2015-07-22 18:11 ` [Qemu-devel] [PULL 1/1] hostmem: Fix qemu_opt_get_bool() crash in host_memory_backend_init() Eduardo Habkost
  2015-07-23 14:57 ` [Qemu-devel] [PULL 0/1] NUMA queue, 2015-07-22 Peter Maydell
  0 siblings, 2 replies; 3+ messages in thread
From: Eduardo Habkost @ 2015-07-22 18:11 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Paolo Bonzini, qemu-devel, Marcel Apfelbaum

The following changes since commit b69b30532e0a80e25449244c01b0cbed000c99a3:

  Update version for v2.4.0-rc2 release (2015-07-22 18:17:19 +0100)

are available in the git repository at:

  git://github.com/ehabkost/qemu.git tags/numa-pull-request

for you to fetch changes up to 6b2699672d5b56f8c2902fb9db9879e8cafb2afe:

  hostmem: Fix qemu_opt_get_bool() crash in host_memory_backend_init() (2015-07-22 15:09:25 -0300)

----------------------------------------------------------------
NUMA queue, 2015-07-22

----------------------------------------------------------------

Eduardo Habkost (1):
  hostmem: Fix qemu_opt_get_bool() crash in host_memory_backend_init()

 backends/hostmem.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

-- 
2.1.0

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Qemu-devel] [PULL 1/1] hostmem: Fix qemu_opt_get_bool() crash in host_memory_backend_init()
  2015-07-22 18:11 [Qemu-devel] [PULL 0/1] NUMA queue, 2015-07-22 Eduardo Habkost
@ 2015-07-22 18:11 ` Eduardo Habkost
  2015-07-23 14:57 ` [Qemu-devel] [PULL 0/1] NUMA queue, 2015-07-22 Peter Maydell
  1 sibling, 0 replies; 3+ messages in thread
From: Eduardo Habkost @ 2015-07-22 18:11 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Paolo Bonzini, qemu-devel, Marcel Apfelbaum

This fixes the following crash, introduced by commit
49d2e648e8087d154d8bf8b91f27c8e05e79d5a6:

  $ gdb --args qemu-system-x86_64 -machine pc,mem-merge=off -object memory-backend-ram,id=ram-node0,size=1024
  [...]
  Program received signal SIGABRT, Aborted.
  (gdb) bt
  #0  0x00007ffff253b8c7 in raise () at /lib64/libc.so.6
  #1  0x00007ffff253d52a in abort () at /lib64/libc.so.6
  #2  0x00007ffff253446d in __assert_fail_base () at /lib64/libc.so.6
  #3  0x00007ffff2534522 in  () at /lib64/libc.so.6
  #4  0x00005555558bb80a in qemu_opt_get_bool_helper (opts=0x55555621b650, name=name@entry=0x5555558ec922 "mem-merge", defval=defval@entry=true, del=del@entry=false) at qemu/util/qemu-option.c:388
  #5  0x00005555558bbb5a in qemu_opt_get_bool (opts=<optimized out>, name=name@entry=0x5555558ec922 "mem-merge", defval=defval@entry=true) at qemu/util/qemu-option.c:398
  #6  0x0000555555720a24 in host_memory_backend_init (obj=0x5555562ac970) at qemu/backends/hostmem.c:226

Instead of using qemu_opt_get_bool(), that didn't work with
qemu_machine_opts for a long time, we can use the corresponding
MachineState fields.

Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 backends/hostmem.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/backends/hostmem.c b/backends/hostmem.c
index 61c1ac0..41ba2af 100644
--- a/backends/hostmem.c
+++ b/backends/hostmem.c
@@ -10,6 +10,7 @@
  * See the COPYING file in the top-level directory.
  */
 #include "sysemu/hostmem.h"
+#include "hw/boards.h"
 #include "qapi/visitor.h"
 #include "qapi-types.h"
 #include "qapi-visit.h"
@@ -222,11 +223,10 @@ static void host_memory_backend_set_prealloc(Object *obj, bool value,
 static void host_memory_backend_init(Object *obj)
 {
     HostMemoryBackend *backend = MEMORY_BACKEND(obj);
+    MachineState *machine = MACHINE(qdev_get_machine());
 
-    backend->merge = qemu_opt_get_bool(qemu_get_machine_opts(),
-                                       "mem-merge", true);
-    backend->dump = qemu_opt_get_bool(qemu_get_machine_opts(),
-                                      "dump-guest-core", true);
+    backend->merge = machine_mem_merge(machine);
+    backend->dump = machine_dump_guest_core(machine);
     backend->prealloc = mem_prealloc;
 
     object_property_add_bool(obj, "merge",
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PULL 0/1] NUMA queue, 2015-07-22
  2015-07-22 18:11 [Qemu-devel] [PULL 0/1] NUMA queue, 2015-07-22 Eduardo Habkost
  2015-07-22 18:11 ` [Qemu-devel] [PULL 1/1] hostmem: Fix qemu_opt_get_bool() crash in host_memory_backend_init() Eduardo Habkost
@ 2015-07-23 14:57 ` Peter Maydell
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2015-07-23 14:57 UTC (permalink / raw)
  To: Eduardo Habkost; +Cc: Paolo Bonzini, QEMU Developers, Marcel Apfelbaum

On 22 July 2015 at 19:11, Eduardo Habkost <ehabkost@redhat.com> wrote:
> The following changes since commit b69b30532e0a80e25449244c01b0cbed000c99a3:
>
>   Update version for v2.4.0-rc2 release (2015-07-22 18:17:19 +0100)
>
> are available in the git repository at:
>
>   git://github.com/ehabkost/qemu.git tags/numa-pull-request
>
> for you to fetch changes up to 6b2699672d5b56f8c2902fb9db9879e8cafb2afe:
>
>   hostmem: Fix qemu_opt_get_bool() crash in host_memory_backend_init() (2015-07-22 15:09:25 -0300)
>
> ----------------------------------------------------------------
> NUMA queue, 2015-07-22
>
> ----------------------------------------------------------------

Applied, thanks.

-- PMM

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-07-23 14:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-22 18:11 [Qemu-devel] [PULL 0/1] NUMA queue, 2015-07-22 Eduardo Habkost
2015-07-22 18:11 ` [Qemu-devel] [PULL 1/1] hostmem: Fix qemu_opt_get_bool() crash in host_memory_backend_init() Eduardo Habkost
2015-07-23 14:57 ` [Qemu-devel] [PULL 0/1] NUMA queue, 2015-07-22 Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).