details: Expose LXC <initarg>

This commit is contained in:
Cole Robinson 2014-05-31 17:34:23 -04:00
parent da73e4980b
commit 091eb9fe26
3 changed files with 63 additions and 20 deletions

View File

@ -2733,22 +2733,11 @@
<property name="top_padding">3</property>
<property name="left_padding">12</property>
<child>
<object class="GtkHBox" id="boot-init-path-box">
<object class="GtkGrid" id="grid3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">12</property>
<child>
<object class="GtkLabel" id="label69">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Init path:</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<property name="row_spacing">6</property>
<property name="column_spacing">6</property>
<child>
<object class="GtkEntry" id="boot-init-path">
<property name="visible">True</property>
@ -2758,9 +2747,54 @@
<signal name="changed" handler="on_boot_init_path_changed" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label69">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Init _path:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">boot-init-path</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label64">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Init ar_gs:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">boot-init-args</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="boot-init-args">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="width_chars">25</property>
<signal name="changed" handler="on_boot_init_args_changed" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
</object>

View File

@ -619,6 +619,7 @@ class vmmDetails(vmmGObjectUI):
"on_boot_initrd_browse_clicked": self.browse_initrd,
"on_boot_dtb_browse_clicked": self.browse_dtb,
"on_boot_init_path_changed": lambda *x: self.enable_apply(x, EDIT_INIT),
"on_boot_init_args_changed": lambda *x: self.enable_apply(x, EDIT_INIT),
"on_disk_readonly_changed": lambda *x: self.enable_apply(x, EDIT_DISK_RO),
"on_disk_shareable_changed": lambda *x: self.enable_apply(x, EDIT_DISK_SHARE),
@ -2091,6 +2092,7 @@ class vmmDetails(vmmGObjectUI):
if self.edited(EDIT_INIT):
kwargs["init"] = self.get_text("boot-init-path")
kwargs["initargs"] = self.get_text("boot-init-args") or ""
if not kwargs["init"]:
return self.err.val_err(_("An init path must be specified"))
@ -3123,8 +3125,9 @@ class vmmDetails(vmmGObjectUI):
self.widget("boot-dtb-box").set_visible(show_dtb)
# <init> populate
init = self.vm.get_init()
init, initargs = self.vm.get_init()
self.widget("boot-init-path").set_text(init or "")
self.widget("boot-init-args").set_text(initargs or "")
# Boot menu populate
menu = self.vm.get_boot_menu() or False

View File

@ -643,7 +643,7 @@ class vmmDomain(vmmLibvirtObject):
def define_boot(self, boot_order=_SENTINEL, boot_menu=_SENTINEL,
kernel=_SENTINEL, initrd=_SENTINEL, dtb=_SENTINEL,
kernel_args=_SENTINEL, init=_SENTINEL):
kernel_args=_SENTINEL, init=_SENTINEL, initargs=_SENTINEL):
def _change_boot_order(guest):
boot_dev_order = []
@ -679,6 +679,7 @@ class vmmDomain(vmmLibvirtObject):
guest.os.enable_bootmenu = bool(boot_menu)
if init != _SENTINEL:
guest.os.init = init
guest.os.set_initargs_string(initargs)
if kernel != _SENTINEL:
guest.os.kernel = kernel or None
@ -1075,7 +1076,12 @@ class vmmDomain(vmmLibvirtObject):
def get_arch(self):
return self.get_xmlobj().os.arch
def get_init(self):
return self.get_xmlobj().os.init
import pipes
init = self.get_xmlobj().os.init
initargs = " ".join(
[pipes.quote(i.val) for i in self.get_xmlobj().os.initargs])
return init, initargs
def get_emulator(self):
return self.get_xmlobj().emulator
def get_machtype(self):