WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] [TAPDISK] Use incremental cookies and fix

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [TAPDISK] Use incremental cookies and fix blktapctrl::test_path parameter typo.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 24 Apr 2007 10:50:13 -0700
Delivery-date: Tue, 24 Apr 2007 10:49:59 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Jake Wires <jwires@xxxxxxxxxxxxx>
# Date 1177367873 25200
# Node ID f033cc5cc0d5f14ee59a5309224aea7565fa8e87
# Parent  6139337e26903d18edc1ff9ce4df1f1b0cfa76f2
[TAPDISK] Use incremental cookies and fix blktapctrl::test_path parameter typo.
Signed-off-by: Jake Wires <jwires@xxxxxxxxxxxxx>
---
 tools/blktap/drivers/blktapctrl.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff -r 6139337e2690 -r f033cc5cc0d5 tools/blktap/drivers/blktapctrl.c
--- a/tools/blktap/drivers/blktapctrl.c Mon Apr 23 16:37:03 2007 +0100
+++ b/tools/blktap/drivers/blktapctrl.c Mon Apr 23 15:37:53 2007 -0700
@@ -177,14 +177,14 @@ static int get_tapdisk_pid(blkif_t *blki
  *   return 0 on success, -1 on error.
  */
 
-static int test_path(char *path, char **dev, int *type, blkif_t *blkif)
+static int test_path(char *path, char **dev, int *type, blkif_t **blkif)
 {
        char *ptr, handle[10];
        int i, size, found = 0;
 
        size = sizeof(dtypes)/sizeof(disk_info_t *);
        *type = MAX_DISK_TYPES + 1;
-        blkif = NULL;
+        *blkif = NULL;
 
        if ( (ptr = strstr(path, ":"))!=NULL) {
                memcpy(handle, path, (ptr - path));
@@ -207,9 +207,9 @@ static int test_path(char *path, char **
                                 /* Check whether tapdisk process 
                                    already exists */
                                 if (active_disks[dtypes[i]->idnum] == NULL) 
-                                        blkif = NULL;
+                                        *blkif = NULL;
                                 else 
-                                        blkif = active_disks[dtypes[i]
+                                        *blkif = active_disks[dtypes[i]
                                                              ->idnum]->blkif;
                         }
                         return 0;
@@ -478,19 +478,20 @@ int blktapctrl_new_blkif(blkif_t *blkif)
        char *rdctldev, *wrctldev, *cmd, *ptr;
        image_t *image;
        blkif_t *exist = NULL;
+       static uint16_t next_cookie = 0;
 
        DPRINTF("Received a poll for a new vbd\n");
        if ( ((blk=blkif->info) != NULL) && (blk->params != NULL) ) {
                if (get_new_dev(&major, &minor, blkif)<0)
                        return -1;
 
-               if (test_path(blk->params, &ptr, &type, exist) != 0) {
+               if (test_path(blk->params, &ptr, &type, &exist) != 0) {
                         DPRINTF("Error in blktap device string(%s).\n",
                                 blk->params);
                         return -1;
                 }
                blkif->drivertype = type;
-               blkif->cookie = lrand48() % MAX_RAND_VAL;
+               blkif->cookie = next_cookie++;
 
                if (!exist) {
                        DPRINTF("Process does not exist:\n");

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [TAPDISK] Use incremental cookies and fix blktapctrl::test_path parameter typo., Xen patchbot-unstable <=