From: Brendan Cully Subject: Re: blktap failure after 14895:800aa9f5cec9 (moves /dev/xen/... to /var/run/tap/...) Date: Wed, 2 May 2007 09:44:47 -0700 Message-ID: <20070502164447.GC21748@xanadu.kublai.com> References: <20070502151135.GA21748@xanadu.kublai.com> <20070502153519.GB21748@xanadu.kublai.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="opJtzjQTFsWo+cga" Return-path: Content-Disposition: inline In-Reply-To: <20070502153519.GB21748@xanadu.kublai.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: keir@xensource.com, xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --opJtzjQTFsWo+cga Content-Type: text/plain; charset=us-ascii Content-Disposition: inline The attached patch fixes the problem for me (well, my qcow tapdisk is still hanging, but that's a separate issue). --opJtzjQTFsWo+cga Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="blktap-ctrl.dir.patch" # HG changeset patch # User Brendan Cully # Date 1178124163 25200 # Node ID f8d58ba6ba169a958539b85c771d47a2a2b1a322 # Parent c1fafdcdb19a781a603988346e49deae07054a54 Put blktap character device back into /dev/xen. Changeset 14895:800aa9f5cec9 accidentally moved it into /var/run/tap along with the control FIFOs. Signed-off-by: Brendan Cully diff -r c1fafdcdb19a -r f8d58ba6ba16 tools/blktap/drivers/blktapctrl.c --- a/tools/blktap/drivers/blktapctrl.c Tue May 01 22:24:01 2007 +0100 +++ b/tools/blktap/drivers/blktapctrl.c Wed May 02 09:42:43 2007 -0700 @@ -496,12 +496,12 @@ int blktapctrl_new_blkif(blkif_t *blkif) if (!exist) { DPRINTF("Process does not exist:\n"); asprintf(&rdctldev, - "%s/tapctrlread%d", BLKTAP_DEV_DIR, minor); + "%s/tapctrlread%d", BLKTAP_CTRL_DIR, minor); blkif->fds[READ] = open_ctrl_socket(rdctldev); asprintf(&wrctldev, - "%s/tapctrlwrite%d", BLKTAP_DEV_DIR, minor); + "%s/tapctrlwrite%d", BLKTAP_CTRL_DIR, minor); blkif->fds[WRITE] = open_ctrl_socket(wrctldev); if (blkif->fds[READ] == -1 || blkif->fds[WRITE] == -1) @@ -601,6 +601,8 @@ int open_ctrl_socket(char *devname) fd_set socks; struct timeval timeout; + if (mkdir(BLKTAP_CTRL_DIR, 0755) == 0) + DPRINTF("Created %s directory\n", BLKTAP_CTRL_DIR); ret = mkfifo(devname,S_IRWXU|S_IRWXG|S_IRWXO); if ( (ret != 0) && (errno != EEXIST) ) { DPRINTF("ERROR: pipe failed (%d)\n", errno); diff -r c1fafdcdb19a -r f8d58ba6ba16 tools/blktap/lib/blktaplib.h --- a/tools/blktap/lib/blktaplib.h Tue May 01 22:24:01 2007 +0100 +++ b/tools/blktap/lib/blktaplib.h Wed May 02 09:42:43 2007 -0700 @@ -78,9 +78,10 @@ static inline int BLKTAP_MODE_VALID(unsi #define BLKTAP_IOCTL_KICK 1 #define MAX_PENDING_REQS BLK_RING_SIZE -#define BLKTAP_DEV_DIR "/var/run/tap" +#define BLKTAP_DEV_DIR "/dev/xen" #define BLKTAP_DEV_NAME "blktap" #define BLKTAP_DEV_MINOR 0 +#define BLKTAP_CTRL_DIR "/var/run/tap" extern int blktap_major; --opJtzjQTFsWo+cga Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --opJtzjQTFsWo+cga--