[libvirt] [[PATCH v2]] virsh nodecpustats returns incorrect stats of cpu on Linux when the number of online cpu exceed 9.
by mars@linux.vnet.ibm.com
From: Bing Bu Cao <mars(a)linux.vnet.ibm.com>
To retrieve node cpu statistics on Linux system, the
linuxNodeGetCPUstats function simply uses STRPREFIX() to match the
cpuid with the cpuid read from /proc/stat, it will cause
obvious error.
For example:
'virsh nodecpustats 1' will display stats of cpu1* if the latter is online and cpu1 is offline.
This patch fixes this bug.
Signed-off-by: Bing Bu Cao <mars(a)linux.vnet.ibm.com>
---
src/nodeinfo.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/nodeinfo.c b/src/nodeinfo.c
index 05bc038..cba2fc1 100644
--- a/src/nodeinfo.c
+++ b/src/nodeinfo.c
@@ -708,9 +708,9 @@ linuxNodeGetCPUStats(FILE *procstat,
}
if (cpuNum == VIR_NODE_CPU_STATS_ALL_CPUS) {
- strcpy(cpu_header, "cpu");
+ strcpy(cpu_header, "cpu ");
} else {
- snprintf(cpu_header, sizeof(cpu_header), "cpu%d", cpuNum);
+ snprintf(cpu_header, sizeof(cpu_header), "cpu%d ", cpuNum);
}
while (fgets(line, sizeof(line), procstat) != NULL) {
--
1.7.7.6
10 years, 10 months
[libvirt] [PATCH] Honour prefix in wireshark install dir
by Daniel P. Berrange
Trying to run
$ ./configure --prefix=$HOME/usr/libvirt-git
$ make install
results in libvirt trying to install in /usr/lib/wireshark/plugins/....
with predictable amounts of fail. The configure script should not be
hardcoding /usr/lib by default but rather honour $libdir
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index b9375f1..3a70375 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2566,7 +2566,7 @@ AC_ARG_WITH([ws-plugindir],
if test "$with_wireshark_dissector" != "no" && test -z "$ws_plugindir"; then
ws_version=`$WIRESHARK -v | head -1 | cut -f 2 -d' '`
- ws_plugindir=`dirname $WIRESHARK`/../lib/wireshark/plugins/$ws_version
+ ws_plugindir="$libdir/wireshark/plugins/$ws_version"
fi
AC_SUBST([ws_plugindir])
--
1.8.4.2
10 years, 10 months
[libvirt] RFC: Move tests into same directory as the sources
by Daniel P. Berrange
Currently we have a split with all the "source" code under various
subdirectories of src/, while the test cases are (mostly) all under
the tests/ directory. I think there could be some benefits to moving
the test files to be alongside the source files being tested.
eg instead of tests/virhashtest.c have src/util/virhashtest.c
The tests/ directory is getting reasonably large, and is likely to
grow even more as we push for greater unit tests. We could split it
up into various sub-directories mirroring the split of dirs under
src/, but it seems easier to put have them directory under src/ and
remove the arbitrary split of source and tests.
Having the test files alongside the source files makes it obvious
to anyone looking in a directory that tests exist for a file. This
might encourage people to think about adding tests when changing
a source file. It also makes it more slightly obvious which files
lack proper tests.
In essence I'm suggesting that our code file naming should be thus
virfoo.h - exports of module foo for general internal usage
virfoo.c - implementation of module foo
virfoopriv.h - exports of module foo for test suite usage only
virfootest.c - implementation of tests for module foo
virfoomock.c - implementation of LD_PRELOAD hack for module foo tests
Regards,
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
10 years, 10 months
[libvirt] [PATCH 0/2] v6: spice: expose the disable file transfer option
by Francesco Romani
Changes v6:
amended commit message for patch #2 as suggested by Doug.
Francesco Romani (2):
spice: detect if qemu can disable file transfer
spice: expose the QEMU disable file transfer option
docs/formatdomain.html.in | 8 +++++
docs/schemas/domaincommon.rng | 11 ++++++
src/conf/domain_conf.c | 31 ++++++++++++++++-
src/conf/domain_conf.h | 10 ++++++
src/libvirt_private.syms | 2 ++
src/qemu/qemu_capabilities.c | 2 ++
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 9 +++++
tests/qemucapabilitiesdata/caps_1.6.0-1.caps | 1 +
tests/qemucapabilitiesdata/caps_1.6.50-1.caps | 1 +
...emuxml2argv-graphics-spice-agent-file-xfer.args | 9 +++++
...qemuxml2argv-graphics-spice-agent-file-xfer.xml | 40 ++++++++++++++++++++++
.../qemuxml2argv-graphics-spice.args | 5 +--
.../qemuxml2argv-graphics-spice.xml | 1 +
tests/qemuxml2argvtest.c | 9 ++++-
15 files changed, 136 insertions(+), 4 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-agent-file-xfer.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-agent-file-xfer.xml
--
1.8.4.2
10 years, 10 months
[libvirt] [PATCH] patch to correct bug to refresh volume on sheepdog from a sheep pool Reload correctly pool and get vols.
by joel.simoes@laposte.net
From: Joël Simoes <jsimoes@jsimoes>
---
src/storage/storage_backend_sheepdog.c | 91 ++++++++++++++++++++++++++++++----
1 file changed, 81 insertions(+), 10 deletions(-)
diff --git a/src/storage/storage_backend_sheepdog.c b/src/storage/storage_backend_sheepdog.c
index a6981ce..fbed11a 100644
--- a/src/storage/storage_backend_sheepdog.c
+++ b/src/storage/storage_backend_sheepdog.c
@@ -86,7 +86,8 @@ virStorageBackendSheepdogParseNodeInfo(virStoragePoolDefPtr pool,
pool->available = pool->capacity - pool->allocation;
return 0;
- } while ((p = next));
+ }
+ while ((p = next));
return -1;
}
@@ -109,6 +110,71 @@ virStorageBackendSheepdogAddHostArg(virCommandPtr cmd,
virCommandAddArgFormat(cmd, "%d", port);
}
+static int
+virStorageBackendSheepdogRefreshAllVol(virConnectPtr conn ATTRIBUTE_UNUSED,
+ virStoragePoolObjPtr pool)
+{
+ int ret;
+ char *output = NULL;
+
+ virCommandPtr cmd = virCommandNewArgList(COLLIE, "vdi", "list", "-r", NULL);
+ virStorageBackendSheepdogAddHostArg(cmd, pool);
+ virCommandSetOutputBuffer(cmd, &output);
+ ret = virCommandRun(cmd, NULL);
+ char** lines;
+ char** cells;
+
+ if (ret < 0)
+ goto cleanup;
+
+ lines = virStringSplit(output, "\n", 0);
+ size_t i;
+ for (i = 0; *(lines + i); i++) {
+ char *line = *(lines + i);
+ cells = virStringSplit(line, " ", 0);
+ size_t j;
+ for (j = 0; *(cells + j); j++) {
+
+ char *cell = *(cells + j);
+ if (j == 1) {
+ virStorageVolDefPtr vol = NULL;
+ if (VIR_ALLOC(vol) < 0)
+ goto cleanup;
+
+ if (VIR_STRDUP(vol->name, cell) < 0)
+ goto cleanup;
+
+ vol->type = VIR_STORAGE_VOL_BLOCK;
+
+ if (VIR_EXPAND_N(pool->volumes.objs, pool->volumes.count, 1) < 0)
+ goto cleanup;
+ pool->volumes.objs[pool->volumes.count - 1] = vol;
+
+ if (virStorageBackendSheepdogRefreshVol(conn, pool, vol) < 0)
+ goto cleanup;
+
+ vol = NULL;
+ }
+
+ VIR_FREE(*(cells + j));
+ }
+
+ VIR_FREE(cells);
+ VIR_FREE(*(lines + i));
+ }
+
+
+ VIR_FREE(lines);
+
+
+
+
+cleanup:
+ virCommandFree(cmd);
+ VIR_FREE(lines);
+ VIR_FREE(cells);
+ return ret;
+}
static int
virStorageBackendSheepdogRefreshPool(virConnectPtr conn ATTRIBUTE_UNUSED,
@@ -122,15 +188,16 @@ virStorageBackendSheepdogRefreshPool(virConnectPtr conn ATTRIBUTE_UNUSED,
virStorageBackendSheepdogAddHostArg(cmd, pool);
virCommandSetOutputBuffer(cmd, &output);
ret = virCommandRun(cmd, NULL);
- if (ret == 0)
- ret = virStorageBackendSheepdogParseNodeInfo(pool->def, output);
+ if (ret < 0)
+ goto cleanup;
+ ret = virStorageBackendSheepdogParseNodeInfo(pool->def, output);
+ virStorageBackendSheepdogRefreshAllVol(conn, pool);
+cleanup:
virCommandFree(cmd);
- VIR_FREE(output);
return ret;
}
-
static int
virStorageBackendSheepdogDeleteVol(virConnectPtr conn ATTRIBUTE_UNUSED,
virStoragePoolObjPtr pool,
@@ -143,12 +210,14 @@ virStorageBackendSheepdogDeleteVol(virConnectPtr conn ATTRIBUTE_UNUSED,
virCommandPtr cmd = virCommandNewArgList(COLLIE, "vdi", "delete", vol->name, NULL);
virStorageBackendSheepdogAddHostArg(cmd, pool);
int ret = virCommandRun(cmd, NULL);
+ if (ret < 0)
+ goto cleanup;
+cleanup:
virCommandFree(cmd);
return ret;
}
-
static int
virStorageBackendSheepdogCreateVol(virConnectPtr conn ATTRIBUTE_UNUSED,
virStoragePoolObjPtr pool,
@@ -174,7 +243,6 @@ virStorageBackendSheepdogCreateVol(virConnectPtr conn ATTRIBUTE_UNUSED,
return 0;
}
-
static int
virStorageBackendSheepdogBuildVol(virConnectPtr conn,
virStoragePoolObjPtr pool,
@@ -195,12 +263,12 @@ virStorageBackendSheepdogBuildVol(virConnectPtr conn,
goto cleanup;
ret = 0;
+
cleanup:
virCommandFree(cmd);
return ret;
}
-
int
virStorageBackendSheepdogParseVdiList(virStorageVolDefPtr vol,
char *output)
@@ -257,7 +325,8 @@ virStorageBackendSheepdogParseVdiList(virStorageVolDefPtr vol,
return -1;
return 0;
- } while ((p = next));
+ }
+ while ((p = next));
return -1;
}
@@ -295,7 +364,6 @@ cleanup:
return ret;
}
-
static int
virStorageBackendSheepdogResizeVol(virConnectPtr conn ATTRIBUTE_UNUSED,
virStoragePoolObjPtr pool,
@@ -310,7 +378,10 @@ virStorageBackendSheepdogResizeVol(virConnectPtr conn ATTRIBUTE_UNUSED,
virCommandAddArgFormat(cmd, "%llu", capacity);
virStorageBackendSheepdogAddHostArg(cmd, pool);
int ret = virCommandRun(cmd, NULL);
+ if (ret < 0)
+ goto cleanup;
+cleanup:
virCommandFree(cmd);
return ret;
--
1.8.3.2
10 years, 10 months
[libvirt] [PATCH glib] Switch over to using standard gobject introspection macros
by Daniel P. Berrange
Remove hand crafted configure.ac and Makefile.am rules in
favour of the standard macros.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
configure.ac | 25 +---------------
libvirt-gconfig/Makefile.am | 71 ++++++++++++++++++++-------------------------
libvirt-glib/Makefile.am | 51 ++++++++++++++------------------
libvirt-gobject/Makefile.am | 71 ++++++++++++++++++---------------------------
4 files changed, 83 insertions(+), 135 deletions(-)
diff --git a/configure.ac b/configure.ac
index 9b5d09c..8b0b63b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -232,30 +232,7 @@ AC_SUBST([PYTHON_VERSION])
AC_SUBST([PYTHON_INCLUDES])
AC_SUBST([PYTHON_SITE_PACKAGES])
-AC_ARG_ENABLE([introspection],
- AS_HELP_STRING([--enable-introspection], [enable GObject introspection]),
- [], [enable_introspection=check])
-
-if test "x$enable_introspection" != "xno" ; then
- PKG_CHECK_MODULES([GOBJECT_INTROSPECTION],
- [gobject-introspection-1.0 >= $GOBJECT_INTROSPECTION_REQUIRED],
- [enable_introspection=yes],
- [
- if test "x$enable_introspection" = "xcheck"; then
- enable_introspection=no
- else
- AC_MSG_ERROR([gobject-introspection is not available])
- fi
- ])
- if test "x$enable_introspection" = "xyes" ; then
- AC_DEFINE([WITH_GOBJECT_INTROSPECTION], [1], [enable GObject introspection support])
- AC_SUBST(GOBJECT_INTROSPECTION_CFLAGS)
- AC_SUBST(GOBJECT_INTROSPECTION_LIBS)
- AC_SUBST([G_IR_SCANNER], [$($PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0)])
- AC_SUBST([G_IR_COMPILER], [$($PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0)])
- fi
-fi
-AM_CONDITIONAL([WITH_GOBJECT_INTROSPECTION], [test "x$enable_introspection" = "xyes"])
+GOBJECT_INTROSPECTION_CHECK([$GOBJECT_INTROSPECTION_REQUIRED])
AC_ARG_ENABLE([vala],
AS_HELP_STRING([--enable-vala], [enable Vala binding generation]),
diff --git a/libvirt-gconfig/Makefile.am b/libvirt-gconfig/Makefile.am
index 0793da1..03e4036 100644
--- a/libvirt-gconfig/Makefile.am
+++ b/libvirt-gconfig/Makefile.am
@@ -168,6 +168,10 @@ GCONFIG_SOURCE_FILES = \
libvirt-gconfig-storage-vol-target.c \
libvirt-gconfig-xml-doc.c
+GCONFIG_GENERATED_FILES = \
+ libvirt-gconfig-enum-types.c \
+ libvirt-gconfig-enum-types.h
+
libvirt_gconfig_1_0_ladir = $(includedir)/libvirt-gconfig-1.0/libvirt-gconfig
libvirt_gconfig_1_0_la_HEADERS = \
$(GCONFIG_HEADER_FILES)
@@ -177,7 +181,7 @@ libvirt_gconfig_1_0_la_SOURCES = \
$(libvirt_gconfig_1_0_la_HEADERS) \
$(GCONFIG_SOURCE_FILES)
nodist_libvirt_gconfig_1_0_la_SOURCES = \
- $(builddir)/libvirt-gconfig-enum-types.c
+ $(GCONFIG_GENERATED_FILES)
libvirt_gconfig_1_0_la_CFLAGS = \
-DG_LOG_DOMAIN="\"Libvirt.GConfig\"" \
-DDATADIR="\"$(datadir)\"" \
@@ -199,9 +203,7 @@ libvirt_gconfig_1_0_la_LDFLAGS = \
-Wl,--version-script=$(srcdir)/libvirt-gconfig.sym \
-version-info $(LIBVIRT_GLIB_VERSION_INFO)
-BUILT_SOURCES = \
- libvirt-gconfig-enum-types.c \
- libvirt-gconfig-enum-types.h
+BUILT_SOURCES = $(GCONFIG_GENERATED_FILES)
CLEANFILES = $(BUILT_SOURCES)
@@ -213,44 +215,33 @@ libvirt-gconfig-enum-types.c: $(GCONFIG_HEADER_FILES) libvirt-gconfig-enum-types
$(AM_V_GEN) ( $(GLIB_MKENUMS) --template $(srcdir)/libvirt-gconfig-enum-types.c.template $(GCONFIG_HEADER_FILES:%=$(srcdir)/%) ) | \
sed -e "s/G_TYPE_VIR_CONFIG/GVIR_CONFIG_TYPE/" -e "s/g_vir/gvir/" > libvirt-gconfig-enum-types.c
-if WITH_GOBJECT_INTROSPECTION
-
-LibvirtGConfig-1.0.gir: libvirt-gconfig-1.0.la $(G_IR_SCANNER) Makefile.am
- $(AM_V_GEN)$(G_IR_SCANNER) \
- --quiet \
- --warn-all \
- --namespace LibvirtGConfig \
- --nsversion 1.0 \
- --include GObject-2.0 \
- --identifier-prefix=GVirConfig \
- --symbol-prefix=gvir_config \
- --library=$(builddir)/libvirt-gconfig-1.0.la \
- --output $@ \
- -I$(top_builddir) \
- -I$(top_srcdir) \
- --verbose \
- --c-include="libvirt-gconfig/libvirt-gconfig.h" \
- --pkg=libxml-2.0 \
- --pkg-export=libvirt-gconfig-1.0 \
- $(srcdir)/libvirt-gconfig.h \
- $(GCONFIG_SOURCE_FILES:%=$(srcdir)/%) \
- $(GCONFIG_HEADER_FILES:%=$(srcdir)/%) \
- $(builddir)/libvirt-gconfig-enum-types.c \
- $(builddir)/libvirt-gconfig-enum-types.h
-
+-include $(INTROSPECTION_MAKEFILE)
+INTROSPECTION_GIRS =
+
+if HAVE_INTROSPECTION
+LibvirtGConfig-1.0.gir: libvirt-gconfig-1.0.la
+LibvirtGConfig_1_0_gir_INCLUDES = GObject-2.0
+LibvirtGConfig_1_0_gir_PACKAGES = gobject-2.0
+LibvirtGConfig_1_0_gir_EXPORT_PACKAGES = libvirt-gconfig-1.0
+LibvirtGConfig_1_0_gir_LIBS = libvirt-gconfig-1.0.la
+LibvirtGConfig_1_0_gir_FILES = \
+ $(GCONFIG_SOURCE_FILES) \
+ $(GCONFIG_HEADER_FILES) \
+ $(GCONFIG_GENERATED_FILES) \
+ $(NULL)
+LibvirtGConfig_1_0_gir_CFLAGS = $(libvirt_gconfig_1_0_la_CFLAGS)
+LibvirtGConfig_1_0_gir_SCANNERFLAGS = \
+ --identifier-prefix=GVirConfig \
+ --symbol-prefix=gvir_config \
+ --c-include="libvirt-gconfig/libvirt-gconfig.h" \
+ $(NULL)
+INTROSPECTION_GIRS += LibvirtGConfig-1.0.gir
girdir = $(datadir)/gir-1.0
gir_DATA = LibvirtGConfig-1.0.gir
-typelibsdir = $(libdir)/girepository-1.0
-typelibs_DATA = LibvirtGConfig-1.0.typelib
-
-%.typelib: %.gir
- $(AM_V_GEN)$(G_IR_COMPILER) \
- --includedir=$(builddir) \
- --includedir=$(girdir) \
- -o $@ $<
-
-CLEANFILES += $(gir_DATA) $(typelibs_DATA)
+typelibdir = $(libdir)/girepository-1.0
+typelib_DATA = LibvirtGConfig-1.0.typelib
-endif # WITH_GOBJECT_INTROSPECTION
+CLEANFILES += $(gir_DATA) $(typelib_DATA)
+endif # HAVE_INTROSPECTION
diff --git a/libvirt-glib/Makefile.am b/libvirt-glib/Makefile.am
index 1370ebc..36404f1 100644
--- a/libvirt-glib/Makefile.am
+++ b/libvirt-glib/Makefile.am
@@ -37,38 +37,31 @@ libvirt_glib_1_0_la_LDFLAGS = \
-Wl,--version-script=$(srcdir)/libvirt-glib.sym \
-version-info $(LIBVIRT_GLIB_VERSION_INFO)
-if WITH_GOBJECT_INTROSPECTION
-LibvirtGLib-1.0.gir: libvirt-glib-1.0.la $(G_IR_SCANNER) Makefile.am
- $(AM_V_GEN)$(G_IR_SCANNER) \
- --quiet \
- --warn-all \
- --namespace LibvirtGLib \
- --nsversion 1.0 \
- --include GLib-2.0 \
- --identifier-prefix=GVir \
- --symbol-prefix=gvir \
- --library=$(builddir)/libvirt-glib-1.0.la \
- --output $@ \
- -I$(top_srcdir) \
- --verbose \
- --pkg=gthread-2.0 \
- --c-include="libvirt-glib/libvirt-glib.h" \
- --pkg-export=libvirt-glib-1.0 \
- $(libvirt_glib_1_0_la_SOURCES:%=$(srcdir)/%)
+-include $(INTROSPECTION_MAKEFILE)
+INTROSPECTION_GIRS =
+CLEANFILES=
+
+if HAVE_INTROSPECTION
+LibvirtGLib-1.0.gir: libvirt-glib-1.0.la
+LibvirtGLib_1_0_gir_INCLUDES = GLib-2.0
+LibvirtGLib_1_0_gir_PACKAGES = glib-2.0
+LibvirtGLib_1_0_gir_EXPORT_PACKAGES = libvirt-glib-1.0
+LibvirtGLib_1_0_gir_LIBS = libvirt-glib-1.0.la
+LibvirtGLib_1_0_gir_FILES = $(libvirt_glib_1_0_la_SOURCES)
+LibvirtGLib_1_0_gir_CFLAGS = $(libvirt_glib_1_0_la_CFLAGS)
+LibvirtGLib_1_0_gir_SCANNERFLAGS = \
+ --identifier-prefix=GVir \
+ --symbol-prefix=gvir \
+ --c-include="libvirt-glib/libvirt-glib.h" \
+ $(NULL)
+INTROSPECTION_GIRS += LibvirtGLib-1.0.gir
girdir = $(datadir)/gir-1.0
gir_DATA = LibvirtGLib-1.0.gir
-typelibsdir = $(libdir)/girepository-1.0
-typelibs_DATA = LibvirtGLib-1.0.typelib
-
-%.typelib: %.gir
- $(AM_V_GEN)$(G_IR_COMPILER) \
- --includedir=$(builddir) \
- --includedir=$(girdir) \
- -o $@ $<
-
-CLEANFILES = $(gir_DATA) $(typelibs_DATA)
+typelibdir = $(libdir)/girepository-1.0
+typelib_DATA = LibvirtGLib-1.0.typelib
-endif # WITH_GOBJECT_INTROSPECTION
+CLEANFILES += $(gir_DATA) $(typelib_DATA)
+endif # HAVE_INTROSPECTION
diff --git a/libvirt-gobject/Makefile.am b/libvirt-gobject/Makefile.am
index 3284b2c..9c05cb5 100644
--- a/libvirt-gobject/Makefile.am
+++ b/libvirt-gobject/Makefile.am
@@ -119,50 +119,37 @@ BUILT_SOURCES = $(GOBJECT_GENERATED_FILES)
CLEANFILES = $(BUILT_SOURCES)
-if WITH_GOBJECT_INTROSPECTION
-
-LibvirtGObject-1.0.gir: libvirt-gobject-1.0.la $(G_IR_SCANNER) Makefile.am
- $(AM_V_GEN)$(G_IR_SCANNER) \
- --quiet \
- --warn-all \
- --namespace LibvirtGObject \
- --nsversion 1.0 \
- --include GObject-2.0 \
- --include Gio-2.0 \
- --include-uninstalled $(top_builddir)/libvirt-glib/LibvirtGLib-1.0.gir \
- --include-uninstalled $(top_builddir)/libvirt-gconfig/LibvirtGConfig-1.0.gir \
- --identifier-prefix=GVir \
- --symbol-prefix=gvir \
- --library=$(top_builddir)/libvirt-glib/libvirt-glib-1.0.la \
- --library=$(top_builddir)/libvirt-gconfig/libvirt-gconfig-1.0.la \
- --library=$(builddir)/libvirt-gobject-1.0.la \
- --output $@ \
- -I$(top_builddir) \
- -I$(top_srcdir) \
- --verbose \
- --c-include="libvirt-gobject/libvirt-gobject.h" \
- --pkg=gthread-2.0 \
- --pkg=libxml-2.0 \
- --pkg-export=libvirt-gobject-1.0 \
- $(srcdir)/libvirt-gobject.h \
- $(GOBJECT_SOURCE_FILES:%=$(srcdir)/%) \
- $(GOBJECT_HEADER_FILES:%=$(srcdir)/%) \
- $(GOBJECT_GENERATED_FILES:%=$(builddir)/%)
+-include $(INTROSPECTION_MAKEFILE)
+INTROSPECTION_GIRS =
+
+if HAVE_INTROSPECTION
+LibvirtGObject-1.0.gir: libvirt-gobject-1.0.la
+LibvirtGObject_1_0_gir_INCLUDES = GObject-2.0 Gio-2.0
+LibvirtGObject_1_0_gir_PACKAGES = gobject-2.0
+LibvirtGObject_1_0_gir_EXPORT_PACKAGES = libvirt-gobject-1.0
+LibvirtGObject_1_0_gir_LIBS = \
+ $(top_builddir)/libvirt-glib/libvirt-glib-1.0.la \
+ $(top_builddir)/libvirt-gconfig/libvirt-gconfig-1.0.la \
+ libvirt-gobject-1.0.la
+LibvirtGObject_1_0_gir_FILES = \
+ $(GOBJECT_SOURCE_FILES) \
+ $(GOBJECT_HEADER_FILES) \
+ $(GOBJECT_GENERATED_FILES) \
+ $(NULL)
+LibvirtGObject_1_0_gir_CFLAGS = $(libvirt_gobject_1_0_la_CFLAGS)
+LibvirtGObject_1_0_gir_SCANNERFLAGS = \
+ --identifier-prefix=GVir --symbol-prefix=gvir \
+ --c-include="libvirt-gobject/libvirt-gobject.h" \
+ --include-uninstalled $(top_builddir)/libvirt-glib/LibvirtGLib-1.0.gir \
+ --include-uninstalled $(top_builddir)/libvirt-gconfig/LibvirtGConfig-1.0.gir \
+ $(NULL)
+INTROSPECTION_GIRS += LibvirtGObject-1.0.gir
girdir = $(datadir)/gir-1.0
gir_DATA = LibvirtGObject-1.0.gir
-typelibsdir = $(libdir)/girepository-1.0
-typelibs_DATA = LibvirtGObject-1.0.typelib
-
-%.typelib: %.gir
- $(AM_V_GEN)$(G_IR_COMPILER) \
- --includedir=$(top_builddir)/libvirt-glib \
- --includedir=$(top_builddir)/libvirt-gconfig \
- --includedir=$(builddir) \
- --includedir=$(girdir) \
- -o $@ $<
-
-CLEANFILES += $(gir_DATA) $(typelibs_DATA)
+typelibdir = $(libdir)/girepository-1.0
+typelib_DATA = LibvirtGObject-1.0.typelib
-endif # WITH_GOBJECT_INTROSPECTION
+CLEANFILES += $(gir_DATA) $(typelib_DATA)
+endif # HAVE_INTROSPECTION
--
1.8.4.2
10 years, 10 months
[libvirt] [PATCH RESEND v4 0/2] Libvirt Wireshark Dissector
by Yuto KAWAMURA(kawamuray)
From: "Yuto KAWAMURA(kawamuray)" <kawamuray.dadada(a)gmail.com>
Changes from version 3:
* Merge tools/wireshark/.gitignore into ROOT/.gitignore
* Fix dissect_xdr_pointer() bug which pointed by Michal
* Added -module option to libvirt_la_LDFLAGS respecting official build process
Introduce Wireshark dissector plugin which adds support to Wireshark
for dissecting libvirt RPC protocol.
This feature was presented by Michal Privoznik year before last[1].
But it did only support dissecting packet headers.
This time I enhanced that dissector to support dissecting packet
payload. Furthermore, I provide code generator of dissector. So you
can get fresh build of dissector from libvirt RPC specification file
at any version you like.
[1] http://www.redhat.com/archives/libvir-list/2011-October/msg00301.html
Yuto KAWAMURA(kawamuray) (2):
Introduce Libvirt Wireshark dissector
Add sample output of Wireshark dissector
.gitignore | 2 +
Makefile.am | 3 +-
cfg.mk | 8 +-
configure.ac | 72 +-
tools/wireshark/Makefile.am | 22 +
tools/wireshark/README.md | 31 +
tools/wireshark/samples/libvirt-sample.pdml | 206 ++++++
tools/wireshark/src/Makefile.am | 42 ++
tools/wireshark/src/packet-libvirt.c | 512 ++++++++++++++
tools/wireshark/src/packet-libvirt.h | 128 ++++
tools/wireshark/util/genxdrstub.pl | 1011 +++++++++++++++++++++++++++
tools/wireshark/util/make-dissector-reg | 198 ++++++
12 files changed, 2229 insertions(+), 6 deletions(-)
create mode 100644 tools/wireshark/Makefile.am
create mode 100644 tools/wireshark/README.md
create mode 100644 tools/wireshark/samples/libvirt-sample.pdml
create mode 100644 tools/wireshark/src/Makefile.am
create mode 100644 tools/wireshark/src/packet-libvirt.c
create mode 100644 tools/wireshark/src/packet-libvirt.h
create mode 100755 tools/wireshark/util/genxdrstub.pl
create mode 100755 tools/wireshark/util/make-dissector-reg
--
1.8.3.2
10 years, 10 months