ia64/xen-unstable

changeset 16945:5f997b5b8a58

ioemu: Fix xenstore access changes.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Jan 30 15:19:22 2008 +0000 (2008-01-30)
parents 0343aa136101
children 13eb21985d3d 5c30a9dec02d
files tools/ioemu/xenstore.c
line diff
     1.1 --- a/tools/ioemu/xenstore.c	Wed Jan 30 14:25:55 2008 +0000
     1.2 +++ b/tools/ioemu/xenstore.c	Wed Jan 30 15:19:22 2008 +0000
     1.3 @@ -446,20 +446,15 @@ void xenstore_process_event(void *opaque
     1.4  
     1.5      /* Strip off blktap sub-type prefix */
     1.6      bpath = strdup(vec[XS_WATCH_PATH]); 
     1.7 -    if (bpath)
     1.8 +    if (bpath == NULL)
     1.9          goto out;
    1.10      if ((offset = strrchr(bpath, '/')) != NULL) 
    1.11          *offset = '\0';
    1.12      if (pasprintf(&buf, "%s/type", bpath) == -1) 
    1.13          goto out;
    1.14      drv = xs_read(xsh, XBT_NULL, buf, &len);
    1.15 -    if (drv) {
    1.16 -        if (!strcmp(drv, "tap")) {
    1.17 -            offset = strchr(image, ':'); 
    1.18 -            if (offset) 
    1.19 -                memmove(image, offset+1, strlen(offset+1)+1 );
    1.20 -        }
    1.21 -    }
    1.22 +    if (drv && !strcmp(drv, "tap") && ((offset = strchr(image, ':')) != NULL))
    1.23 +        memmove(image, offset+1, strlen(offset+1)+1);
    1.24  
    1.25      if (!strcmp(image, bs_table[hd_index]->filename))
    1.26          goto out;  /* identical */