All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
Cc: Alexey Kardashevskiy <aik@ozlabs.ru>,
	qemu-ppc@nongnu.org, qemu-devel@nongnu.org, agraf@suse.de
Subject: Re: [Qemu-devel] [PATCH for-1.7] spapr: tie spapr-nvram to -pflash
Date: Mon, 09 Dec 2013 18:52:08 +0100	[thread overview]
Message-ID: <52A60348.6050809@redhat.com> (raw)
In-Reply-To: <1385112460-27156-1-git-send-email-pbonzini@redhat.com>

Il 22/11/2013 10:27, Paolo Bonzini ha scritto:
> spapr-nvram's drive property is currently connected to a non-existent
> "-machine nvram=<drivename>" option.  Instead, tie it to -pflash like
> other non-volatile RAM devices.  This provides the following possibilities
> for adding a backend for the sPAPR non-volatile RAM:
> 
> * -pflash filename
> 
> * -drive if=pflash,file=filename,format=raw,...
> 
> * -drive if=none,file=filename,format=raw,id=foo,... -global spapr-nvram.drive=foo
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  hw/ppc/spapr.c | 14 +++-----------
>  1 file changed, 3 insertions(+), 11 deletions(-)
> 
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index 7e53a5f..38b43c9 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -739,18 +739,10 @@ static void spapr_cpu_reset(void *opaque)
>  static void spapr_create_nvram(sPAPREnvironment *spapr)
>  {
>      DeviceState *dev = qdev_create(&spapr->vio_bus->bus, "spapr-nvram");
> -    const char *drivename = qemu_opt_get(qemu_get_machine_opts(), "nvram");
> +    DriveInfo *dinfo = drive_get(IF_PFLASH, 0, 0);
>  
> -    if (drivename) {
> -        BlockDriverState *bs;
> -
> -        bs = bdrv_find(drivename);
> -        if (!bs) {
> -            fprintf(stderr, "No such block device \"%s\" for nvram\n",
> -                    drivename);
> -            exit(1);
> -        }
> -        qdev_prop_set_drive_nofail(dev, "drive", bs);
> +    if (dinfo) {
> +        qdev_prop_set_drive_nofail(dev, "drive", dinfo->bdrv);
>      }
>  
>      qdev_init_nofail(dev);
> 

Ping?

Paolo

  reply	other threads:[~2013-12-09 17:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-22  9:27 [Qemu-devel] [PATCH for-1.7] spapr: tie spapr-nvram to -pflash Paolo Bonzini
2013-12-09 17:52 ` Paolo Bonzini [this message]
2013-12-09 19:25 ` Alexander Graf
2013-12-09 20:42   ` Paolo Bonzini
2013-12-10  2:02     ` Alexander Graf

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=52A60348.6050809@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=agraf@suse.de \
    --cc=aik@ozlabs.ru \
    --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.