On 11/18/2009 11:10 PM, Kaitlin Rupert wrote:
> diff -r f834593694d2 -r 815eeee7df1d
> suites/libvirt-cim/lib/XenKvmLib/vxml.py
> --- a/suites/libvirt-cim/lib/XenKvmLib/vxml.py Wed Nov 18 17:24:36
> 2009 -0200
> +++ b/suites/libvirt-cim/lib/XenKvmLib/vxml.py Wed Nov 18 17:42:15
> 2009 -0200
> @@ -987,7 +987,7 @@
> mem, const.default_mallocunits, None, grstype, address, port_num,
> keymap, irstype, btype, vnc_passwd)
> self._os(const.LXC_init_path)
> - self._devices(mac, ntype, net_name, const.LXC_default_tty)
> + self._devices(const.LXC_default_emulator, mac, ntype, net_name,
> const.LXC_default_tty)
I would modify the __init__ function of LXCXML to accept an emulator
param. We do something similar with KVM. This provides the option for
specifying other emulators (which might be useful in the future, or
useful for testing negative test cases).
None of the other virtualization classes (KVMXML, XenXML, XenFVXML)
include the emulator as a param in their __init__. Instead, they define
a set_emulator method that lets the user change it. So, I changed my
code following the established convention.
> self.create_lxc_file(CIM_IP, const.LXC_init_path)
>
> def _os(self, os_init):
> @@ -995,9 +995,11 @@
> self.add_sub_node(os, 'init', os_init)
> self.add_sub_node(os, 'type', 'exe')
>
> - def _devices(self, net_mac, net_type, net_name, tty_set):
> + def _devices(self, emu, net_mac, net_type, net_name, tty_set):
> devices = self.get_node('/domain/devices')
> - + + self.add_sub_node(devices, 'emulator', emu)
> #'/usr/libexec/libvirt_lxc')
Can you remove the comment here? If we change the value of the emulator
in const.py, it's likely the comment won't get updated.
> + if const.LXC_netns_support is True:
> self.set_interface_details(devices, net_mac, net_type, net_name, 'LXC')
>
--
Richard Maciel, MSc
IBM Linux Technology Center
rmaciel(a)linux.vnet.ibm.com