]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Introduce vircommandpriv.h for functions used by tests
authorJán Tomko <jtomko@redhat.com>
Tue, 11 Mar 2014 10:59:58 +0000 (11:59 +0100)
committerJán Tomko <jtomko@redhat.com>
Wed, 12 Mar 2014 14:53:16 +0000 (15:53 +0100)
So far it's just virCommandSetDryRun.

src/Makefile.am
src/util/vircommand.c
src/util/vircommand.h
src/util/vircommandpriv.h [new file with mode: 0644]
tests/virkmodtest.c
tests/virnetdevbandwidthtest.c

index a88b258b7291ad7531ec91ddb48d937c80193b93..25b33a7f03400f16574148a752d8b5e13262f7de 100644 (file)
@@ -91,7 +91,7 @@ UTIL_SOURCES =                                                        \
                util/virbuffer.c util/virbuffer.h               \
                util/vircgroup.c util/vircgroup.h util/vircgrouppriv.h  \
                util/virclosecallbacks.c util/virclosecallbacks.h               \
-               util/vircommand.c util/vircommand.h             \
+               util/vircommand.c util/vircommand.h util/vircommandpriv.h \
                util/virconf.c util/virconf.h                   \
                util/vircrypto.c util/vircrypto.h               \
                util/virdbus.c util/virdbus.h util/virdbuspriv.h        \
index db4166f521744cae9af36c93cf1919d8bec15763..fd7b7138076f5b4c45e5f9dbbae0afcbd8ce7003 100644 (file)
@@ -40,7 +40,8 @@
 # include <sys/apparmor.h>
 #endif
 
-#include "vircommand.h"
+#define __VIR_COMMAND_PRIV_H_ALLOW__
+#include "vircommandpriv.h"
 #include "viralloc.h"
 #include "virerror.h"
 #include "virutil.h"
index 7485edcaeb32e693b13a5c88b76f2d624fd81bb1..10b4fa22a4ce4583ec70869f696ce0f1e59c06f6 100644 (file)
@@ -186,6 +186,4 @@ void virCommandAbort(virCommandPtr cmd);
 void virCommandFree(virCommandPtr cmd);
 
 void virCommandDoAsyncIO(virCommandPtr cmd);
-
-void virCommandSetDryRun(virBufferPtr buf);
 #endif /* __VIR_COMMAND_H__ */
diff --git a/src/util/vircommandpriv.h b/src/util/vircommandpriv.h
new file mode 100644 (file)
index 0000000..80247b2
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * vircommandpriv.h: Functions for testing virCommand APIs
+ *
+ * Copyright (C) 2014 Red Hat, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef __VIR_COMMAND_PRIV_H_ALLOW__
+# error "vircommandpriv.h may only be included by vircommand.c or test suites"
+#endif
+
+#ifndef __VIR_COMMAND_PRIV_H__
+# define __VIR_COMMAND_PRIV_H__
+
+# include "vircommand.h"
+
+void virCommandSetDryRun(virBufferPtr buf);
+#endif /* __VIR_COMMAND_PRIV_H__ */
index c6f5a728a0bd62a48cac4f9e8602194904b21884..eaf1b75c783d9bc7a9b782e870ab714fcb2dbf94 100644 (file)
@@ -23,7 +23,8 @@
 #ifdef __linux__
 
 # include <stdlib.h>
-# include "vircommand.h"
+# define __VIR_COMMAND_PRIV_H_ALLOW__
+# include "vircommandpriv.h"
 # include "virkmod.h"
 # include "virstring.h"
 
index 073fdf88b69b4b286bb643b9689c5f8bcba72703..38dfbc1ef60f957dbc079702524c2f289c8f4e12 100644 (file)
@@ -21,7 +21,8 @@
 #include <config.h>
 
 #include "testutils.h"
-#include "vircommand.h"
+#define __VIR_COMMAND_PRIV_H_ALLOW__
+#include "vircommandpriv.h"
 #include "virnetdevbandwidth.h"
 #include "netdev_bandwidth_conf.c"