Merge "xen: pass Xen console in cmdline"
This commit is contained in:
commit
d53183c357
|
@ -2019,7 +2019,8 @@ class LibvirtConnTestCase(test.NoDBTestCase,
|
||||||
self.assertEqual(instance_ref.flavor.vcpus, cfg.vcpus)
|
self.assertEqual(instance_ref.flavor.vcpus, cfg.vcpus)
|
||||||
self.assertEqual(fields.VMMode.EXE, cfg.os_type)
|
self.assertEqual(fields.VMMode.EXE, cfg.os_type)
|
||||||
self.assertEqual("/sbin/init", cfg.os_init_path)
|
self.assertEqual("/sbin/init", cfg.os_init_path)
|
||||||
self.assertEqual("console=tty0 console=ttyS0", cfg.os_cmdline)
|
self.assertEqual("console=tty0 console=ttyS0 console=hvc0",
|
||||||
|
cfg.os_cmdline)
|
||||||
self.assertIsNone(cfg.os_root)
|
self.assertIsNone(cfg.os_root)
|
||||||
self.assertEqual(3, len(cfg.devices))
|
self.assertEqual(3, len(cfg.devices))
|
||||||
self.assertIsInstance(cfg.devices[0],
|
self.assertIsInstance(cfg.devices[0],
|
||||||
|
@ -2044,7 +2045,8 @@ class LibvirtConnTestCase(test.NoDBTestCase,
|
||||||
self.assertEqual(instance_ref.vcpus, cfg.vcpus)
|
self.assertEqual(instance_ref.vcpus, cfg.vcpus)
|
||||||
self.assertEqual(fields.VMMode.EXE, cfg.os_type)
|
self.assertEqual(fields.VMMode.EXE, cfg.os_type)
|
||||||
self.assertEqual("/sbin/init", cfg.os_init_path)
|
self.assertEqual("/sbin/init", cfg.os_init_path)
|
||||||
self.assertEqual("console=tty0 console=ttyS0", cfg.os_cmdline)
|
self.assertEqual("console=tty0 console=ttyS0 console=hvc0",
|
||||||
|
cfg.os_cmdline)
|
||||||
self.assertIsNone(cfg.os_root)
|
self.assertIsNone(cfg.os_root)
|
||||||
self.assertEqual(3, len(cfg.devices))
|
self.assertEqual(3, len(cfg.devices))
|
||||||
self.assertIsInstance(cfg.devices[0],
|
self.assertIsInstance(cfg.devices[0],
|
||||||
|
@ -5341,9 +5343,9 @@ class LibvirtConnTestCase(test.NoDBTestCase,
|
||||||
instance_ref,
|
instance_ref,
|
||||||
image_meta)
|
image_meta)
|
||||||
|
|
||||||
# the instance has 'root=/dev/vda console=tty0 console=ttyS0' set by
|
# the instance has 'root=/dev/vda console=tty0 console=ttyS0
|
||||||
# default, so testing an empty string and None value in the
|
# console=hvc0' set by default, so testing an empty string and None
|
||||||
# os_command_line image property must pass
|
# value in the os_command_line image property must pass
|
||||||
cfg = drvr._get_guest_config(instance_ref,
|
cfg = drvr._get_guest_config(instance_ref,
|
||||||
_fake_network_info(self, 1),
|
_fake_network_info(self, 1),
|
||||||
image_meta, disk_info)
|
image_meta, disk_info)
|
||||||
|
@ -6861,11 +6863,10 @@ class LibvirtConnTestCase(test.NoDBTestCase,
|
||||||
check = (lambda t: "no_timer_check" in t.find('./os/cmdline').
|
check = (lambda t: "no_timer_check" in t.find('./os/cmdline').
|
||||||
text, hypervisor_type == "qemu")
|
text, hypervisor_type == "qemu")
|
||||||
check_list.append(check)
|
check_list.append(check)
|
||||||
# Hypervisors that only support vm_mode.HVM and Xen
|
# Hypervisors that only support vm_mode.HVM should not produce
|
||||||
# should not produce configuration that results in kernel
|
# configuration that results in kernel arguments
|
||||||
# arguments
|
|
||||||
if not expect_kernel and (hypervisor_type in
|
if not expect_kernel and (hypervisor_type in
|
||||||
['qemu', 'kvm', 'xen']):
|
['qemu', 'kvm']):
|
||||||
check = (lambda t: t.find('./os/root'), None)
|
check = (lambda t: t.find('./os/root'), None)
|
||||||
check_list.append(check)
|
check_list.append(check)
|
||||||
check = (lambda t: t.find('./os/cmdline'), None)
|
check = (lambda t: t.find('./os/cmdline'), None)
|
||||||
|
|
|
@ -138,7 +138,7 @@ DISABLE_PREFIX = 'AUTO: '
|
||||||
DISABLE_REASON_UNDEFINED = None
|
DISABLE_REASON_UNDEFINED = None
|
||||||
|
|
||||||
# Guest config console string
|
# Guest config console string
|
||||||
CONSOLE = "console=tty0 console=ttyS0"
|
CONSOLE = "console=tty0 console=ttyS0 console=hvc0"
|
||||||
|
|
||||||
GuestNumaConfig = collections.namedtuple(
|
GuestNumaConfig = collections.namedtuple(
|
||||||
'GuestNumaConfig', ['cpuset', 'cputune', 'numaconfig', 'numatune'])
|
'GuestNumaConfig', ['cpuset', 'cputune', 'numaconfig', 'numatune'])
|
||||||
|
@ -4164,24 +4164,18 @@ class LibvirtDriver(driver.ComputeDriver):
|
||||||
root_device_name):
|
root_device_name):
|
||||||
if rescue.get('kernel_id'):
|
if rescue.get('kernel_id'):
|
||||||
guest.os_kernel = os.path.join(inst_path, "kernel.rescue")
|
guest.os_kernel = os.path.join(inst_path, "kernel.rescue")
|
||||||
if virt_type == "xen":
|
guest.os_cmdline = ("root=%s %s" % (root_device_name, CONSOLE))
|
||||||
guest.os_cmdline = "ro root=%s" % root_device_name
|
if virt_type == "qemu":
|
||||||
else:
|
guest.os_cmdline += " no_timer_check"
|
||||||
guest.os_cmdline = ("root=%s %s" % (root_device_name, CONSOLE))
|
|
||||||
if virt_type == "qemu":
|
|
||||||
guest.os_cmdline += " no_timer_check"
|
|
||||||
if rescue.get('ramdisk_id'):
|
if rescue.get('ramdisk_id'):
|
||||||
guest.os_initrd = os.path.join(inst_path, "ramdisk.rescue")
|
guest.os_initrd = os.path.join(inst_path, "ramdisk.rescue")
|
||||||
|
|
||||||
def _set_guest_for_inst_kernel(self, instance, guest, inst_path, virt_type,
|
def _set_guest_for_inst_kernel(self, instance, guest, inst_path, virt_type,
|
||||||
root_device_name, image_meta):
|
root_device_name, image_meta):
|
||||||
guest.os_kernel = os.path.join(inst_path, "kernel")
|
guest.os_kernel = os.path.join(inst_path, "kernel")
|
||||||
if virt_type == "xen":
|
guest.os_cmdline = ("root=%s %s" % (root_device_name, CONSOLE))
|
||||||
guest.os_cmdline = "ro root=%s" % root_device_name
|
if virt_type == "qemu":
|
||||||
else:
|
guest.os_cmdline += " no_timer_check"
|
||||||
guest.os_cmdline = ("root=%s %s" % (root_device_name, CONSOLE))
|
|
||||||
if virt_type == "qemu":
|
|
||||||
guest.os_cmdline += " no_timer_check"
|
|
||||||
if instance.ramdisk_id:
|
if instance.ramdisk_id:
|
||||||
guest.os_initrd = os.path.join(inst_path, "ramdisk")
|
guest.os_initrd = os.path.join(inst_path, "ramdisk")
|
||||||
# we only support os_command_line with images with an explicit
|
# we only support os_command_line with images with an explicit
|
||||||
|
@ -4453,6 +4447,8 @@ class LibvirtDriver(driver.ComputeDriver):
|
||||||
if virt_type == "xen":
|
if virt_type == "xen":
|
||||||
if guest.os_type == fields.VMMode.HVM:
|
if guest.os_type == fields.VMMode.HVM:
|
||||||
guest.os_loader = CONF.libvirt.xen_hvmloader_path
|
guest.os_loader = CONF.libvirt.xen_hvmloader_path
|
||||||
|
else:
|
||||||
|
guest.os_cmdline = CONSOLE
|
||||||
elif virt_type in ("kvm", "qemu"):
|
elif virt_type in ("kvm", "qemu"):
|
||||||
if caps.host.cpu.arch in (fields.Architecture.I686,
|
if caps.host.cpu.arch in (fields.Architecture.I686,
|
||||||
fields.Architecture.X86_64):
|
fields.Architecture.X86_64):
|
||||||
|
|
Loading…
Reference in New Issue