ia64/xen-unstable

changeset 897:38ad3cea577f

bitkeeper revision 1.565 (3fa916a9omQrijJLZBNMaip_G452lQ)

tweak
author smh22@labyrinth.cl.cam.ac.uk
date Wed Nov 05 15:26:33 2003 +0000 (2003-11-05)
parents 352a82eb57ad
children db4b686bbf64
files xen/drivers/block/xen_vbd.c xen/include/hypervisor-ifs/vbd.h
line diff
     1.1 --- a/xen/drivers/block/xen_vbd.c	Wed Nov 05 15:12:12 2003 +0000
     1.2 +++ b/xen/drivers/block/xen_vbd.c	Wed Nov 05 15:26:33 2003 +0000
     1.3 @@ -189,11 +189,13 @@ void vbd_probe_devices(xen_disk_info_t *
     1.4  
     1.5      for(i = 0; i < VBD_HTAB_SZ; i++) { 
     1.6  	for(v = p->vbdtab[i]; v; v = v->next) { 
     1.7 +
     1.8  	    xdi->disks[xdi->count].device   = v->vdevice; 
     1.9  	    xdi->disks[xdi->count].info     = XD_FLAG_VIRT | XD_TYPE_DISK; 
    1.10  
    1.11 -	    /* XXX SMH: and now set XD_FLAG_RO if necessary */
    1.12 -
    1.13 +	    if(!VBD_CAN_WRITE(v))
    1.14 +		xdi->disks[xdi->count].info    |= XD_FLAG_RO; 
    1.15 +		
    1.16  	    xdi->disks[xdi->count].capacity = 0; 
    1.17  	    for(x = v->extents; x; x = x->next) 
    1.18  		xdi->disks[xdi->count].capacity += x->extent.nr_sectors; 
     2.1 --- a/xen/include/hypervisor-ifs/vbd.h	Wed Nov 05 15:12:12 2003 +0000
     2.2 +++ b/xen/include/hypervisor-ifs/vbd.h	Wed Nov 05 15:26:33 2003 +0000
     2.3 @@ -28,7 +28,7 @@ typedef struct _xen_extent {
     2.4  #define VBD_MODE_W         0x2
     2.5  
     2.6  #define VBD_CAN_READ(_v)  ((_v)->mode & VBD_MODE_R)
     2.7 -#define VBD_CAN_WRITE(_v) ((_v)->mode & VBD_MODE_R)
     2.8 +#define VBD_CAN_WRITE(_v) ((_v)->mode & VBD_MODE_W)
     2.9  
    2.10    
    2.11  typedef struct _vbd_create {