qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [Qemu-ppc] RFC: NVRAM for pseries machine


From: Anthony Liguori
Subject: Re: [Qemu-devel] [Qemu-ppc] RFC: NVRAM for pseries machine
Date: Wed, 26 Sep 2012 15:03:15 -0500
User-agent: Notmuch/0.13.2+93~ged93d79 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu)

Alexander Graf <address@hidden> writes:

> On 22.09.2012, at 15:31, Blue Swirl <address@hidden> wrote:
>
>> On Fri, Sep 21, 2012 at 3:08 AM, David Gibson
>> <address@hidden> wrote:
>>> Below is a patch which implements the (PAPR mandated) NVRAM for the
>>> pseries machine.  It raises a couple of generic questions.
>>> 
>>> First, this adds a new "nvram" machine option which is used to give a
>>> block device id to back the NVRAM so it is persistent.  Since some
>>> sort of NVRAM is quite common, it seems this might be useful on other
>>> machines one day, although obviously nothing else implements it yet.
>> 
>> Yes, there have been discussions earlier since loading NVRAM contents
>> from a file would be useful for many architectures too.
>> 
>>> 
>>> Second, if a block device is not specified, it simply allocates a
>>> block of memory to make a non-persistent NVRAM.  Obviously that isn't
>>> really "NV", but it's enough to make many guests happy most of the
>>> time, and doesn't require setting up an image file and drive.  It does
>>> mean a different set of code paths in the driver though, and it will
>>> need special case handling for savevm (not implemented yet).  Is this
>>> the right approach, or should I be creating a dummy block device for a
>>> one-run NVRAM of this kind?  I couldn't see an obvious way to do that,
>>> but maybe I'm missing something.
>> 
>> That was the problem earlier too, it looks like a generic way for all
>> NVRAM/flash devices should be obvious but so far nobody has been able
>> to propose something.
>> 
>> What if there are two devices which could use this, for example CMOS
>> and flash on x86?
>> 
>> This should be extending  -device syntax rather than adding another
>> top level option. Something like
>> -drive foo,file=nvram.qcow2,format=qcow2,id=main_nvram -device
>> spapr-nvram,drive_id=main_nvram
>
> Could we create a simplified syntax for this in addition? Something like
>
>   -device spapr-nvram,file=nvram.raw
>
> which would then automatically spawn a drive for the user. Saving the
> machine state would obviously save the transparently created drive.

We can't ask people to rewrite half of QEMU just to merge a feature.

In this case, what matters is:

0) The device should always be modelled with QOM/qdev

1) If the device is a fundamental part of the machine (i.e. you can't do
   anything useful with out it), then it's configuration should be
   specified as a machine parameter.

2) If !(1), the device should be added with -device

3) Devices deal with backends and only with backends.  We have a syntax
   for specifying backends independently of backends.

If you want a single option to configure a device, that's a problem to
attempt to solve independent of this series.

> But I don't want to force people to have to use -device syntax for the
> average qemu use cases.

Sorry, but that's where we're at today.  -device is part of our user
interface.  It's a management tool only interface and we cannot
replicate every option just because you don't like the syntax.

Regards,

Anthony Liguori



reply via email to

[Prev in Thread] Current Thread [Next in Thread]