Received: from eggs.gnu.org ([208.118.235.92]:58000) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGya6-0004C0-5H for qemu-devel@nongnu.org; Wed, 26 Sep 2012 16:51:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TGya4-0003Rf-Lm for qemu-devel@nongnu.org; Wed, 26 Sep 2012 16:51:42 -0400 References: <1348196931-9660-1-git-send-email-david@gibson.dropbear.id.au> <219EFEC6-657A-48CA-886E-892636C7DCEA@suse.de> <87zk4cv9fg.fsf@codemonkey.ws> In-Reply-To: <87zk4cv9fg.fsf@codemonkey.ws> Mime-Version: 1.0 (1.0) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Message-Id: From: Alexander Graf Date: Wed, 26 Sep 2012 22:51:49 +0200 Subject: Re: [Qemu-devel] [Qemu-ppc] RFC: NVRAM for pseries machine List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Blue Swirl , "qemu-ppc@nongnu.org" , "qemu-devel@nongnu.org" , David Gibson On 26.09.2012, at 22:03, Anthony Liguori wrote: > Alexander Graf writes: >=20 >> On 22.09.2012, at 15:31, Blue Swirl wrote: >>=20 >>> On Fri, Sep 21, 2012 at 3:08 AM, David Gibson >>> wrote: >>>> Below is a patch which implements the (PAPR mandated) NVRAM for the >>>> pseries machine. It raises a couple of generic questions. >>>>=20 >>>> 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. >>>=20 >>> Yes, there have been discussions earlier since loading NVRAM contents >>> from a file would be useful for many architectures too. >>>=20 >>>>=20 >>>> 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. >>>=20 >>> 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. >>>=20 >>> What if there are two devices which could use this, for example CMOS >>> and flash on x86? >>>=20 >>> This should be extending -device syntax rather than adding another >>> top level option. Something like >>> -drive foo,file=3Dnvram.qcow2,format=3Dqcow2,id=3Dmain_nvram -device >>> spapr-nvram,drive_id=3Dmain_nvram >>=20 >> Could we create a simplified syntax for this in addition? Something like >>=20 >> -device spapr-nvram,file=3Dnvram.raw >>=20 >> which would then automatically spawn a drive for the user. Saving the >> machine state would obviously save the transparently created drive. >=20 > We can't ask people to rewrite half of QEMU just to merge a feature. Who is asking anyone to rewrite half of QEMU? >=20 > In this case, what matters is: >=20 > 0) The device should always be modelled with QOM/qdev Yes >=20 > 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. Yes >=20 > 2) If !(1), the device should be added with -device Yes >=20 > 3) Devices deal with backends and only with backends. We have a syntax > for specifying backends independently of backends. Yes and 4) For often occuring use cases, we might want to provide a simplified cmdli= ne syntax >=20 > If you want a single option to configure a device, that's a problem to > attempt to solve independent of this series. I never disagreed with that statement. We were merely brainstorming. >=20 >> But I don't want to force people to have to use -device syntax for the >> average qemu use cases. >=20 > 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. Sure. And it's good to have. But we should also provide easier syntax for pe= ople without mgmnt tools, for use cases that occur often. =46rom the first xen vs kvm days one main argument about kvm was the difficu= lty in running it. People took the (overly complex) libvirt execution comman= d line to QEMU and showed it to people. It did indeed scare a few. So all I'm saying above is that we should not restrict ourselves to -device s= yntax, if we see a case that happens for more people than usual. However, I'= d always try to model it as a shortcut form. So -nvram would just in the cmdline parser be converted to -drive file=3D,if=3Dnone,id=3Dnvram -machine nvram=3Dnvram I hope that makes my point a bit clearer. In fact, I'm quite sure we're in h= eavy agreement, so I'm not quite sure what you're complaining about :) Alex >=20 > Regards, >=20 > Anthony Liguori