]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
Fix sysinfo/virsh build problems on Win32
authorDaniel P. Berrange <berrange@redhat.com>
Tue, 31 May 2011 13:12:33 +0000 (14:12 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Tue, 31 May 2011 13:17:21 +0000 (14:17 +0100)
The virSysinfoIsEqual method was mistakenly inside a #ifndef WIN32
conditional.

The existing virSysinfoFormat is also stubbed out on Win32, even
though the code works without any trouble. This breaks XML output
on Win32, so the stub is removed.

virsh migrate mistakenly had some variables inside the conditional

* src/util/sysinfo.c: Build virSysinfoIsEqual on Win32 and remove
  Win32 stub for virSysinfoFormat
* tools/virsh.c: Fix variable declaration on Win32

src/util/sysinfo.c
tools/virsh.c

index ff07151f38d72e3ed9e5ead4116905b1eb05f7d7..40ec2e3aeebee6c07cf837db6761b7b13d4d50fc 100644 (file)
@@ -94,15 +94,6 @@ virSysinfoRead(void) {
     return NULL;
 }
 
-char *
-virSysinfoFormat(virSysinfoDefPtr def ATTRIBUTE_UNUSED,
-                 const char *prefix ATTRIBUTE_UNUSED)
-{
-    virReportSystemError(ENOSYS, "%s",
-                 _("Host sysinfo extraction not supported on this platform"));
-    return NULL;
-}
-
 #else /* !WIN32 */
 
 virSysinfoDefPtr
@@ -220,6 +211,7 @@ no_memory:
     ret = NULL;
     goto cleanup;
 }
+#endif /* !WIN32 */
 
 /**
  * virSysinfoFormat:
@@ -350,7 +342,7 @@ bool virSysinfoIsEqual(virSysinfoDefPtr src,
         goto cleanup;
     }
 
-# define CHECK_FIELD(name, desc)                                        \
+#define CHECK_FIELD(name, desc)                                         \
     do {                                                                \
         if (STRNEQ_NULLABLE(src->name, dst->name)) {                    \
             virSmbiosReportError(VIR_ERR_CONFIG_UNSUPPORTED,            \
@@ -372,12 +364,10 @@ bool virSysinfoIsEqual(virSysinfoDefPtr src,
     CHECK_FIELD(system_sku, "system sku");
     CHECK_FIELD(system_family, "system family");
 
-# undef CHECK_FIELD
+#undef CHECK_FIELD
 
     identical = true;
 
 cleanup:
     return identical;
 }
-
-#endif /* !WIN32 */
index 520d16ee550cc8635da3dcfbde442c155a0fb395..dfd5bd2974d97df9c1274dfa223ac96a9fdbbaf9 100644 (file)
@@ -3850,10 +3850,10 @@ doMigrate (void *opaque)
     vshCtrlData *data = opaque;
     vshControl *ctl = data->ctl;
     const vshCmd *cmd = data->cmd;
-#if HAVE_PTHREAD_SIGMASK
-    sigset_t sigmask, oldsigmask;
     const char *xmlfile = NULL;
     char *xml = NULL;
+#if HAVE_PTHREAD_SIGMASK
+    sigset_t sigmask, oldsigmask;
 
     sigemptyset(&sigmask);
     sigaddset(&sigmask, SIGINT);