mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
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@citrix.com>
This commit is contained in:
1 parent
48a793e4b0
commit
630ec346ad
1 file changed
+8
-8
@@ -659,6 +659,9 @@ static int blktapctrl_new_blkif(blkif_t *blkif)
|
||||
|
||||
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)
|
||||
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 *blkif)
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||