qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Marcel Apfelbaum <marcel@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: peter.maydell@linaro.org, peter.crosthwaite@xilinx.com,
	james.hogan@imgtec.com, jan.kiszka@siemens.com,
	cornelia.huck@de.ibm.com, qemu-devel@nongnu.org, agraf@suse.de,
	borntraeger@de.ibm.com, scottwood@freescale.com,
	pbonzini@redhat.com, leon.alrae@imgtec.com, aurelien@aurel32.net
Subject: Re: [Qemu-devel] [PATCH 8/8] machine: query mem-merge machine property rather than qemu opts
Date: Tue, 10 Mar 2015 18:22:16 +0200	[thread overview]
Message-ID: <54FF1A38.6010105@redhat.com> (raw)
In-Reply-To: <20150310161115-mutt-send-email-mst@redhat.com>

On 03/10/2015 05:11 PM, Michael S. Tsirkin wrote:
> On Wed, Feb 04, 2015 at 05:43:55PM +0200, Marcel Apfelbaum wrote:
>> Fixes a QEMU crash when passing mem_merge parameter in command line.
>>
>> Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
>
> Can you rebase this one on top of my pci branch pls?
I'll submit again only 8/8 after rebase.

Thanks,
Marcel
>
>> ---
>>   exec.c              | 2 +-
>>   hw/core/machine.c   | 6 ++++++
>>   include/hw/boards.h | 1 +
>>   3 files changed, 8 insertions(+), 1 deletion(-)
>>
>> diff --git a/exec.c b/exec.c
>> index bfca528..becd122 100644
>> --- a/exec.c
>> +++ b/exec.c
>> @@ -1277,7 +1277,7 @@ void qemu_ram_unset_idstr(ram_addr_t addr)
>>
>>   static int memory_try_enable_merging(void *addr, size_t len)
>>   {
>> -    if (!qemu_opt_get_bool(qemu_get_machine_opts(), "mem-merge", true)) {
>> +    if (!machine_mem_merge(current_machine)) {
>>           /* disabled by the user */
>>           return 0;
>>       }
>> diff --git a/hw/core/machine.c b/hw/core/machine.c
>> index 8033683..e3a3e2a 100644
>> --- a/hw/core/machine.c
>> +++ b/hw/core/machine.c
>> @@ -286,6 +286,7 @@ static void machine_initfn(Object *obj)
>>       ms->kernel_irqchip_allowed = true;
>>       ms->kvm_shadow_mem = -1;
>>       ms->dump_guest_core = true;
>> +    ms->mem_merge = true;
>>
>>       object_property_add_str(obj, "accel",
>>                               machine_get_accel, machine_set_accel, NULL);
>> @@ -431,6 +432,11 @@ bool machine_dump_guest_core(MachineState *machine)
>>       return machine->dump_guest_core;
>>   }
>>
>> +bool machine_mem_merge(MachineState *machine)
>> +{
>> +    return machine->mem_merge;
>> +}
>> +
>>   static const TypeInfo machine_info = {
>>       .name = TYPE_MACHINE,
>>       .parent = TYPE_OBJECT,
>> diff --git a/include/hw/boards.h b/include/hw/boards.h
>> index 7de308e..f44d6f5 100644
>> --- a/include/hw/boards.h
>> +++ b/include/hw/boards.h
>> @@ -72,6 +72,7 @@ bool machine_kernel_irqchip_required(MachineState *machine);
>>   int machine_kvm_shadow_mem(MachineState *machine);
>>   int machine_phandle_start(MachineState *machine);
>>   bool machine_dump_guest_core(MachineState *machine);
>> +bool machine_mem_merge(MachineState *machine);
>>
>>   /**
>>    * MachineClass:
>> --
>> 2.1.0

  reply	other threads:[~2015-03-10 16:22 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-04 15:43 [Qemu-devel] [PATCH 0/8] machine: query machine properties rather than qemu opts Marcel Apfelbaum
2015-02-04 15:43 ` [Qemu-devel] [PATCH 1/8] machine: query iommu machine property " Marcel Apfelbaum
2015-02-04 16:47   ` Markus Armbruster
2015-02-04 19:30     ` Marcel Apfelbaum
2015-02-05  8:18       ` Markus Armbruster
2015-03-11 14:43   ` Marcel Apfelbaum
2015-02-04 15:43 ` [Qemu-devel] [PATCH 2/8] hw/machine: kernel-irqchip property support for allowed/required Marcel Apfelbaum
2015-02-04 15:43 ` [Qemu-devel] [PATCH 3/8] machine: query kernel-irqchip machine property rather than qemu opts Marcel Apfelbaum
2015-03-11 14:41   ` Marcel Apfelbaum
2015-02-04 15:43 ` [Qemu-devel] [PATCH 4/8] kvm: add machine state to kvm_arch_init Marcel Apfelbaum
2015-02-04 15:43 ` [Qemu-devel] [PATCH 5/8] machine: query kvm-shadow-mem machine property rather than qemu opts Marcel Apfelbaum
2015-03-11 14:37   ` Marcel Apfelbaum
2015-02-04 15:43 ` [Qemu-devel] [PATCH 6/8] machine: query phandle-start " Marcel Apfelbaum
2015-03-11 14:32   ` Marcel Apfelbaum
2015-03-11 14:34     ` Marcel Apfelbaum
2015-03-11 14:39     ` Michael S. Tsirkin
2015-03-11 14:48       ` Marcel Apfelbaum
2015-02-04 15:43 ` [Qemu-devel] [PATCH 7/8] machine: query dump-guest-core " Marcel Apfelbaum
2015-03-10 17:50   ` Andreas Färber
2015-03-10 21:24     ` Michael S. Tsirkin
2015-03-10 21:36       ` Andreas Färber
2015-03-11  7:34         ` Markus Armbruster
2015-03-11  8:45           ` Michael S. Tsirkin
2015-03-11  9:42             ` Marcel Apfelbaum
2015-03-11  8:56         ` Michael S. Tsirkin
2015-03-11 11:06           ` Andreas Färber
2015-03-11 13:04             ` Marcel Apfelbaum
2015-03-11 14:22             ` Michael S. Tsirkin
2015-03-11 15:08           ` Markus Armbruster
2015-03-11  9:44         ` Marcel Apfelbaum
2015-03-11 14:25   ` Marcel Apfelbaum
2015-02-04 15:43 ` [Qemu-devel] [PATCH 8/8] machine: query mem-merge " Marcel Apfelbaum
2015-03-10 15:11   ` Michael S. Tsirkin
2015-03-10 16:22     ` Marcel Apfelbaum [this message]
2015-02-04 16:00 ` [Qemu-devel] [PATCH 0/8] machine: query machine properties " Paolo Bonzini
2015-02-04 19:45 ` Christian Borntraeger
2015-02-04 21:35   ` Marcel Apfelbaum
2015-02-04 22:10     ` Christian Borntraeger
2015-02-25 11:55 ` Marcel Apfelbaum
2015-03-04 15:37   ` Marcel Apfelbaum

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=54FF1A38.6010105@redhat.com \
    --to=marcel@redhat.com \
    --cc=agraf@suse.de \
    --cc=aurelien@aurel32.net \
    --cc=borntraeger@de.ibm.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=james.hogan@imgtec.com \
    --cc=jan.kiszka@siemens.com \
    --cc=leon.alrae@imgtec.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.crosthwaite@xilinx.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=scottwood@freescale.com \
    /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 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).