WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

[Xen-API] [PATCH] cope better with failures while attaching a disk to a

To: xen-api@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-API] [PATCH] cope better with failures while attaching a disk to a VM
From: David Scott <dave.scott@xxxxxxxxxxxxx>
Date: Wed, 7 Apr 2010 11:36:19 +0100
Delivery-date: Wed, 07 Apr 2010 03:33:12 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
# 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 +++++++--


Attachment: xen-api.hg.patch
Description: Text Data

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-API] [PATCH] cope better with failures while attaching a disk to a VM, David Scott <=