| Hello,
I've created a patch to prevent an oops in Dom0 that occurs when a CD
device, specified as one of the 'hardrives' in the 'disk=' line of a
para-virtualized guest's def file, has no media when the guest is
started.
The oops occurs in vbd.c when vbd_size() is called from connect() (in
xenbus.c) and the vbd pointer is really an error code that comes from
the failed open that occurred in vbd_create().
This patch applies to changeset 9993
signed off by Ross Maxfield <rmaxfiel@xxxxxxxxxx>
--- a/linux-2.6-xen-sparse/drivers/xen/blkback/vbd.c    Mon May 15
16:32:09 2006 +0100
+++ b/linux-2.6-xen-sparse/drivers/xen/blkback/vbd.c    Mon May 15
11:49:39 2006 -0600
@@ -66,9 +66,10 @@ int vbd_create(blkif_t *blkif, blkif_vde
        vbd->bdev = open_by_devnum(
                vbd->pdevice,
                vbd->readonly ? FMODE_READ : FMODE_WRITE);
+
        if (IS_ERR(vbd->bdev)) {
-               DPRINTK("vbd_creat: device %08x doesn't exist.\n",
-                       vbd->pdevice);
+               DPRINTK("vbd_creat: device %08x could not be
opened.\n",
+               vbd->bdev = NULL;
                return -ENOENT;
        }
diff -r dc213d745642 linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c
--- a/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c Mon May 15
16:32:09 2006 +0100
+++ b/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c Mon May 15
11:49:39 2006 -0600
@@ -305,6 +305,9 @@ static void connect(struct backend_info
        DPRINTK("%s", dev->otherend);
+        if (be->blkif->vbd.bdev == NULL)
+               return;
+
        /* Supply the information about the device the frontend needs
*/
 again:
        err = xenbus_transaction_start(&xbt);
 blkback-missing-media.diff Description: Binary data
 _______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
 |