[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-3.4-testing] blktap: Revert parts of c/s 19349.



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1243863872 -3600
# Node ID c8ab0a7ffc19c77e0b6c3931c1256f548d9c3d8f
# Parent  4ce864e7851fdae3bbafd42db11c902811038de8
blktap: Revert parts of c/s 19349.

Caused blktapctrl pipes to be created with uninitialised variable in
name.

Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
xen-unstable changeset:   19685:45447c0f7c6e
xen-unstable date:        Mon Jun 01 14:02:26 2009 +0100
---
 tools/blktap/drivers/blktapctrl.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff -r 4ce864e7851f -r c8ab0a7ffc19 tools/blktap/drivers/blktapctrl.c
--- a/tools/blktap/drivers/blktapctrl.c Mon Jun 01 14:44:11 2009 +0100
+++ b/tools/blktap/drivers/blktapctrl.c Mon Jun 01 14:44:32 2009 +0100
@@ -659,6 +659,9 @@ static int blktapctrl_new_blkif(blkif_t 
 
        DPRINTF("Received a poll for a new vbd\n");
        if ( ((blk=blkif->info) != NULL) && (blk->params != NULL) ) {
+               if (blktap_interface_create(ctlfd, &major, &minor, blkif) < 0)
+                       return -1;
+
                if (test_path(blk->params, &ptr, &type, &exist, &use_ioemu) != 
0) {
                         DPRINTF("Error in blktap device string(%s).\n",
                                 blk->params);
@@ -682,6 +685,10 @@ static int blktapctrl_new_blkif(blkif_t 
                        blkif->fds[WRITE] = exist->fds[WRITE];
                }
 
+               add_disktype(blkif, type);
+               blkif->major = major;
+               blkif->minor = minor;
+
                image = (image_t *)malloc(sizeof(image_t));
                blkif->prv = (void *)image;
                blkif->ops = &tapdisk_ops;
@@ -705,18 +712,11 @@ static int blktapctrl_new_blkif(blkif_t 
                        goto fail;
                }
 
-               if (blktap_interface_create(ctlfd, &major, &minor, blkif) < 0)
-                       return -1;
-
-               blkif->major = major;
-               blkif->minor = minor;
-
-               add_disktype(blkif, type);
-
        } else return -1;
 
        return 0;
 fail:
+       ioctl(ctlfd, BLKTAP_IOCTL_FREEINTF, minor);
        return -EINVAL;
 }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.