Author: janderwald
Date: Mon Sep 3 02:27:03 2007
New Revision: 28789
URL:
http://svn.reactos.org/svn/reactos?rev=28789&view=rev
Log:
- improve error checking
- add hasQemuNoRebootOption stub
Modified:
trunk/reactos/tools/sysreg/rosboot_test.cpp
trunk/reactos/tools/sysreg/rosboot_test.h
Modified: trunk/reactos/tools/sysreg/rosboot_test.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/sysreg/rosboot_test.…
==============================================================================
--- trunk/reactos/tools/sysreg/rosboot_test.cpp (original)
+++ trunk/reactos/tools/sysreg/rosboot_test.cpp Mon Sep 3 02:27:03 2007
@@ -208,6 +208,16 @@
return isFileExisting(qemupath);
}
//----------------------------------------------------------------------------------------
+ bool RosBootTest::hasQemuNoRebootOption()
+ {
+ ///
+ /// FIXME
+ /// extract version
+ ///
+
+ return true;
+ }
+//----------------------------------------------------------------------------------------
bool RosBootTest::getQemuDir(string & qemupath)
{
string::size_type pos;
@@ -275,9 +285,10 @@
m_BootCmd += _T(" -pidfile ");
m_BootCmd += m_PidFile;
#endif
-
- m_BootCmd += _T(" -no-reboot ");
-
+ if (hasQemuNoRebootOption())
+ {
+ m_BootCmd += _T(" -no-reboot ");
+ }
return true;
}
//----------------------------------------------------------------------------------------
@@ -335,6 +346,11 @@
/* check if ROS_HDD_IMAGE points to hdd image */
if (!isFileExisting(m_HDDImage))
{
+ if (!m_CDImage.length ())
+ {
+ cerr << "Error: HDD image is not existing and CDROM image
not provided" << endl;
+ return false;
+ }
/* create it */
return createHDDImage(m_HDDImage);
}
@@ -346,9 +362,20 @@
* but also no override by
* ROS_BOOT_CMD
*/
+ if (!m_CDImage.length ())
+ {
+ cerr << "Error: no HDD and CDROM image provided" <<
endl;
+ return false;
+ }
+
getDefaultHDDImage(m_HDDImage);
return createHDDImage(m_HDDImage);
}
+ /*
+ * verify the provided ROS_BOOT_CMD for hdd image
+ *
+ */
+
bool hdaboot = false;
string::size_type pos = m_BootCmd.find (_T("-boot c"));
if (pos != string::npos)
@@ -392,34 +419,28 @@
//----------------------------------------------------------------------------------------
bool RosBootTest::configureCDImage()
{
- if (m_CDImage.length())
- {
- /* we have a cd image lets check if its valid */
- if (!isFileExisting(m_CDImage))
- {
- cerr << "Error: ROS_CD_IMAGE is not valid" <<
endl;
- return false;
- }
+ if (!m_BootCmd.length ())
+ {
+ if (m_CDImage.length())
+ {
+ /* we have a cd image lets check if its valid */
+ if (isFileExisting(m_CDImage))
+ {
+ cerr << "Using CDROM image " << m_CDImage
<< endl;
+ return true;
+ }
+ }
+ if (isFileExisting(_T("ReactOS-RegTest.iso")))
+ {
+ m_CDImage = _T("ReactOS-RegTest.iso");
+ cerr << "Falling back to default CDROM image " <<
m_CDImage << endl;
+ return true;
+ }
+ cerr << "No CDROM image found, boot device is HDD" <<
endl;
+ m_CDImage = _T("");
return true;
}
- /* ROS_CD_IMAGE is not set
- * lets check if m_BootCmd provides it
- */
-
- if (!m_BootCmd.length())
- {
- /* ROS_BOOT_CMD not set
- * check if theres a default image
- */
-
- if (isFileExisting(_T("ReactOS-RegTest.iso")))
- {
- m_CDImage = _T("ReactOS-RegTest.iso");
- }
- return true;
- }
-
string::size_type pos = m_BootCmd.find(_T("-boot "));
if (pos == string::npos)
{
Modified: trunk/reactos/tools/sysreg/rosboot_test.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/sysreg/rosboot_test.…
==============================================================================
--- trunk/reactos/tools/sysreg/rosboot_test.h (original)
+++ trunk/reactos/tools/sysreg/rosboot_test.h Mon Sep 3 02:27:03 2007
@@ -102,6 +102,7 @@
bool readConfigurationValues(ConfigParser & conf_parser);
bool configureQemu();
bool configureVmWare();
+ bool hasQemuNoRebootOption();
void cleanup();
//---------------------------------------------------------------------------------------
///