- move hardcoded xen configuration name to config file

svn path=/trunk/; revision=33496
This commit is contained in:
Johannes Anderwald
2008-05-13 16:22:31 +00:00
parent df3c1568fa
commit 74f90fc65a
3 changed files with 32 additions and 16 deletions
+17 -12
View File
@@ -66,6 +66,7 @@ namespace Sysreg_
string RosBootTest::ROS_EMU_MEM = "ROS_EMU_MEM";
string RosBootTest::ROS_BOOT_CMD = "ROS_BOOT_CMD";
string RosBootTest::XEN_CONFIG_FILE = "XEN_CONFIG_FILE";
string RosBootTest::XEN_CONFIG_NAME = "XEN_CONFIG_NAME";
#ifdef __LINUX__
string RosBootTest::ROS_EMU_PATH = "ROS_EMU_PATH_LIN";
@@ -662,7 +663,7 @@ namespace Sysreg_
}
//---------------------------------------------------------------------------------------
bool RosBootTest::configureXen()
bool RosBootTest::configureXen(ConfigParser &conf_parser)
{
if (!xenGetCaps())
{
@@ -674,8 +675,9 @@ namespace Sysreg_
cerr << "Xen configuration file missing" << endl;
return false;
}
m_Src = "xm console reactos";
m_Src = "xm console ";
string xen_name = "reactos";
conf_parser.getStringValue(RosBootTest::XEN_CONFIG_NAME, xen_name);
m_DataSource = new PipeReader();
m_BootCmd = m_EmuPath + "/xm create " + m_XenConfig;
@@ -740,14 +742,17 @@ namespace Sysreg_
return true;
}
//---------------------------------------------------------------------------------------
void RosBootTest::cleanup()
void RosBootTest::cleanup(ConfigParser &conf_parser)
{
m_DataSource->closeSource();
OsSupport::delayExecution(3);
if (m_EmuType == EMU_TYPE_XEN)
{
system("xm destroy reactos");
string xen_name = "reactos";
conf_parser.getStringValue(RosBootTest::XEN_CONFIG_NAME, xen_name);
string cmd = "xm destroy " + xen_name;
system(cmd.c_str ());
}
else
{
@@ -791,7 +796,7 @@ namespace Sysreg_
}
else if (m_EmuType == EMU_TYPE_XEN)
{
if (!configureXen())
if (!configureXen(conf_parser))
{
cerr << "Error: failed to configure xen" << endl;
return false;
@@ -815,7 +820,7 @@ namespace Sysreg_
if (!m_DataSource->openSource(m_Src))
{
cerr << "Error: failed to open data source with " << m_Src << endl;
cleanup();
cleanup(conf_parser);
return false;
}
#ifdef __LINUX__
@@ -832,7 +837,7 @@ namespace Sysreg_
if (!file)
{
cerr << "Error: failed to launch emulator" << endl;
cleanup();
cleanup(conf_parser);
return false;
}
char buffer[128];
@@ -840,7 +845,7 @@ namespace Sysreg_
{
cerr << "Error: pid file w/o pid!!! " << endl;
fclose(file);
cleanup();
cleanup(conf_parser);
return false;
}
m_Pid = atoi(buffer);
@@ -856,10 +861,10 @@ namespace Sysreg_
OsSupport::setAlarm(m_MaxTime, GetCurrentProcessId());
#endif
bool ret = analyzeDebugData();
cleanup();
bool ret = analyzeDebugData();
cleanup(conf_parser);
return ret;
return ret;
}
//---------------------------------------------------------------------------------------
void RosBootTest::dumpCheckpoints()
+4 -3
View File
@@ -57,6 +57,7 @@ namespace Sysreg_
static string ROS_EMU_MEM;
static string ROS_BOOT_CMD;
static string XEN_CONFIG_FILE;
static string XEN_CONFIG_NAME;
//---------------------------------------------------------------------------------------
///
@@ -109,10 +110,10 @@ namespace Sysreg_
bool readConfigurationValues(ConfigParser & conf_parser);
bool configureQemu();
bool configureVmWare();
bool configureXen();
bool configureXen(ConfigParser &conf_parser);
bool hasQemuNoRebootOption();
void cleanup();
bool xenGetCaps();
void cleanup(ConfigParser &conf_parser);
bool xenGetCaps();
//---------------------------------------------------------------------------------------
///
/// dumpCheckpoints
+11 -1
View File
@@ -2,7 +2,7 @@
;
; This variable defines which emulator should be used to emulate ReactOS
;
;ROS_EMU_TYPE=[qemu|vmware]
;ROS_EMU_TYPE=[qemu|vmware|xen]
ROS_EMU_TYPE=qemu
@@ -98,3 +98,13 @@ ROS_DELAY_READ=4
; ROS_BOOT_CMD=/usr/bin/qemu -serial stdio -m 64 -hda ~/reactos/qemu/ReactOS.hd -boot d -cdrom ~/reactos/qemu/bootcd.iso
; -no-reboot
; XEN_CONFIG_FILE
;
; Set this variable to path of xen config file when ROS_EMU_TYPE=xen is used
; XEN_CONFIG_FILE=
; XEN_CONFIG_NAME
;
; Set this variable to the name of xen station
; XEN_CONFIG_NAME=