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

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



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1243861346 -3600
# Node ID 45447c0f7c6efcfd9928626c23300149c119bc30
# Parent  46468a3b2d5f5b32aa1edffcb58692727498e785
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>
---
 tools/blktap/drivers/blktapctrl.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff -r 46468a3b2d5f -r 45447c0f7c6e tools/blktap/drivers/blktapctrl.c
--- a/tools/blktap/drivers/blktapctrl.c Sat May 30 13:25:32 2009 +0100
+++ b/tools/blktap/drivers/blktapctrl.c Mon Jun 01 14:02:26 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®.