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/
Home Products Support Community News


[Xen-devel][PATCH] opps in blockback when missing media

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel][PATCH] opps in blockback when missing media
From: "Ross Maxfield" <rmaxfiel@xxxxxxxxxx>
Date: Mon, 15 May 2006 12:14:35 -0600
Delivery-date: Mon, 15 May 2006 11:15:09 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <4468C0AF.5010006@xxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <4468C0AF.5010006@xxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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

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->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
+               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
        err = xenbus_transaction_start(&xbt);

Attachment: blkback-missing-media.diff
Description: Binary data

Xen-devel mailing list
<Prev in Thread] Current Thread [Next in Thread>