Revision 07813a9e lib/hypervisor/hv_xen.py

b/lib/hypervisor/hv_xen.py
44 44
  """
45 45

  
46 46
  @classmethod
47
  def _WriteConfigFile(cls, instance, block_devices, extra_args):
47
  def _WriteConfigFile(cls, instance, block_devices):
48 48
    """Write the Xen config file for the instance.
49 49

  
50 50
    """
......
159 159
    xm_list = self._GetXMList(False)
160 160
    return xm_list
161 161

  
162
  def StartInstance(self, instance, block_devices, extra_args):
162
  def StartInstance(self, instance, block_devices):
163 163
    """Start an instance.
164 164

  
165 165
    """
166
    self._WriteConfigFile(instance, block_devices, extra_args)
166
    self._WriteConfigFile(instance, block_devices)
167 167
    result = utils.RunCmd(["xm", "create", instance.name])
168 168

  
169 169
    if result.failed:
......
386 386
    constants.HV_KERNEL_PATH,
387 387
    constants.HV_INITRD_PATH,
388 388
    constants.HV_ROOT_PATH,
389
    constants.HV_KERNEL_ARGS,
389 390
    ]
390 391

  
391 392
  @classmethod
......
435 436
                                   " not a file" % initrd_path)
436 437

  
437 438
  @classmethod
438
  def _WriteConfigFile(cls, instance, block_devices, extra_args):
439
  def _WriteConfigFile(cls, instance, block_devices):
439 440
    """Write the Xen config file for the instance.
440 441

  
441 442
    """
......
470 471
                 cls._GetConfigFileDiskData(instance.disk_template,
471 472
                                            block_devices)))
472 473

  
473
    rpath = instance.hvparams[constants.HV_ROOT_PATH]
474
    config.write("root = '%s ro'\n" % rpath)
474
    config.write("root = '%s'\n" % hvp[constants.HV_ROOT_PATH])
475 475
    config.write("on_poweroff = 'destroy'\n")
476 476
    config.write("on_reboot = 'restart'\n")
477 477
    config.write("on_crash = 'restart'\n")
478
    if extra_args:
479
      config.write("extra = '%s'\n" % extra_args)
478
    config.write("extra = '%s'\n" % hvp[constants.HV_KERNEL_ARGS])
480 479
    # just in case it exists
481 480
    utils.RemoveFile("/etc/xen/auto/%s" % instance.name)
482 481
    try:
......
563 562
                                   iso_path)
564 563

  
565 564
  @classmethod
566
  def _WriteConfigFile(cls, instance, block_devices, extra_args):
565
  def _WriteConfigFile(cls, instance, block_devices):
567 566
    """Create a Xen 3.1 HVM config file.
568 567

  
569 568
    """
......
654 653
    config.write("on_poweroff = 'destroy'\n")
655 654
    config.write("on_reboot = 'restart'\n")
656 655
    config.write("on_crash = 'restart'\n")
657
    if extra_args:
658
      config.write("extra = '%s'\n" % extra_args)
656
    config.write("extra = '%s'\n" % hvp[constants.HV_KERNEL_ARGS])
659 657
    # just in case it exists
660 658
    utils.RemoveFile("/etc/xen/auto/%s" % instance.name)
661 659
    try:

Also available in: Unified diff