bitkeeper revision 1.1421.2.1 (428d0172Mlrhy6MiEsOJ6GtVjT0HPg)

Little blkif interface and xend fixes to make parallax work again.
Also minor debug printing fix to blktap.

Signed-off-by: andrew.warfield@cl.cam.ac.uk
This commit is contained in:
akw27@arcadians.cl.cam.ac.uk committed 2005-05-19 21:13:22 +00:00
1 parent 33ab556179
commit 90a17e697b
8 files changed
+60 -33

No files matched your search

@@ -246,7 +246,8 @@ irqreturn_t blkif_ptfe_int(int irq, void *dev_id, struct pt_regs *regs);
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
@@ -104,7 +104,7 @@ void blkif_ptfe_create(blkif_be_create_t *create)
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 @@ void blkif_ptfe_create(blkif_be_create_t *create)
{
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 @@ void blkif_ptfe_connect(blkif_be_connect_t *connect)
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 @@ int blkif_ptfe_disconnect(blkif_be_disconnect_t *disconnect, u8 rsp_id)
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 @@ void __init blkif_interface_init(void)
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;
}
}
}
@@ -439,27 +439,8 @@ irqreturn_t blkif_ptbe_int(int irq, void *dev_id,
/* 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 "
@@ -227,7 +227,8 @@ static int blktap_ioctl(struct inode *inode, struct file *filp,
}
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",
+2
View File
@@ -624,6 +624,7 @@ static PyObject *xu_message_get_payload(PyObject *self, PyObject *args)
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 @@ static PyObject *xu_message_new(PyObject *self, PyObject *args)
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;
+2 -1
View File
@@ -30,7 +30,8 @@ def block(op, type, dets, script=None):
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:
+4 -2
View File
@@ -166,6 +166,7 @@ class BlkDev(Dev):
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 @@ class BlkDev(Dev):
# 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@cl.cam.ac.uk 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 @@ class BlkDev(Dev):
{ '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)
+5 -4
View File
@@ -280,11 +280,12 @@ typedef struct {
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 {
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.