qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH for-1.7] spapr: tie spapr-nvram to -pflash
@ 2013-11-22  9:27 Paolo Bonzini
  2013-12-09 17:52 ` Paolo Bonzini
  2013-12-09 19:25 ` Alexander Graf
  0 siblings, 2 replies; 5+ messages in thread
From: Paolo Bonzini @ 2013-11-22  9:27 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alexey Kardashevskiy, qemu-ppc, agraf

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);
-- 
1.8.4.2

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

* Re: [Qemu-devel] [PATCH for-1.7] spapr: tie spapr-nvram to -pflash
  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
  2013-12-09 19:25 ` Alexander Graf
  1 sibling, 0 replies; 5+ messages in thread
From: Paolo Bonzini @ 2013-12-09 17:52 UTC (permalink / raw)
  Cc: Alexey Kardashevskiy, qemu-ppc, qemu-devel, agraf

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

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

* Re: [Qemu-devel] [PATCH for-1.7] spapr: tie spapr-nvram to -pflash
  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
@ 2013-12-09 19:25 ` Alexander Graf
  2013-12-09 20:42   ` Paolo Bonzini
  1 sibling, 1 reply; 5+ messages in thread
From: Alexander Graf @ 2013-12-09 19:25 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Alexey Kardashevskiy, qemu-ppc@nongnu.org, qemu-devel@nongnu.org



> Am 22.11.2013 um 10:27 schrieb Paolo Bonzini <pbonzini@redhat.com>:
> 
> 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>

Makes sense, but why for 1.7?

Alex

> ---
> 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);
> -- 
> 1.8.4.2
> 

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

* Re: [Qemu-devel] [PATCH for-1.7] spapr: tie spapr-nvram to -pflash
  2013-12-09 19:25 ` Alexander Graf
@ 2013-12-09 20:42   ` Paolo Bonzini
  2013-12-10  2:02     ` Alexander Graf
  0 siblings, 1 reply; 5+ messages in thread
From: Paolo Bonzini @ 2013-12-09 20:42 UTC (permalink / raw)
  To: Alexander Graf
  Cc: Alexey Kardashevskiy, qemu-ppc@nongnu.org, qemu-devel@nongnu.org

Il 09/12/2013 20:25, Alexander Graf ha scritto:
> 
> 
>> Am 22.11.2013 um 10:27 schrieb Paolo Bonzini <pbonzini@redhat.com>:
>>
>> 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>
> 
> Makes sense, but why for 1.7?

At this point it is not for 1.7 of course. :)

Paolo

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

* Re: [Qemu-devel] [PATCH for-1.7] spapr: tie spapr-nvram to -pflash
  2013-12-09 20:42   ` Paolo Bonzini
@ 2013-12-10  2:02     ` Alexander Graf
  0 siblings, 0 replies; 5+ messages in thread
From: Alexander Graf @ 2013-12-10  2:02 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Alexey Kardashevskiy, qemu-ppc@nongnu.org, qemu-devel@nongnu.org


On 09.12.2013, at 21:42, Paolo Bonzini <pbonzini@redhat.com> wrote:

> Il 09/12/2013 20:25, Alexander Graf ha scritto:
>> 
>> 
>>> Am 22.11.2013 um 10:27 schrieb Paolo Bonzini <pbonzini@redhat.com>:
>>> 
>>> 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>
>> 
>> Makes sense, but why for 1.7?
> 
> At this point it is not for 1.7 of course. :)

Heh alrighty then :). Thanks, applied to ppc-next.


Alex

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

end of thread, other threads:[~2013-12-10  1:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2013-12-09 19:25 ` Alexander Graf
2013-12-09 20:42   ` Paolo Bonzini
2013-12-10  2:02     ` Alexander Graf

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).