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] Little blkif interface and xend fixes to make parallax w

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Little blkif interface and xend fixes to make parallax work again.
From: BitKeeper Bot <riel@xxxxxxxxxxx>
Date: Thu, 19 May 2005 21:13:22 +0000
Delivery-date: Thu, 19 May 2005 22:03:40 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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 Development List <xen-devel@xxxxxxxxxxxxxxxxxxx>
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
ChangeSet 1.1421.2.1, 2005/05/19 22:13:22+01:00, akw27@xxxxxxxxxxxxxxxxxxxxxx

        Little blkif interface and xend fixes to make parallax work again.
        Also minor debug printing fix to blktap.
        
        Signed-off-by: andrew.warfield@xxxxxxxxxxxx



 linux-2.6.11-xen-sparse/drivers/xen/blktap/blktap.h            |    3 
 linux-2.6.11-xen-sparse/drivers/xen/blktap/blktap_controlmsg.c |   46 
+++++++++-
 linux-2.6.11-xen-sparse/drivers/xen/blktap/blktap_datapath.c   |   21 ----
 linux-2.6.11-xen-sparse/drivers/xen/blktap/blktap_userdev.c    |    3 
 tools/python/xen/lowlevel/xu/xu.c                              |    2 
 tools/python/xen/xend/Blkctl.py                                |    3 
 tools/python/xen/xend/server/blkif.py                          |    6 -
 xen/include/public/io/domain_controller.h                      |    9 +
 8 files changed, 60 insertions(+), 33 deletions(-)


diff -Nru a/linux-2.6.11-xen-sparse/drivers/xen/blktap/blktap.h 
b/linux-2.6.11-xen-sparse/drivers/xen/blktap/blktap.h
--- a/linux-2.6.11-xen-sparse/drivers/xen/blktap/blktap.h       2005-05-19 
18:04:20 -04:00
+++ b/linux-2.6.11-xen-sparse/drivers/xen/blktap/blktap.h       2005-05-19 
18:04:20 -04:00
@@ -246,7 +246,8 @@
 extern void blkif_ctrlif_rx(ctrl_msg_t *msg, unsigned long id);
 
 /* debug */
-void print_vm_ring_idxs(void);
+void print_fe_ring_idxs(void);
+void print_be_ring_idxs(void);
         
 #define __BLKINT_H__
 #endif
diff -Nru a/linux-2.6.11-xen-sparse/drivers/xen/blktap/blktap_controlmsg.c 
b/linux-2.6.11-xen-sparse/drivers/xen/blktap/blktap_controlmsg.c
--- a/linux-2.6.11-xen-sparse/drivers/xen/blktap/blktap_controlmsg.c    
2005-05-19 18:04:20 -04:00
+++ b/linux-2.6.11-xen-sparse/drivers/xen/blktap/blktap_controlmsg.c    
2005-05-19 18:04:20 -04:00
@@ -104,7 +104,7 @@
 
     if ( (blkif = kmem_cache_alloc(blkif_cachep, GFP_KERNEL)) == NULL )
     {
-        DPRINTK("Could not create blkif: out of memory\n");
+        WPRINTK("Could not create blkif: out of memory\n");
         create->status = BLKIF_BE_STATUS_OUT_OF_MEMORY;
         return;
     }
@@ -122,7 +122,7 @@
     {
         if ( ((*pblkif)->domid == domid) && ((*pblkif)->handle == handle) )
         {
-            DPRINTK("Could not create blkif: already exists\n");
+            WPRINTK("Could not create blkif: already exists\n");
             create->status = BLKIF_BE_STATUS_INTERFACE_EXISTS;
             kmem_cache_free(blkif_cachep, blkif);
             return;
@@ -189,7 +189,7 @@
     blkif = blkif_find_by_handle(domid, handle);
     if ( unlikely(blkif == NULL) )
     {
-        DPRINTK("blkif_connect attempted for non-existent blkif (%u,%u)\n", 
+        WPRINTK("blkif_connect attempted for non-existent blkif (%u,%u)\n", 
                 connect->domid, connect->blkif_handle); 
         connect->status = BLKIF_BE_STATUS_INTERFACE_NOT_FOUND;
         return;
@@ -253,7 +253,7 @@
     blkif = blkif_find_by_handle(domid, handle);
     if ( unlikely(blkif == NULL) )
     {
-        DPRINTK("blkif_disconnect attempted for non-existent blkif"
+        WPRINTK("blkif_disconnect attempted for non-existent blkif"
                 " (%u,%u)\n", disconnect->domid, disconnect->blkif_handle); 
         disconnect->status = BLKIF_BE_STATUS_INTERFACE_NOT_FOUND;
         return 1; /* Caller will send response error message. */
@@ -499,3 +499,41 @@
     
     blktap_be_ring.sring = NULL;
 }
+
+
+
+/* Debug : print the current ring indices. */
+
+void print_fe_ring_idxs(void)
+{
+    int i;
+    blkif_t *blkif;
+            
+    WPRINTK("FE Rings: \n---------\n");
+    for ( i = 0; i < BLKIF_HASHSZ; i++) { 
+        blkif = blkif_hash[i];
+        while (blkif != NULL) {
+            if (blkif->status == DISCONNECTED) {
+                WPRINTK("(%2d,%2d) DISCONNECTED\n", 
+                   blkif->domid, blkif->handle);
+            } else if (blkif->status == DISCONNECTING) {
+                WPRINTK("(%2d,%2d) DISCONNECTING\n", 
+                   blkif->domid, blkif->handle);
+            } else if (blkif->blk_ring.sring == NULL) {
+                WPRINTK("(%2d,%2d) CONNECTED, but null sring!\n", 
+                   blkif->domid, blkif->handle);
+            } else {
+                blkif_get(blkif);
+                WPRINTK("(%2d,%2d): req_cons: %2d, rsp_prod_prv: %2d "
+                    "| req_prod: %2d, rsp_prod: %2d\n",
+                    blkif->domid, blkif->handle,
+                    blkif->blk_ring.req_cons,
+                    blkif->blk_ring.rsp_prod_pvt,
+                    blkif->blk_ring.sring->req_prod,
+                    blkif->blk_ring.sring->rsp_prod);
+                blkif_put(blkif);
+            } 
+            blkif = blkif->hash_next;
+        }
+    }
+}        
diff -Nru a/linux-2.6.11-xen-sparse/drivers/xen/blktap/blktap_datapath.c 
b/linux-2.6.11-xen-sparse/drivers/xen/blktap/blktap_datapath.c
--- a/linux-2.6.11-xen-sparse/drivers/xen/blktap/blktap_datapath.c      
2005-05-19 18:04:20 -04:00
+++ b/linux-2.6.11-xen-sparse/drivers/xen/blktap/blktap_datapath.c      
2005-05-19 18:04:20 -04:00
@@ -439,27 +439,8 @@
 
 /* Debug : print the current ring indices. */
 
-void print_vm_ring_idxs(void)
+void print_be_ring_idxs(void)
 {
-    int i;
-    blkif_t *blkif;
-            
-    WPRINTK("FE Rings: \n---------\n");
-    for ( i = 0; i < 50; i++) { 
-        blkif = blkif_find_by_handle((domid_t)i, 0);
-        if (blkif != NULL) {
-            if (blkif->blk_ring.sring != NULL) {
-                WPRINTK("%2d: req_cons: %2d, rsp_prod_prv: %2d "
-                    "| req_prod: %2d, rsp_prod: %2d\n", i, 
-                    blkif->blk_ring.req_cons,
-                    blkif->blk_ring.rsp_prod_pvt,
-                    blkif->blk_ring.sring->req_prod,
-                    blkif->blk_ring.sring->rsp_prod);
-            } else {
-                WPRINTK("%2d: [no device channel yet]\n", i);
-            }
-        }
-    }
     if (blktap_be_ring.sring != NULL) {
         WPRINTK("BE Ring: \n--------\n");
         WPRINTK("BE: rsp_cons: %2d, req_prod_prv: %2d "
diff -Nru a/linux-2.6.11-xen-sparse/drivers/xen/blktap/blktap_userdev.c 
b/linux-2.6.11-xen-sparse/drivers/xen/blktap/blktap_userdev.c
--- a/linux-2.6.11-xen-sparse/drivers/xen/blktap/blktap_userdev.c       
2005-05-19 18:04:20 -04:00
+++ b/linux-2.6.11-xen-sparse/drivers/xen/blktap/blktap_userdev.c       
2005-05-19 18:04:20 -04:00
@@ -227,7 +227,8 @@
         }
     case BLKTAP_IOCTL_PRINT_IDXS:
         {
-            print_vm_ring_idxs();
+            print_be_ring_idxs();
+            print_fe_ring_idxs();
             WPRINTK("User Rings: \n-----------\n");
             WPRINTK("UF: rsp_cons: %2d, req_prod_prv: %2d "
                             "| req_prod: %2d, rsp_prod: %2d\n",
diff -Nru a/tools/python/xen/lowlevel/xu/xu.c 
b/tools/python/xen/lowlevel/xu/xu.c
--- a/tools/python/xen/lowlevel/xu/xu.c 2005-05-19 18:04:20 -04:00
+++ b/tools/python/xen/lowlevel/xu/xu.c 2005-05-19 18:04:20 -04:00
@@ -624,6 +624,7 @@
         C2P(blkif_be_vbd_create_t, domid,        Int, Long);
         C2P(blkif_be_vbd_create_t, blkif_handle, Int, Long);
         C2P(blkif_be_vbd_create_t, pdevice,      Int, Long);
+        C2P(blkif_be_vbd_create_t, dev_handle,   Int, Long);
         C2P(blkif_be_vbd_create_t, vdevice,      Int, Long);
         C2P(blkif_be_vbd_create_t, readonly,     Int, Long);
         C2P(blkif_be_vbd_create_t, status,       Int, Long);
@@ -843,6 +844,7 @@
         P2C(blkif_be_vbd_create_t, domid,        u32);
         P2C(blkif_be_vbd_create_t, blkif_handle, u32);
         P2C(blkif_be_vbd_create_t, pdevice,      blkif_pdev_t);
+        P2C(blkif_be_vbd_create_t, dev_handle,   u32);
         P2C(blkif_be_vbd_create_t, vdevice,      blkif_vdev_t);
         P2C(blkif_be_vbd_create_t, readonly,     u16);
         break;
diff -Nru a/tools/python/xen/xend/Blkctl.py b/tools/python/xen/xend/Blkctl.py
--- a/tools/python/xen/xend/Blkctl.py   2005-05-19 18:04:20 -04:00
+++ b/tools/python/xen/xend/Blkctl.py   2005-05-19 18:04:20 -04:00
@@ -30,7 +30,8 @@
         raise ValueError('Invalid operation:' + op)
 
     # Special case phy devices - they don't require any (un)binding
-    if type == 'phy':
+    # Parallax also doesn't need script-based binding.
+    if (type == 'phy') or (type == 'parallax'):
         return dets
     
     if script is None:
diff -Nru a/tools/python/xen/xend/server/blkif.py 
b/tools/python/xen/xend/server/blkif.py
--- a/tools/python/xen/xend/server/blkif.py     2005-05-19 18:04:20 -04:00
+++ b/tools/python/xen/xend/server/blkif.py     2005-05-19 18:04:20 -04:00
@@ -166,6 +166,7 @@
         self.params = None
         self.node = None
         self.device = None
+        self.dev_handle = 0
         self.start_sector = None
         self.nr_sectors = None
         
@@ -232,12 +233,12 @@
         # NOTE: 
         # This clause is testing code for storage system experiments.
         # Add a new disk type that will just pass an opaque id in the
-        # start_sector and use an experimental device type.
+        # dev_handle and use an experimental device type.
         # Please contact andrew.warfield@xxxxxxxxxxxx with any concerns.
         if self.type == 'parallax':
             self.node   = node
             self.device =  61440 # (240,0)
-            self.start_sector = long(self.params)
+            self.dev_handle = long(self.params)
             self.nr_sectors = long(0)
             return
         # done.
@@ -330,6 +331,7 @@
                       { 'domid'        : self.frontendDomain,
                         'blkif_handle' : self.backendId,
                         'pdevice'      : self.device,
+                        'dev_handle'   : self.dev_handle,
                         'vdevice'      : self.vdev,
                         'readonly'     : self.readonly() })
         msg = self.backendChannel.requestResponse(msg)
diff -Nru a/xen/include/public/io/domain_controller.h 
b/xen/include/public/io/domain_controller.h
--- a/xen/include/public/io/domain_controller.h 2005-05-19 18:04:20 -04:00
+++ b/xen/include/public/io/domain_controller.h 2005-05-19 18:04:20 -04:00
@@ -280,11 +280,12 @@
     u16        __pad;
     u32        blkif_handle;  /*  4: ...ditto...                         */
     blkif_pdev_t pdevice;     /*  8 */
-    blkif_vdev_t vdevice;     /* 12: Interface-specific id for this VBD. */
-    u16        readonly;      /* 14: Non-zero -> VBD isn't writable.     */
+    u32        dev_handle;    /* 12: Extended device id field.           */
+    blkif_vdev_t vdevice;     /* 16: Interface-specific id for this VBD. */
+    u16        readonly;      /* 18: Non-zero -> VBD isn't writable.     */
     /* OUT */
-    u32        status;        /* 16 */
-} PACKED blkif_be_vbd_create_t; /* 20 bytes */
+    u32        status;        /* 20 */
+} PACKED blkif_be_vbd_create_t; /* 24 bytes */
 
 /* CMSG_BLKIF_BE_VBD_DESTROY */
 typedef struct {

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Little blkif interface and xend fixes to make parallax work again., BitKeeper Bot <=