All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kurz <groug@kaod.org>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Daniel Henrique Barboza <danielhb413@gmail.com>,
	qemu-ppc@nongnu.org, qemu-devel@nongnu.org,
	David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [PATCH 1/1] spapr.c: set a 'kvm-type' default value instead of relying on NULL
Date: Thu, 10 Dec 2020 13:47:05 +0100	[thread overview]
Message-ID: <20201210134705.6adaf940@bahia.lan> (raw)
In-Reply-To: <ffee7463-13e9-0bd2-a3c3-c6239a861be8@redhat.com>

On Thu, 10 Dec 2020 13:34:59 +0100
Paolo Bonzini <pbonzini@redhat.com> wrote:

> To sum up everything:
> 

LGTM

> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index 2d5aeeb45a..61f0963916 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -3028,11 +3028,11 @@ static int spapr_kvm_type(MachineState *machine, 
> const char *vm_type)
>           return 0;
>       }
> 
> -    if (!strcmp(vm_type, "HV")) {
> +    if (!g_ascii_strcasecmp(vm_type, "hv")) {
>           return 1;
>       }
> 
> -    if (!strcmp(vm_type, "PR")) {
> +    if (!g_ascii_strcasecmp(vm_type, "pr")) {
>           return 2;
>       }
> 
> @@ -3132,16 +3132,6 @@ static char *spapr_get_kvm_type(Object *obj, 
> Error **errp)
>   {
>       SpaprMachineState *spapr = SPAPR_MACHINE(obj);
> 
> -    /*
> -     * In case the user didn't set 'kvm-type', return DEFAULT_KVM_TYPE
> -     * instead of NULL. This allows us to be more predictable with what
> -     * is expected to happen in spapr_kvm_type(), since we can stop relying
> -     * on receiving a 'NULL' parameter as a valid input there.
> -     */
> -    if (!spapr->kvm_type) {
> -        return g_strdup(DEFAULT_KVM_TYPE);
> -    }
> -
>       return g_strdup(spapr->kvm_type);
>   }
> 
> @@ -3294,11 +3284,13 @@ static void spapr_instance_init(Object *obj)
> 
>       spapr->htab_fd = -1;
>       spapr->use_hotplug_event_source = true;
> +
> +    spapr->kvm_type = g_strdup(DEFAULT_KVM_TYPE);
>       object_property_add_str(obj, "kvm-type",
>                               spapr_get_kvm_type, spapr_set_kvm_type);
>       object_property_set_description(obj, "kvm-type",
> -                                    "Specifies the KVM virtualization 
> mode (HV, PR)."
> -                                    " If not specified, defaults to any 
> available KVM"
> +                                    "Specifies the KVM virtualization 
> mode (hv, pr, auto)."
> +                                    " auto is the default and allows 
> any available KVM"
>                                       " module loaded in the host. In 
> case both kvm_hv"
>                                       " and kvm_pr are loaded, kvm_hv 
> takes precedence.");
> 



  reply	other threads:[~2020-12-10 13:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-08 13:45 [PATCH 1/1] spapr.c: set a 'kvm-type' default value instead of relying on NULL Daniel Henrique Barboza
2020-12-08 14:33 ` Greg Kurz
2020-12-08 15:32   ` Daniel Henrique Barboza
2020-12-10  3:37     ` David Gibson
2020-12-10 12:34       ` Paolo Bonzini
2020-12-10 12:47         ` Greg Kurz [this message]
2020-12-10 13:10           ` Daniel Henrique Barboza
2020-12-10 13:49             ` Greg Kurz

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=20201210134705.6adaf940@bahia.lan \
    --to=groug@kaod.org \
    --cc=danielhb413@gmail.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@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.