* [PATCH 0/3] hotplug/NetBSD: remaining block script fixes
@ 2012-08-23 16:53 Roger Pau Monne
2012-08-23 16:53 ` [PATCH 1/3] hotplug/NetBSD: fix xenstore_write usage in error Roger Pau Monne
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Roger Pau Monne @ 2012-08-23 16:53 UTC (permalink / raw)
To: xen-devel
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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/3] hotplug/NetBSD: fix xenstore_write usage in error
2012-08-23 16:53 [PATCH 0/3] hotplug/NetBSD: remaining block script fixes Roger Pau Monne
@ 2012-08-23 16:53 ` Roger Pau Monne
2012-08-23 16:53 ` [PATCH 2/3] hotplug/NetBSD: write error message to hotplug-error Roger Pau Monne
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Roger Pau Monne @ 2012-08-23 16:53 UTC (permalink / raw)
To: xen-devel; +Cc: Christoph Egger, Roger Pau Monne
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)
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/3] hotplug/NetBSD: write error message to hotplug-error
2012-08-23 16:53 [PATCH 0/3] hotplug/NetBSD: remaining block script fixes Roger Pau Monne
2012-08-23 16:53 ` [PATCH 1/3] hotplug/NetBSD: fix xenstore_write usage in error Roger Pau Monne
@ 2012-08-23 16:53 ` Roger Pau Monne
2012-08-23 16:53 ` [PATCH 3/3] hotplug/NetBSD: check type of file to attach from params Roger Pau Monne
2012-08-30 15:19 ` [PATCH 0/3] hotplug/NetBSD: remaining block script fixes Ian Jackson
3 siblings, 0 replies; 6+ messages in thread
From: Roger Pau Monne @ 2012-08-23 16:53 UTC (permalink / raw)
To: xen-devel; +Cc: Roger Pau Monne
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)
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/3] hotplug/NetBSD: check type of file to attach from params
2012-08-23 16:53 [PATCH 0/3] hotplug/NetBSD: remaining block script fixes Roger Pau Monne
2012-08-23 16:53 ` [PATCH 1/3] hotplug/NetBSD: fix xenstore_write usage in error Roger Pau Monne
2012-08-23 16:53 ` [PATCH 2/3] hotplug/NetBSD: write error message to hotplug-error Roger Pau Monne
@ 2012-08-23 16:53 ` Roger Pau Monne
2012-08-30 15:19 ` [PATCH 0/3] hotplug/NetBSD: remaining block script fixes Ian Jackson
3 siblings, 0 replies; 6+ messages in thread
From: Roger Pau Monne @ 2012-08-23 16:53 UTC (permalink / raw)
To: xen-devel; +Cc: Christoph Egger, Ian Jackson, Roger Pau Monne
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)
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 0/3] hotplug/NetBSD: remaining block script fixes
2012-08-23 16:53 [PATCH 0/3] hotplug/NetBSD: remaining block script fixes Roger Pau Monne
` (2 preceding siblings ...)
2012-08-23 16:53 ` [PATCH 3/3] hotplug/NetBSD: check type of file to attach from params Roger Pau Monne
@ 2012-08-30 15:19 ` Ian Jackson
2012-08-31 9:42 ` Ian Campbell
3 siblings, 1 reply; 6+ messages in thread
From: Ian Jackson @ 2012-08-30 15:19 UTC (permalink / raw)
To: Roger Pau Monne; +Cc: Ian Campbell, xen-devel
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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 0/3] hotplug/NetBSD: remaining block script fixes
2012-08-30 15:19 ` [PATCH 0/3] hotplug/NetBSD: remaining block script fixes Ian Jackson
@ 2012-08-31 9:42 ` Ian Campbell
0 siblings, 0 replies; 6+ messages in thread
From: Ian Campbell @ 2012-08-31 9:42 UTC (permalink / raw)
To: Ian Jackson; +Cc: xen-devel@lists.xen.org, Roger Pau Monne
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.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-08-31 9:42 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-23 16:53 [PATCH 0/3] hotplug/NetBSD: remaining block script fixes Roger Pau Monne
2012-08-23 16:53 ` [PATCH 1/3] hotplug/NetBSD: fix xenstore_write usage in error Roger Pau Monne
2012-08-23 16:53 ` [PATCH 2/3] hotplug/NetBSD: write error message to hotplug-error Roger Pau Monne
2012-08-23 16:53 ` [PATCH 3/3] hotplug/NetBSD: check type of file to attach from params Roger Pau Monne
2012-08-30 15:19 ` [PATCH 0/3] hotplug/NetBSD: remaining block script fixes Ian Jackson
2012-08-31 9:42 ` Ian Campbell
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).