# HG changeset patch
# User Richard Maciel <richardm(a)br.ibm.com>
# Date 1258638317 7200
# Node ID 4ad5082fcf734404f9fe64180dc4a5dcc21037c2
# Parent f834593694d2f3eefc3b0285ac62032ddc68edd0
[TEST] (#2) Add the emulator to the guest created by LXC cimtest
#2:
- Added set_emulator method
- Removed unnecessary comment
Signed-off-by: Richard Maciel <rmaciel(a)linux.vnet.ibm.com>
diff -r f834593694d2 -r 4ad5082fcf73 suites/libvirt-cim/lib/XenKvmLib/const.py
--- a/suites/libvirt-cim/lib/XenKvmLib/const.py Wed Nov 18 17:24:36 2009 -0200
+++ b/suites/libvirt-cim/lib/XenKvmLib/const.py Thu Nov 19 11:45:17 2009 -0200
@@ -104,6 +104,7 @@
#vxml.LXCXML
LXC_init_path = os.path.join(_image_dir, 'cimtest_lxc_init')
+LXC_default_emulator = '/usr/libexec/libvirt_lxc'
LXC_default_tty = '/dev/ptmx'
LXC_default_mp = '/tmp'
LXC_default_source = '/var/lib/libvirt/images/lxc_files'
diff -r f834593694d2 -r 4ad5082fcf73 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 Thu Nov 19 11:45:17 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)
self.create_lxc_file(CIM_IP, const.LXC_init_path)
def _os(self, os_init):
@@ -995,15 +995,20 @@
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)
+
if const.LXC_netns_support is True:
self.set_interface_details(devices, net_mac, net_type,
net_name, 'LXC')
self.add_sub_node(devices, 'console', tty = tty_set)
+ def set_emulator(self, emu):
+ return self._set_emulator(emu)
+
def create_lxc_file(self, ip, lxc_file):
try:
f = open(lxc_file, 'w')