From 939629eb5b1f143b12eee9396d6a8c8b1e0f3226 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Fri, 22 Jan 2010 11:00:45 +0000 Subject: blktap: fix blktapctrl abort On rebooting a hvm, the blktapctrl daemon has died. gdb shows the following call trace: (gdb) where #0 0x00000039d1830155 in raise () from /lib64/libc.so.6 #1 0x00000039d1831bf0 in abort () from /lib64/libc.so.6 #2 0x00000039d186a38b in __libc_message () from /lib64/libc.so.6 #3 0x00000039d1871634 in _int_free () from /lib64/libc.so.6 #4 0x00000039d1874c5c in free () from /lib64/libc.so.6 #5 0x0000003320a01bdd in ueblktap_probe (h=3D0x6073b0,=20 w=, bepath_im=) at xenbus.c:270 #6 0x0000003320a020e0 in xs_fire_next_watch (h=3D0x6073b0) at xs_api.c:355 #7 0x0000000000401785 in main (argc=3D, argv=) at blktapctrl.c:907 There is a case that "/local/domain/0/backend/tap/" exists but "/local/domain//vm" is not in the xenstore. Signed-off-by: Kouya Shimura --- tools/blktap/lib/xenbus.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tools/blktap') diff --git a/tools/blktap/lib/xenbus.c b/tools/blktap/lib/xenbus.c index c238d5fe9a..53db3c8b29 100644 --- a/tools/blktap/lib/xenbus.c +++ b/tools/blktap/lib/xenbus.c @@ -232,8 +232,11 @@ static int check_sharing(struct xs_handle *h, struct backend_info *be) ret = -1; break; } + cur_dom_uuid = NULL; xs_gather(h, path, "vm", NULL, &cur_dom_uuid, NULL); free(path); + if (!cur_dom_uuid) + continue; if (!strcmp(cur_dom_uuid, dom_uuid)) { free(cur_dom_uuid); @@ -256,8 +259,11 @@ static int check_sharing(struct xs_handle *h, struct backend_info *be) ret = -1; break; } + params = NULL; xs_gather(h, path, "params", NULL, ¶ms, NULL); free(path); + if (!params) + continue; image_path[1] = get_image_path(params); if (!strcmp(image_path[0], image_path[1])) { -- cgit v1.2.3