From: Chris Lalancette <clalance@redhat.com> Date: Thu, 5 Mar 2009 14:11:37 +0100 Subject: [xen] only recover connected devices on resume Message-id: 49AFCF89.3000104@redhat.com O-Subject: [RHEL5.4 PATCH 1/2]: Only recover connected devices on resume Bugzilla: 396621 RH-Acked-by: Don Dutile <ddutile@redhat.com> RH-Acked-by: Rik van Riel <riel@redhat.com> This patch is strictly a bugfix in the save/resume path, noticed while testing this patch series. What was happening was that I was getting a panic on resume for an FV guest that had PV-on-HVM drivers loaded, but not in use. This is because on the resume path we were freeing an info structure that never existed in the first place. This patch is just a re-diff of upstream xen-unstable c/s 12526, and fixes the problem in testing. diff --git a/drivers/xen/blkfront/blkfront.c b/drivers/xen/blkfront/blkfront.c index 0798ad7..f8cba8f 100644 --- a/drivers/xen/blkfront/blkfront.c +++ b/drivers/xen/blkfront/blkfront.c @@ -144,10 +144,10 @@ static int blkfront_resume(struct xenbus_device *dev) DPRINTK("blkfront_resume: %s\n", dev->nodename); - blkif_free(info, 1); + blkif_free(info, info->connected == BLKIF_STATE_CONNECTED); err = talk_to_backend(dev, info); - if (!err) + if (info->connected == BLKIF_STATE_SUSPENDED && !err) blkif_recover(info); return err;