From: Kurt Hackel Subject: [PATCH] xend: fix block protocol mismatch on save-restore Date: Tue, 13 May 2008 14:16:08 -0700 Message-ID: <20080513211607.GD6470@ca-server1.us.oracle.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="SLDf9lqlvOQaIe6s" Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --SLDf9lqlvOQaIe6s Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, This fixes the mismatch of the block abi protocol across a save/restore or live migration. Without this fix the protocol is assumed to be the same as the dom0 protocol, resulting in a failure to restore or migrate the domain if it does not match dom0. Thanks kurt -- --SLDf9lqlvOQaIe6s Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=patch PATCH: fix block protocol mismatch on save/restore The protocol field of the blkif interface is correct at startup for a guest of a different mode from dom0 (eg. 32-bit dom0, 64-bit guest). However, this property is not persisted on save, so a later restore (or migrate) will setup the block interface with the wrong mode. Signed-off-by: Herbert van den Bergh Signed-off-by: Kurt Hackel diff -r 53195719f762 tools/python/xen/xend/server/blkif.py --- a/tools/python/xen/xend/server/blkif.py Tue May 13 15:08:17 2008 +0100 +++ b/tools/python/xen/xend/server/blkif.py Tue May 13 13:54:07 2008 -0700 @@ -89,6 +89,10 @@ class BlkifController(DevController): 'device-type' : dev_type } + protocol = config.get('protocol') + if protocol: + front['protocol'] = protocol + return (devid, back, front) def do_access_control(self, config, uname): @@ -162,6 +166,10 @@ class BlkifController(DevController): if uuid: config['uuid'] = uuid + proto = self.readFrontend(devid, 'protocol') + if proto: + config['protocol'] = proto + return config def destroyDevice(self, devid, force): diff -r 53195719f762 tools/python/xen/xm/create.py --- a/tools/python/xen/xm/create.py Tue May 13 15:08:17 2008 +0100 +++ b/tools/python/xen/xm/create.py Tue May 13 13:54:07 2008 -0700 @@ -610,7 +610,7 @@ def configure_disks(config_devs, vals): def configure_disks(config_devs, vals): """Create the config for disks (virtual block devices). """ - for (uname, dev, mode, backend) in vals.disk: + for (uname, dev, mode, backend, protocol) in vals.disk: if uname.startswith('tap:'): cls = 'tap' else: @@ -622,6 +622,8 @@ def configure_disks(config_devs, vals): ['mode', mode ] ] if backend: config_vbd.append(['backend', backend]) + if protocol: + config_vbd.append(['protocol', protocol]) config_devs.append(['device', config_vbd]) def configure_pci(config_devs, vals): @@ -845,7 +847,10 @@ def preprocess_disk(vals): n = len(d) if n == 3: d.append(None) + d.append(None) elif n == 4: + d.append(None) + elif n == 5: pass else: err('Invalid disk specifier: ' + v) --SLDf9lqlvOQaIe6s Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --SLDf9lqlvOQaIe6s--