]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
build: allow mingw compilation with virCommand
authorEric Blake <eblake@redhat.com>
Fri, 10 Dec 2010 23:46:23 +0000 (16:46 -0700)
committerEric Blake <eblake@redhat.com>
Mon, 13 Dec 2010 23:09:50 +0000 (16:09 -0700)
Allows compilation, but no creation of child processes yet.  Take it
one step at a time.

* src/util/util.c (virExecWithHook) [WIN32]: New dummy function.
* src/libvirt_private.syms: Export it.

src/libvirt_private.syms
src/util/util.c

index b24ca70b99328509308277d458b3ae0187c41ca5..0e3033dcb47775a585d9b62ed0a6fd705abfdb79 100644 (file)
@@ -811,6 +811,7 @@ virEventAddHandle;
 virEventRemoveHandle;
 virExec;
 virExecDaemonize;
+virExecWithHook;
 virFileAbsPath;
 virFileDeletePid;
 virFileExists;
index 1b5bc68d68f74f8a47af928ba50d845a7b54a849..41dbefd294c2f6c0279a617a2fa056fae88f09cb 100644 (file)
@@ -912,6 +912,28 @@ virExec(const char *const*argv ATTRIBUTE_UNUSED,
     return -1;
 }
 
+int
+virExecWithHook(const char *const*argv ATTRIBUTE_UNUSED,
+                const char *const*envp ATTRIBUTE_UNUSED,
+                const fd_set *keepfd ATTRIBUTE_UNUSED,
+                pid_t *retpid ATTRIBUTE_UNUSED,
+                int infd ATTRIBUTE_UNUSED,
+                int *outfd ATTRIBUTE_UNUSED,
+                int *errfd ATTRIBUTE_UNUSED,
+                int flags ATTRIBUTE_UNUSED,
+                virExecHook hook ATTRIBUTE_UNUSED,
+                void *data ATTRIBUTE_UNUSED,
+                char *pidfile ATTRIBUTE_UNUSED)
+{
+    /* XXX: Some day we can implement pieces of virCommand/virExec on
+     * top of _spawn() or CreateProcess(), but we can't implement
+     * everything, since mingw completely lacks fork(), so we cannot
+     * run hook code in the child.  */
+    virUtilError(VIR_ERR_INTERNAL_ERROR,
+                 "%s", _("virExec is not implemented for WIN32"));
+    return -1;
+}
+
 int
 virExecDaemonize(const char *const*argv ATTRIBUTE_UNUSED,
                  const char *const*envp ATTRIBUTE_UNUSED,