xend: 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 <herbert.van.den.bergh@oracle.com>
Signed-off-by: Kurt Hackel <kurt.hackel@oracle.com>
This commit is contained in:
Keir Fraser committed 2008-05-14 09:19:05 +01:00
1 parent 9d7437ea1d
commit 09951b66a6
2 files changed
+14 -1

No files matched your search

+8
View File
@@ -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):
+6 -1
View File
@@ -610,7 +610,7 @@ def configure_image(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)
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.