rpms/kernel-xen-2.6/devel linux-2.6-xen-blkfront-wait-add.patch, NONE, 1.1.2.1 kernel-xen.spec, 1.30, 1.31

Eduardo Habkost (ehabkost) fedora-extras-commits at redhat.com
Tue Jul 17 20:33:49 UTC 2007


Author: ehabkost

Update of /cvs/pkgs/rpms/kernel-xen-2.6/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12473

Modified Files:
	kernel-xen.spec 
Added Files:
      Tag: private-ehabkost-test-branch
	linux-2.6-xen-blkfront-wait-add.patch 
Log Message:
Make blkfront module wait for the disk to be added (bug #248462)

linux-2.6-xen-blkfront-wait-add.patch:

--- NEW FILE linux-2.6-xen-blkfront-wait-add.patch ---
Index: linux-2.6.20.i386/drivers/xen/blkfront/blkfront.c
===================================================================
--- linux-2.6.20.i386.orig/drivers/xen/blkfront/blkfront.c
+++ linux-2.6.20.i386/drivers/xen/blkfront/blkfront.c
@@ -343,6 +343,8 @@ static void connect(struct blkfront_info
 	spin_unlock_irq(&blkif_io_lock);
 
 	add_disk(info->gd);
+
+	info->is_ready = 1;
 }
 
 /**
@@ -852,6 +854,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 ** */
 
@@ -870,6 +879,7 @@ static struct xenbus_driver blkfront = {
 	.remove = blkfront_remove,
 	.resume = blkfront_resume,
 	.otherend_changed = backend_changed,
+	.is_ready = blkfront_is_ready,
 };
 
 
Index: linux-2.6.20.i386/drivers/xen/blkfront/block.h
===================================================================
--- linux-2.6.20.i386.orig/drivers/xen/blkfront/block.h
+++ linux-2.6.20.i386/drivers/xen/blkfront/block.h
@@ -125,6 +125,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
Index: linux-2.6.20.i386/drivers/xen/xenbus/xenbus_probe.c
===================================================================
--- linux-2.6.20.i386.orig/drivers/xen/xenbus/xenbus_probe.c
+++ linux-2.6.20.i386/drivers/xen/xenbus/xenbus_probe.c
@@ -940,6 +940,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
@@ -952,7 +953,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)
Index: linux-2.6.20.i386/include/xen/xenbus.h
===================================================================
--- linux-2.6.20.i386.orig/include/xen/xenbus.h
+++ linux-2.6.20.i386/include/xen/xenbus.h
@@ -105,6 +105,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)


Index: kernel-xen.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/kernel-xen.spec,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- kernel-xen.spec	12 Jul 2007 15:50:23 -0000	1.30
+++ kernel-xen.spec	17 Jul 2007 20:33:16 -0000	1.31
@@ -382,6 +382,7 @@
 Patch957: linux-2.6-fix-x86_64-vgetcpu.patch
 Patch958: linux-2.6-xen-iscsi-x86_64-no_iommu_init.patch
 Patch959: linux-2.6-xen-fix-nosegneg-detection.patch
+Patch960: linux-2.6-xen-blkfront-wait-add.patch
 
 #
 # Patches 1000 to 5000 are reserved for bugfixes to drivers and filesystems
@@ -905,6 +906,7 @@
 %patch957 -p1
 %patch958 -p1
 %patch959 -p1
+%patch960 -p1
 %endif
 
 #
@@ -2020,6 +2022,9 @@
 #  - tux.
 
 %changelog
+* Tue Jul 17 2007 Eduardo Habkost <ehabkost at redhat.com>
+- Make blkfront module wait for the disk to be added (bug #248462)
+
 * Thu Jul 12 2007 Eduardo Habkost <ehabkost at redhat.com>
 - Remove #ifdef CONFIG_PM from acpi poweroff code (fix bug #241381)
 - BuildRequires: python for xen buildsystem mkheader.py




More information about the fedora-extras-commits mailing list