From: Keir Fraser Date: Wed, 30 Jan 2008 15:19:22 +0000 (+0000) Subject: ioemu: Fix xenstore access changes. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14344 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=26f9a3f7f57a91259580387681935731ebb4a6ec;p=xen.git ioemu: Fix xenstore access changes. Signed-off-by: Keir Fraser --- diff --git a/tools/ioemu/xenstore.c b/tools/ioemu/xenstore.c index 2905c79459..9d33237cb3 100644 --- a/tools/ioemu/xenstore.c +++ b/tools/ioemu/xenstore.c @@ -446,20 +446,15 @@ void xenstore_process_event(void *opaque) /* Strip off blktap sub-type prefix */ bpath = strdup(vec[XS_WATCH_PATH]); - if (bpath) + if (bpath == NULL) goto out; if ((offset = strrchr(bpath, '/')) != NULL) *offset = '\0'; if (pasprintf(&buf, "%s/type", bpath) == -1) goto out; drv = xs_read(xsh, XBT_NULL, buf, &len); - if (drv) { - if (!strcmp(drv, "tap")) { - offset = strchr(image, ':'); - if (offset) - memmove(image, offset+1, strlen(offset+1)+1 ); - } - } + if (drv && !strcmp(drv, "tap") && ((offset = strchr(image, ':')) != NULL)) + memmove(image, offset+1, strlen(offset+1)+1); if (!strcmp(image, bs_table[hd_index]->filename)) goto out; /* identical */