Skip to contentSkip to conversation

drivers: xen-blkfront: blkif_recover: recheck feature-persistent

PATCH In review Bob Liu 2 participants 5 messages May 26, 2015 – Jun 1, 2015

Subsystems (3)
lore
Share & tools
lore

Bob Liu

author
#0 lore raw

PATCH 1/1 drivers: xen-blkfront: blkif_recover: recheck feature-persistent

When migrate from !feature-persistent host to feature-persistent host, domU still think new host/backend don't support persistent.
Dmesg like:
backed has not unmapped grant: 839
backed has not unmapped grant: 773
backed has not unmapped grant: 773
backed has not unmapped grant: 773
backed has not unmapped grant: 839

We should recheck whether the new backend support feature-persistent during blkif_recover().

---
 drivers/block/xen-blkfront.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/block/xen-blkfront.c +9 -1
index d3c1a95..cad4d8c 100644
@@ -1504,7 +1504,7 @@ static int blkif_recover(struct blkfront_info *info)
 	int i;
 	struct request *req, *n;
 	struct blk_shadow *copy;
-	int rc;
+	int rc, persistent;
 	struct bio *bio, *cloned_bio;
 	struct bio_list bio_list, merge_bio;
 	unsigned int segs, offset;
@@ -1525,6 +1525,14 @@ static int blkif_recover(struct blkfront_info *info)
 	info->shadow_free = info->ring.req_prod_pvt;
 	info->shadow[BLK_RING_SIZE(info)-1].req.u.rw.id = 0x0fffffff;
 
+	/* Should check whether the new backend support feature-persistent */
+	rc = xenbus_gather(XBT_NIL, info->xbdev->otherend,
+			    "feature-persistent", "%u", &persistent,
+			    NULL);
+	if (rc)
+		info->feature_persistent = 0;
+	else
+		info->feature_persistent = persistent;
 	rc = blkfront_setup_indirect(info);
 	if (rc) {
 		kfree(copy);
Signature · 1 line
1.8.3.1
#1 lore raw

El 26/05/15 a les 2.11, Bob Liu ha escrit:

Quoted 11 lines

When migrate from !feature-persistent host to feature-persistent host, domU still think new host/backend don't support persistent.
Dmesg like:
backed has not unmapped grant: 839
backed has not unmapped grant: 773
backed has not unmapped grant: 773
backed has not unmapped grant: 773
backed has not unmapped grant: 839

We should recheck whether the new backend support feature-persistent during blkif_recover().

Right, we recheck for indirect-descriptors but not persistent grants.

Do you think it makes sense to split the part of blkfront_connect that checks for optional features, like persistent grants, indirect descriptors and flush/barrier features to a separate function and call it from both blkfront_connect and blkif_recover?

Roger.

#2 lore raw
In reply to Bob Liu

El 26/05/15 a les 2.11, Bob Liu ha escrit:

Quoted 11 lines

When migrate from !feature-persistent host to feature-persistent host, domU still think new host/backend don't support persistent.
Dmesg like:
backed has not unmapped grant: 839
backed has not unmapped grant: 773
backed has not unmapped grant: 773
backed has not unmapped grant: 773
backed has not unmapped grant: 839

We should recheck whether the new backend support feature-persistent during blkif_recover().

Right, we recheck for indirect-descriptors but not persistent grants.

Do you think it makes sense to split the part of blkfront_connect that checks for optional features, like persistent grants, indirect descriptors and flush/barrier features to a separate function and call it from both blkfront_connect and blkif_recover?

Roger.

author
#3 lore raw
Quoted 13 lines · Roger Pau Monné

El 26/05/15 a les 2.11, Bob Liu ha escrit:

Quoted 11 lines

When migrate from !feature-persistent host to feature-persistent host, domU still think new host/backend don't support persistent.
Dmesg like:
backed has not unmapped grant: 839
backed has not unmapped grant: 773
backed has not unmapped grant: 773
backed has not unmapped grant: 773
backed has not unmapped grant: 839

We should recheck whether the new backend support feature-persistent during blkif_recover().

Quoted 7 lines

Right, we recheck for indirect-descriptors but not persistent grants.

Do you think it makes sense to split the part of blkfront_connect that checks for optional features, like persistent grants, indirect descriptors and flush/barrier features to a separate function and call it from both blkfront_connect and blkif_recover?

Yep, that would be better.

Thanks,
-Bob

author
#4 lore raw
In reply to Roger Pau Monné
Quoted 13 lines · Roger Pau Monné

El 26/05/15 a les 2.11, Bob Liu ha escrit:

Quoted 11 lines

When migrate from !feature-persistent host to feature-persistent host, domU still think new host/backend don't support persistent.
Dmesg like:
backed has not unmapped grant: 839
backed has not unmapped grant: 773
backed has not unmapped grant: 773
backed has not unmapped grant: 773
backed has not unmapped grant: 839

We should recheck whether the new backend support feature-persistent during blkif_recover().

Quoted 7 lines

Right, we recheck for indirect-descriptors but not persistent grants.

Do you think it makes sense to split the part of blkfront_connect that checks for optional features, like persistent grants, indirect descriptors and flush/barrier features to a separate function and call it from both blkfront_connect and blkif_recover?

Yep, that would be better.

Thanks,
-Bob