提交 ef983dfe 编写于 作者: D Daniel P. Berrange

Fix sysinfo/virsh build problems on Win32

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
上级 07963952
......@@ -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 */
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册