# HG changeset patch
# User David Scott <dave.scott@xxxxxxxxxxxxx>
# Date 1270636506 -3600
# Node ID 9dd35e413e35877280587431cd367f81f4979fa5
# Parent 82aec6e8c78ee0ca31c5bfe887b57484cfab0995
CA-39745: watch /local/domain/%d/error/backend/vbd/%d/%d/error for informative
errors such as "2 creating vbd structure". This prevents us timing out after 20
minutes if something goes wrong with a blkback device.
A further patch will be needed to provide some decent error diagnosis.
Signed-off-by: David Scott <dave.scott@xxxxxxxxxxxxx>
diff -r 82aec6e8c78e -r 9dd35e413e35 ocaml/xenops/hotplug.ml
--- a/ocaml/xenops/hotplug.ml Wed Apr 07 11:34:09 2010 +0100
+++ b/ocaml/xenops/hotplug.ml Wed Apr 07 11:35:06 2010 +0100
@@ -78,6 +78,10 @@
let tapdisk_error_node ~xs (x: device) =
sprintf "%s/backend/%s/%d/%d/tapdisk-error" (xs.Xs.getdomainpath
x.backend.domid) (string_of_kind x.backend.kind) x.frontend.domid
x.frontend.devid
+(* CA-39745: node written to by blkback to report an error (eg opening an
empty CDROM drive) *)
+let blkback_error_node ~xs (x: device) =
+ sprintf "%s/error/backend/vbd/%d/%d/error" (xs.Xs.getdomainpath
x.backend.domid) x.backend.domid x.frontend.devid
+
(* Poll a device to see whether it is instantaneously "online" where "online"
means
"currently-attached" in the database. The event thread AND the startup code
call
this function to resynchronise the state of the world with the database.
@@ -134,11 +138,12 @@
debug "Hotplug.wait_for_frontend_plug: %s" (string_of_device x);
try
let ok_watch = Watch.value_to_appear (frontend_status_node x) in
- let error_watch = Watch.value_to_appear (tapdisk_error_node ~xs x) in
+ let tapdisk_error_watch = Watch.value_to_appear (tapdisk_error_node ~xs x)
in
+ let blkback_error_watch = Watch.value_to_appear (blkback_error_node ~xs
x) in
Stats.time_this "udev frontend add event"
(fun () ->
match Watch.wait_for ~xs ~timeout:hotplug_timeout
- (Watch.any_of [ `OK, ok_watch; `Failed, error_watch ]) with
+ (Watch.any_of [ `OK, ok_watch; `Failed, tapdisk_error_watch; `Failed,
blkback_error_watch ]) with
| `OK, _ ->
debug "Synchronised ok with frontend hotplug script: %s"
(string_of_device x)
| `Failed, e ->
1 file changed, 7 insertions(+), 2 deletions(-)
ocaml/xenops/hotplug.ml | 9 +++++++--
xen-api.hg.patch
Description: Text Data
_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api
|