All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: kvm-ia64@vger.kernel.org
Subject: Re: [PATCH] Kvm: Qemu: save nvram
Date: Tue, 02 Dec 2008 10:31:45 +0000	[thread overview]
Message-ID: <20081202103145.GC25599@redhat.com> (raw)
In-Reply-To: <10C63FAD690C13458F0B32BCED571F14021760D4@pdsmsx502.ccr.corp.intel.com>

On Tue, Dec 02, 2008 at 10:25:49AM +0800, Zhang, Yang wrote:
> This patch to save the nvram. It save the nvram by specify the arg of 
> -name.And the saved file named by the arg. If do not specify the arg,
> it will not save the nvram

I think we might be better off having an explicit command line arg for nvram
path rather than hardcoding the directory, because there may well be times
where you want to have nvram saved, but don't want to specify -name, and
vica-verca. 

  -nvram foo.data

could prepend a default directory of $localstatedir/lib/qemu/nvram, where
$localstatedir  is set from 'configure' script, or

  -nvram /some/path/foo.data

would use the explicit path given.

> diff --git a/qemu/target-ia64/firmware.h b/qemu/target-ia64/firmware.h
> index 553a9f9..71aef2a 100644
> --- a/qemu/target-ia64/firmware.h
> +++ b/qemu/target-ia64/firmware.h
> @@ -34,11 +34,27 @@

[..snip...]

> +#define NVRAM_DIR "/usr/local/share/qemu/nvram/"

This is definitely wrong. You cannot assume /usr/local as the install
prefix, and using '$prefix/share' violates the FHS. '$prefix/share' is
for readonly data that can be shared across machines, not variable runtime
state data. I'd expect it to be in $localstatedir/lib/qemu/nvram, which
would normally default to $prefix/var/lib/qemu/nvram, but for distro package
builds typically be overridden to /var/lib/qemu/nvram. 

Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

WARNING: multiple messages have this Message-ID (diff)
From: "Daniel P. Berrange" <berrange@redhat.com>
To: "Zhang, Yang" <yang.zhang@intel.com>
Cc: "kvm-ia64@vger.kernel.org" <kvm-ia64@vger.kernel.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"avi@readhat.com" <avi@readhat.com>,
	"Zhang, Xiantao" <xiantao.zhang@intel.com>
Subject: Re: [PATCH] Kvm: Qemu: save nvram
Date: Tue, 2 Dec 2008 10:31:45 +0000	[thread overview]
Message-ID: <20081202103145.GC25599@redhat.com> (raw)
In-Reply-To: <10C63FAD690C13458F0B32BCED571F14021760D4@pdsmsx502.ccr.corp.intel.com>

On Tue, Dec 02, 2008 at 10:25:49AM +0800, Zhang, Yang wrote:
> This patch to save the nvram. It save the nvram by specify the arg of 
> -name.And the saved file named by the arg. If do not specify the arg,
> it will not save the nvram

I think we might be better off having an explicit command line arg for nvram
path rather than hardcoding the directory, because there may well be times
where you want to have nvram saved, but don't want to specify -name, and
vica-verca. 

  -nvram foo.data

could prepend a default directory of $localstatedir/lib/qemu/nvram, where
$localstatedir  is set from 'configure' script, or

  -nvram /some/path/foo.data

would use the explicit path given.

> diff --git a/qemu/target-ia64/firmware.h b/qemu/target-ia64/firmware.h
> index 553a9f9..71aef2a 100644
> --- a/qemu/target-ia64/firmware.h
> +++ b/qemu/target-ia64/firmware.h
> @@ -34,11 +34,27 @@

[..snip...]

> +#define NVRAM_DIR "/usr/local/share/qemu/nvram/"

This is definitely wrong. You cannot assume /usr/local as the install
prefix, and using '$prefix/share' violates the FHS. '$prefix/share' is
for readonly data that can be shared across machines, not variable runtime
state data. I'd expect it to be in $localstatedir/lib/qemu/nvram, which
would normally default to $prefix/var/lib/qemu/nvram, but for distro package
builds typically be overridden to /var/lib/qemu/nvram. 

Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

  parent reply	other threads:[~2008-12-02 10:31 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-02  2:25 [PATCH] Kvm: Qemu: save nvram Zhang, Yang
2008-12-02  2:25 ` Zhang, Yang
2008-12-02  5:27 ` Zhang, Yang
2008-12-02  5:27   ` Zhang, Yang
2008-12-02 10:31 ` Daniel P. Berrange [this message]
2008-12-02 10:31   ` Daniel P. Berrange
2008-12-02 13:01 ` Avi Kivity
2008-12-02 13:01   ` Avi Kivity
2008-12-02 13:10 ` Daniel P. Berrange
2008-12-02 13:10   ` Daniel P. Berrange
2008-12-03  6:02 ` Zhang, Xiantao
2008-12-03  6:02   ` Zhang, Xiantao
2008-12-03  6:12 ` Zhang, Yang
2008-12-03  6:12   ` Zhang, Yang
2008-12-16  9:21 ` Zhang, Yang
2008-12-16  9:21   ` Zhang, Yang
2008-12-17 18:39   ` Charles Duffy
2008-12-18  5:30     ` Zhang, Xiantao
2008-12-18 18:00       ` Charles Duffy
2008-12-19  1:56         ` Zhang, Yang
2008-12-24  5:27 ` Zhang, Yang
2008-12-24  5:27   ` Zhang, Yang
2008-12-24  5:34 ` Zhang, Yang
2008-12-24  5:34   ` Zhang, Yang
2009-01-15  6:57 ` FW: " Zhang, Yang
2009-01-15  6:57   ` Zhang, Yang
2009-01-15  9:57 ` Avi Kivity
2009-01-15  9:57   ` Avi Kivity

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=20081202103145.GC25599@redhat.com \
    --to=berrange@redhat.com \
    --cc=kvm-ia64@vger.kernel.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.