Roger Pau Monne
2012-Aug-23 16:53 UTC
[PATCH 0/3] hotplug/NetBSD: remaining block script fixes
Remaining patches from the hotplug script series for NetBSD. Expanded with Ian Campbell recommendations. The xenstore_write fix has been moved to a pre-patch, and the error function has been expanded to write the script error to hotplug-error (in a pre-patch also). Thanks for the review.
Roger Pau Monne
2012-Aug-23 16:53 UTC
[PATCH 1/3] hotplug/NetBSD: fix xenstore_write usage in error
xenstore_write doesn''t exist, use xenstore-write instead. The error function is currently broken without this change. Signed-off-by: Roger Pau Monne <roger.pau@citrix.com> Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> --- tools/hotplug/NetBSD/block | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/tools/hotplug/NetBSD/block b/tools/hotplug/NetBSD/block index cf5ff3a..28135f5 100644 --- a/tools/hotplug/NetBSD/block +++ b/tools/hotplug/NetBSD/block @@ -12,7 +12,7 @@ export PATH error() { echo "$@" >&2 - xenstore_write $xpath/hotplug-status error + xenstore-write $xpath/hotplug-status error exit 1 } -- 1.7.7.5 (Apple Git-26)
Roger Pau Monne
2012-Aug-23 16:53 UTC
[PATCH 2/3] hotplug/NetBSD: write error message to hotplug-error
As recommended by Ian Campbell, write the hotplug error to hotplug-error, just as the Linux hotplug script does. Signed-off-by: Roger Pau Monne <roger.pau@citrix.com> --- tools/hotplug/NetBSD/block | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/tools/hotplug/NetBSD/block b/tools/hotplug/NetBSD/block index 28135f5..2c10ed7 100644 --- a/tools/hotplug/NetBSD/block +++ b/tools/hotplug/NetBSD/block @@ -12,7 +12,8 @@ export PATH error() { echo "$@" >&2 - xenstore-write $xpath/hotplug-status error + xenstore-write $xpath/hotplug-status error \ + $xpath/hotplug-error "$@" exit 1 } -- 1.7.7.5 (Apple Git-26)
Roger Pau Monne
2012-Aug-23 16:53 UTC
[PATCH 3/3] hotplug/NetBSD: check type of file to attach from params
xend used to set the xenbus backend entry "type" to either "phy" or "file", but now libxl sets it to "phy" for both file and block device. We have to manually check for the type of the "param" field in order to detect if we are trying to attach a file or a block device. Cc: Ian Jackson <ian.jackson@eu.citrix.com> Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> Signed-off-by: Roger Pau Monne <roger.pau@citrix.com> --- Changes since v4: * Push the xenstore_write fix to a separate pre-patch Changes since v3: * Add $xparams (that contains the path to the disk file) to the error message. Changes since v2: * Better error messages. * Check if params is empty. * Replace xenstore_write with xenstore-write in error function. * Add quotation marks to xparams when testing. Changes since v1: * Check that file is either a block special file or a regular file and report error otherwise. --- tools/hotplug/NetBSD/block | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-) diff --git a/tools/hotplug/NetBSD/block b/tools/hotplug/NetBSD/block index 2c10ed7..f1146b5 100644 --- a/tools/hotplug/NetBSD/block +++ b/tools/hotplug/NetBSD/block @@ -20,8 +20,17 @@ error() { xpath=$1 xstatus=$2 -xtype=$(xenstore-read "$xpath/type") xparams=$(xenstore-read "$xpath/params") +if [ -b "$xparams" ]; then + xtype="phy" +elif [ -f "$xparams" ]; then + xtype="file" +elif [ -z "$xparams" ]; then + error "$xpath/params is empty, unable to attach block device." +else + error "$xparams is not a valid file type to use as block device." \ + "Only block and regular image files accepted." +fi case $xstatus in 6) -- 1.7.7.5 (Apple Git-26)
Ian Jackson
2012-Aug-30 15:19 UTC
Re: [PATCH 0/3] hotplug/NetBSD: remaining block script fixes
Roger Pau Monne writes ("[Xen-devel] [PATCH 0/3] hotplug/NetBSD: remaining block script fixes"):> Remaining patches from the hotplug script series for NetBSD. Expanded > with Ian Campbell recommendations. > > The xenstore_write fix has been moved to a pre-patch, and the error > function has been expanded to write the script error to hotplug-error > (in a pre-patch also).All three: Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> for 4.2. Ia.
Ian Campbell
2012-Aug-31 09:42 UTC
Re: [PATCH 0/3] hotplug/NetBSD: remaining block script fixes
On Thu, 2012-08-30 at 16:19 +0100, Ian Jackson wrote:> Roger Pau Monne writes ("[Xen-devel] [PATCH 0/3] hotplug/NetBSD: remaining block script fixes"): > > Remaining patches from the hotplug script series for NetBSD. Expanded > > with Ian Campbell recommendations. > > > > The xenstore_write fix has been moved to a pre-patch, and the error > > function has been expanded to write the script error to hotplug-error > > (in a pre-patch also). > > All three: > > Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> > > for 4.2.All applied, thanks.