- in theory arguments start at argv[1] - so this needs to be passed to qemu-img

svn path=/trunk/; revision=28661
This commit is contained in:
Johannes Anderwald 2007-08-29 22:27:30 +00:00
parent 0dd03527da
commit 4adb5cb9a7
2 changed files with 11 additions and 10 deletions

View file

@ -42,7 +42,7 @@ namespace System_
if (procargsnum) if (procargsnum)
{ {
for (int i = 0; i < procargsnum; i++) for (int i = 1; i < procargsnum; i++)
{ {
length += _tcslen(procargs[i]); length += _tcslen(procargs[i]);
} }
@ -50,7 +50,7 @@ namespace System_
length += procargsnum; length += procargsnum;
szBuffer = (TCHAR*)malloc(length * sizeof(TCHAR)); szBuffer = (TCHAR*)malloc(length * sizeof(TCHAR));
length = 0; length = 0;
for (int i = 0; i < procargsnum; i++) for (int i = 1; i < procargsnum; i++)
{ {
_tcscpy(&szBuffer[length], procargs[i]); _tcscpy(&szBuffer[length], procargs[i]);
length += _tcslen(procargs[i]); length += _tcslen(procargs[i]);

View file

@ -148,22 +148,23 @@ namespace Sysreg_
qemuimgdir += _T("\\qemu-img.exe"); qemuimgdir += _T("\\qemu-img.exe");
#endif #endif
TCHAR * options[] = { if (!isFileExisting(qemuimgdir))
{
cerr << "Error: ROS_EMU_PATH must contain the path to qemu and qemu-img" << endl;
return false;
}
TCHAR * options[] = { NULL,
_T("create"), _T("create"),
NULL, NULL,
_T("100M"), _T("100M"),
NULL NULL
}; };
if (!isFileExisting(qemuimgdir))
{
cerr << "Error: ROS_EMU_PATH must contain the path to qemu and qemu-img" << endl;
return false;
}
getDefaultHDDImage(output); getDefaultHDDImage(output);
options[1] = (TCHAR*)output.c_str(); options[0] = (TCHAR*)qemuimgdir.c_str();
options[2] = (TCHAR*)output.c_str();
cerr << "Creating HDD Image ..." << output << endl; cerr << "Creating HDD Image ..." << output << endl;
if (OsSupport::createProcess ((TCHAR*)qemuimgdir.c_str(), 3, options, true)) if (OsSupport::createProcess ((TCHAR*)qemuimgdir.c_str(), 3, options, true))