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] Prevent an oops in Dom0 that occurs when a CD device, sp

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Prevent an oops in Dom0 that occurs when a CD device, specified as one
From: Xen patchbot-3.0-testing <patchbot-3.0-testing@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 16 May 2006 19:42:24 +0000
Delivery-date: Tue, 16 May 2006 12:43:46 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 9c1f1e609d4fd82716849c50cd344f7cb7906a3e
# Parent  7ae0f83cf355525e5c14832e77df9b13f67ee92c
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().

Based on a patch from Ross Maxfield at Novell.

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
xen-unstable changeset:   9998:df1521633fb519727adb80f15ea1f2e5b69dc3df
xen-unstable date:        Tue May 16 09:40:38 2006 +0100
---
 linux-2.6-xen-sparse/drivers/xen/blkback/vbd.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff -r 7ae0f83cf355 -r 9c1f1e609d4f 
linux-2.6-xen-sparse/drivers/xen/blkback/vbd.c
--- a/linux-2.6-xen-sparse/drivers/xen/blkback/vbd.c    Mon May 15 07:51:55 
2006 +0100
+++ b/linux-2.6-xen-sparse/drivers/xen/blkback/vbd.c    Tue May 16 09:41:36 
2006 +0100
@@ -55,6 +55,7 @@ int vbd_create(blkif_t *blkif, blkif_vde
               unsigned minor, int readonly)
 {
        struct vbd *vbd;
+       struct block_device *bdev;
 
        vbd = &blkif->vbd;
        vbd->handle   = handle; 
@@ -63,14 +64,16 @@ int vbd_create(blkif_t *blkif, blkif_vde
 
        vbd->pdevice  = MKDEV(major, minor);
 
-       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",
+       bdev = open_by_devnum(vbd->pdevice,
+                             vbd->readonly ? FMODE_READ : FMODE_WRITE);
+
+       if (IS_ERR(bdev)) {
+               DPRINTK("vbd_creat: device %08x could not be opened.\n",
                        vbd->pdevice);
                return -ENOENT;
        }
+
+       vbd->bdev = bdev;
 
        if (vbd->bdev->bd_disk == NULL) {
                DPRINTK("vbd_creat: device %08x doesn't exist.\n",

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

<Prev in Thread] Current Thread [Next in Thread>