Author: cwittich
Date: Mon Sep 1 08:42:40 2008
New Revision: 35857
URL:
http://svn.reactos.org/svn/reactos?rev=35857&view=rev
Log:
allow to specify a config file as cmdline argument
Modified:
trunk/tools/sysreg2/virt.c
Modified: trunk/tools/sysreg2/virt.c
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/sysreg2/virt.c?rev=35857&…
==============================================================================
--- trunk/tools/sysreg2/virt.c [iso-8859-1] (original)
+++ trunk/tools/sysreg2/virt.c [iso-8859-1] Mon Sep 1 08:42:40 2008
@@ -135,7 +135,7 @@
}
-int main()
+int main(int argc, char **argv)
{
virConnectPtr vConn;
virDomainPtr vDom;
@@ -143,13 +143,18 @@
int Stages = 1; /* 1 for testing, should be set to 3 later */
char qemu_img_cmdline[300];
FILE* file;
-
- if (!LoadSettings("sysreg.xml"))
+ char config[255];
+
+ if (argc == 2)
+ strcpy(config, argv[1]);
+ else
+ strcpy(config, "sysreg.xml");
+
+ if (!LoadSettings(config))
{
printf("Can not load configuration file\n");
return EXIT_FAILURE;
}
-
vConn = virConnectOpen("qemu:///session");
if (IsVirtualMachineRunning(vConn, AppSettings.Name))