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] [linux-2.6.18-xen] Delay wait for block devices until af

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] Delay wait for block devices until after the disk is added.
From: "Xen patchbot-linux-2.6.18-xen" <patchbot-linux-2.6.18-xen@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 06 Jul 2007 06:30:51 -0700
Delivery-date: Fri, 06 Jul 2007 06:29:05 -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 Christian Limpach <Christian.Limpach@xxxxxxxxxxxxx>
# Date 1183716504 -3600
# Node ID 11483a00c017ea82a4c2948724eb36ba6ec5c0ba
# Parent  cb040341e05af32c804afef4216ec5491dcbf9e3
Delay wait for block devices until after the disk is added.

Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxxx>
---
 drivers/xen/blkfront/blkfront.c   |   10 ++++++++++
 drivers/xen/blkfront/block.h      |    1 +
 drivers/xen/xenbus/xenbus_probe.c |    5 ++++-
 include/xen/xenbus.h              |    1 +
 4 files changed, 16 insertions(+), 1 deletion(-)

diff -r cb040341e05a -r 11483a00c017 drivers/xen/blkfront/blkfront.c
--- a/drivers/xen/blkfront/blkfront.c   Mon Jul 02 17:19:24 2007 +0100
+++ b/drivers/xen/blkfront/blkfront.c   Fri Jul 06 11:08:24 2007 +0100
@@ -354,6 +354,8 @@ static void connect(struct blkfront_info
        spin_unlock_irq(&blkif_io_lock);
 
        add_disk(info->gd);
+
+       info->is_ready = 1;
 }
 
 /**
@@ -862,6 +864,13 @@ static void blkif_recover(struct blkfron
        spin_unlock_irq(&blkif_io_lock);
 }
 
+int blkfront_is_ready(struct xenbus_device *dev)
+{
+       struct blkfront_info *info = dev->dev.driver_data;
+
+       return info->is_ready;
+}
+
 
 /* ** Driver Registration ** */
 
@@ -880,6 +889,7 @@ static struct xenbus_driver blkfront = {
        .remove = blkfront_remove,
        .resume = blkfront_resume,
        .otherend_changed = backend_changed,
+       .is_ready = blkfront_is_ready,
 };
 
 
diff -r cb040341e05a -r 11483a00c017 drivers/xen/blkfront/block.h
--- a/drivers/xen/blkfront/block.h      Mon Jul 02 17:19:24 2007 +0100
+++ b/drivers/xen/blkfront/block.h      Fri Jul 06 11:08:24 2007 +0100
@@ -111,6 +111,7 @@ struct blkfront_info
        struct blk_shadow shadow[BLK_RING_SIZE];
        unsigned long shadow_free;
        int feature_barrier;
+       int is_ready;
 
        /**
         * The number of people holding this device open.  We won't allow a
diff -r cb040341e05a -r 11483a00c017 drivers/xen/xenbus/xenbus_probe.c
--- a/drivers/xen/xenbus/xenbus_probe.c Mon Jul 02 17:19:24 2007 +0100
+++ b/drivers/xen/xenbus/xenbus_probe.c Fri Jul 06 11:08:24 2007 +0100
@@ -993,6 +993,7 @@ static int is_disconnected_device(struct
 {
        struct xenbus_device *xendev = to_xenbus_device(dev);
        struct device_driver *drv = data;
+       struct xenbus_driver *xendrv;
 
        /*
         * A device with no driver will never connect. We care only about
@@ -1005,7 +1006,9 @@ static int is_disconnected_device(struct
        if (drv && (dev->driver != drv))
                return 0;
 
-       return (xendev->state != XenbusStateConnected);
+       xendrv = to_xenbus_driver(dev->driver);
+       return (xendev->state != XenbusStateConnected ||
+               (xendrv->is_ready && !xendrv->is_ready(xendev)));
 }
 
 static int exists_disconnected_device(struct device_driver *drv)
diff -r cb040341e05a -r 11483a00c017 include/xen/xenbus.h
--- a/include/xen/xenbus.h      Mon Jul 02 17:19:24 2007 +0100
+++ b/include/xen/xenbus.h      Fri Jul 06 11:08:24 2007 +0100
@@ -106,6 +106,7 @@ struct xenbus_driver {
        int (*uevent)(struct xenbus_device *, char **, int, char *, int);
        struct device_driver driver;
        int (*read_otherend_details)(struct xenbus_device *dev);
+       int (*is_ready)(struct xenbus_device *dev);
 };
 
 static inline struct xenbus_driver *to_xenbus_driver(struct device_driver *drv)

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [linux-2.6.18-xen] Delay wait for block devices until after the disk is added., Xen patchbot-linux-2.6.18-xen <=