Author: cwittich
Date: Mon Sep 1 07:22:10 2008
New Revision: 35853
URL:
http://svn.reactos.org/svn/reactos?rev=35853&view=rev
Log:
fix formatting
Modified:
trunk/tools/sysreg2/options.c
trunk/tools/sysreg2/virt.c
Modified: trunk/tools/sysreg2/options.c
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/sysreg2/options.c?rev=35853&…
==============================================================================
--- trunk/tools/sysreg2/options.c [iso-8859-1] (original)
+++ trunk/tools/sysreg2/options.c [iso-8859-1] Mon Sep 1 07:22:10 2008
@@ -48,9 +48,9 @@
obj = xmlXPathEval(BAD_CAST"number(/settings/general/hdd/@size)",ctxt);
if ((obj != NULL) && (obj->type == XPATH_NUMBER))
{
- if (obj->floatval <= 0)
- AppSettings.ImageSize = 512;
- else
+ if (obj->floatval <= 0)
+ AppSettings.ImageSize = 512;
+ else
AppSettings.ImageSize = (int)obj->floatval;
}
@@ -75,7 +75,7 @@
ctxt = xmlXPathNewContext(xml);
if (!ctxt)
{
- xmlFreeDoc(xml);
+ xmlFreeDoc(xml);
return false;
}
@@ -86,7 +86,7 @@
strncpy(AppSettings.HardDiskImage, obj->stringval, 254);
}
- xmlFreeDoc(xml);
+ xmlFreeDoc(xml);
xmlXPathFreeContext(ctxt);
return true;
}
Modified: trunk/tools/sysreg2/virt.c
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/sysreg2/virt.c?rev=35853&…
==============================================================================
--- trunk/tools/sysreg2/virt.c [iso-8859-1] (original)
+++ trunk/tools/sysreg2/virt.c [iso-8859-1] Mon Sep 1 07:22:10 2008
@@ -42,18 +42,18 @@
bool IsVirtualMachineRunning(virConnectPtr vConn, const char* name)
{
int* ids = NULL;
- int numids;
+ int numids;
int maxids = 0;
- const char* domname;
- virDomainPtr vDomPtr = NULL;
+ const char* domname;
+ virDomainPtr vDomPtr = NULL;
maxids = virConnectNumOfDomains(vConn);
- if (maxids < 0)
- return false;
+ if (maxids < 0)
+ return false;
ids = malloc(sizeof(int) * maxids);
- if (!ids)
- return false;
+ if (!ids)
+ return false;
numids = virConnectListDomains(vConn, &ids[0], maxids);
if (numids > -1)
@@ -61,14 +61,14 @@
int i;
for(i=0; i<numids; i++)
{
- vDomPtr = virDomainLookupByID(vConn, ids[i]);
- domname = virDomainGetName(vDomPtr);
+ vDomPtr = virDomainLookupByID(vConn, ids[i]);
+ domname = virDomainGetName(vDomPtr);
if (strcasecmp(name, domname) == 0)
- {
- virDomainFree(vDomPtr);
+ {
+ virDomainFree(vDomPtr);
return true;
- }
- virDomainFree(vDomPtr);
+ }
+ virDomainFree(vDomPtr);
}
}
return false;
@@ -128,7 +128,7 @@
domname = strdup(name);
virDomainFree(vDomPtr);
vDomPtr = virDomainLookupByName(vConn, domname);
- free(domname);
+ free(domname);
}
}
return vDomPtr;
@@ -141,8 +141,8 @@
virDomainPtr vDom;
int Stage;
int Stages = 1; /* 1 for testing, should be set to 3 later */
- char qemu_img_cmdline[300];
- FILE* file;
+ char qemu_img_cmdline[300];
+ FILE* file;
if (!LoadSettings("sysreg.xml"))
{
@@ -153,26 +153,26 @@
vConn = virConnectOpen("qemu:///session");
if (IsVirtualMachineRunning(vConn, AppSettings.Name))
- {
- printf("Error: Virtual Machine is already running.\n");
- return EXIT_FAILURE;
- }
+ {
+ printf("Error: Virtual Machine is already running.\n");
+ return EXIT_FAILURE;
+ }
- if (file = fopen(AppSettings.HardDiskImage, "r"))
- {
+ if (file = fopen(AppSettings.HardDiskImage, "r"))
+ {
fclose(file);
- remove(AppSettings.HardDiskImage);
- }
+ remove(AppSettings.HardDiskImage);
+ }
- sprintf(qemu_img_cmdline, "qemu-img create -f qcow2 %s %dM",
- AppSettings.HardDiskImage, AppSettings.ImageSize);
- FILE* p = popen(qemu_img_cmdline, "r");
+ sprintf(qemu_img_cmdline, "qemu-img create -f qcow2 %s %dM",
+ AppSettings.HardDiskImage, AppSettings.ImageSize);
+ FILE* p = popen(qemu_img_cmdline, "r");
char buf[100];
while(feof(p)==0)
- {
- memset(buf,0,strlen(buf));
- fgets(buf,100,p);
- printf("%s\n",buf);
+ {
+ memset(buf,0,strlen(buf));
+ fgets(buf,100,p);
+ printf("%s\n",buf);
}
pclose(p);