[libvirt] [PATCH RFC 38/48] iohelper: Introduce iohelper_message

Michal Privoznik mprivozn at redhat.com
Wed Jun 22 14:43:55 UTC 2016


This patch does nothing more than introducing a skeleton
for formatted messages between the daemon on iohelper.

Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
---
 src/Makefile.am                 | 20 +++++++++++++++++++-
 src/iohelper/iohelper_message.c | 24 ++++++++++++++++++++++++
 src/iohelper/iohelper_message.h | 26 ++++++++++++++++++++++++++
 3 files changed, 69 insertions(+), 1 deletion(-)
 create mode 100644 src/iohelper/iohelper_message.c
 create mode 100644 src/iohelper/iohelper_message.h

diff --git a/src/Makefile.am b/src/Makefile.am
index 3409631..af5ef72 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -994,6 +994,10 @@ STORAGE_HELPER_DISK_SOURCES =					\
 IO_HELPER_SOURCES =								\
 		iohelper/iohelper.c
 
+IO_HELPER_LIB_SOURCES =							\
+		iohelper/iohelper_message.c				\
+		iohelper/iohelper_message.h
+
 NETWORK_LEASES_HELPER_SOURCES =                                 \
                network/leaseshelper.c
 
@@ -2842,6 +2846,18 @@ libvirt_net_rpc_client_la_LIBADD = \
 libexec_PROGRAMS =
 
 if WITH_LIBVIRTD
+noinst_LTLIBRARIES += libvirt-iohelper.la
+libvirt_iohelper_la_SOURCES = $(IO_HELPER_LIB_SOURCES)
+libvirt_iohelper_la_LDFLAGS =	\
+		$(AM_LDFLAGS)			\
+		$(NULL)
+libvirt_iohelper_la_CFLAGS =	\
+		-I$(srcdir)/util		\
+		-I$(srcdir)/rpc			\
+		$(AM_CFLAGS)			\
+		$(XDR_CFLAGS)			\
+		$(NULL)
+
 libexec_PROGRAMS += libvirt_iohelper
 libvirt_iohelper_SOURCES = $(IO_HELPER_SOURCES)
 libvirt_iohelper_LDFLAGS = \
@@ -2882,7 +2898,9 @@ else ! WITH_NETWORK
 EXTRA_DIST += $(NETWORK_LEASES_HELPER_SOURCES)
 endif ! WITH_NETWORK
 
-endif WITH_LIBVIRTD
+else ! WITH_LIBVIRTD
+EXTRA_DIST += $(IO_HELPER_LIB_SOURCES)
+endif ! WITH_LIBVIRTD
 
 if WITH_STORAGE_DISK
 if WITH_LIBVIRTD
diff --git a/src/iohelper/iohelper_message.c b/src/iohelper/iohelper_message.c
new file mode 100644
index 0000000..54b9355
--- /dev/null
+++ b/src/iohelper/iohelper_message.c
@@ -0,0 +1,24 @@
+/*
+ * iohelper_message.c: Formatted messages between iohelper and us
+ *
+ * Copyright (C) 2016 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/>.
+ *
+ */
+
+#include <config.h>
+
+#include "iohelper_message.h"
diff --git a/src/iohelper/iohelper_message.h b/src/iohelper/iohelper_message.h
new file mode 100644
index 0000000..791a645
--- /dev/null
+++ b/src/iohelper/iohelper_message.h
@@ -0,0 +1,26 @@
+/*
+ * iohelper_message.h: Formatted messages between iohelper and us
+ *
+ * Copyright (C) 2016 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_IOHELPER_MESSAGE_H__
+# define __VIR_IOHELPER_MESSAGE_H__
+
+#endif /* __VIR_IOHELPER_H__ */
-- 
2.8.4




More information about the libvir-list mailing list