2007-05-12 12:54:21 +02:00
|
|
|
Index: xen-3.1-testing/tools/python/xen/xend/XendBootloader.py
|
2007-02-11 11:48:10 +01:00
|
|
|
===================================================================
|
2007-05-12 12:54:21 +02:00
|
|
|
--- xen-3.1-testing.orig/tools/python/xen/xend/XendBootloader.py
|
|
|
|
+++ xen-3.1-testing/tools/python/xen/xend/XendBootloader.py
|
2007-02-11 11:48:10 +01:00
|
|
|
@@ -14,6 +14,7 @@
|
|
|
|
|
2007-05-04 00:32:49 +02:00
|
|
|
import os, select, errno, stat, signal
|
2007-02-11 11:48:10 +01:00
|
|
|
import random
|
|
|
|
+import re
|
|
|
|
import shlex
|
|
|
|
from xen.xend import sxp
|
|
|
|
|
2007-05-04 00:32:49 +02:00
|
|
|
@@ -187,3 +188,14 @@ def bootloader_tidy(dom):
|
|
|
|
os.kill(pid, signal.SIGKILL)
|
|
|
|
|
|
|
|
|
2007-02-11 11:48:10 +01:00
|
|
|
+def bootfilter(bootloader, bootloader_args, vdisk):
|
|
|
|
+ """Is this virtual disk ok to boot from?"""
|
|
|
|
+ if vdisk.endswith(':disk'):
|
|
|
|
+ vdisk = vdisk[:-5] # temporary work-around for bug 237414
|
|
|
|
+ if bootloader.endswith('domUloader.py'):
|
|
|
|
+ for arg in bootloader_args.split():
|
|
|
|
+ if arg.startswith('--entry='):
|
|
|
|
+ m = re.match(r'^([hsx]v?d[a-z])[0-9]*:[^,]*(,[^,]*)?$', arg[8:])
|
|
|
|
+ if m:
|
|
|
|
+ return vdisk == m.group(1) or vdisk == m.group(2)
|
|
|
|
+ return True
|
2007-05-12 12:54:21 +02:00
|
|
|
Index: xen-3.1-testing/tools/python/xen/xend/XendDomainInfo.py
|
2007-03-06 09:12:51 +01:00
|
|
|
===================================================================
|
2007-05-12 12:54:21 +02:00
|
|
|
--- xen-3.1-testing.orig/tools/python/xen/xend/XendDomainInfo.py
|
|
|
|
+++ xen-3.1-testing/tools/python/xen/xend/XendDomainInfo.py
|
2007-05-04 00:32:49 +02:00
|
|
|
@@ -42,7 +42,7 @@ from xen.xend import balloon, sxp, uuid,
|
|
|
|
from xen.xend import XendOptions, XendNode, XendConfig
|
2007-03-06 09:12:51 +01:00
|
|
|
|
|
|
|
from xen.xend.XendConfig import scrub_password
|
2007-05-04 00:32:49 +02:00
|
|
|
-from xen.xend.XendBootloader import bootloader, bootloader_tidy
|
|
|
|
+from xen.xend.XendBootloader import bootloader, bootloader_tidy, bootfilter
|
2007-03-06 09:12:51 +01:00
|
|
|
from xen.xend.XendError import XendError, VmError
|
|
|
|
from xen.xend.XendDevices import XendDevices
|
2007-05-04 00:32:49 +02:00
|
|
|
from xen.xend.XendTask import XendTask
|
2007-05-12 12:54:21 +02:00
|
|
|
@@ -1783,8 +1783,11 @@ class XendDomainInfo:
|
2007-05-04 00:32:49 +02:00
|
|
|
blexec = osdep.pygrub_path
|
|
|
|
|
|
|
|
blcfg = None
|
|
|
|
- disks = [x for x in self.info['vbd_refs']
|
|
|
|
- if self.info['devices'][x][1]['bootable']]
|
|
|
|
+ disks = []
|
|
|
|
+ for x in self.info['vbd_refs']:
|
|
|
|
+ vdisk = self.info['devices'][x][1]['dev']
|
|
|
|
+ if bootfilter(blexec, bootloader_args, vdisk):
|
|
|
|
+ disks.append(x)
|
|
|
|
|
|
|
|
if not disks:
|
|
|
|
msg = "Had a bootloader specified, but no disks are bootable"
|