[libvirt] [uq/master PATCH 0/7] x86 CPU subclasses, take 7
by Eduardo Habkost
Is there any hope to get this into QEMU 2.0, or it is now too late? I got
almost no feedback on take 6 (submitted November 27).
This is the main blocker to allow libvirt finally implement an equivalent to the
"enforce" flag, finally making the CPU configuration safe and sane (today
libvirt simply ignores GET_SUPPORTED_CPUID information, and features are
silently disabled because "enforce" is not used).
This blocks libvirt because the current available interfaces requires re-running
QEMU for each CPU model to be probed. Having the x86 CPU subclasses allow
libvirt to simply create and destroy CPU objects from each available CPU class,
and query for the results using QMP.
Demonstration of how this can be used, below:
Running QEMU as:
$ qemu-system-x86_64 -enable-kvm -machine none -monitor stdio -qmp unix:/tmp/qmp,server,nowait -nographic
Then running qmp-shell as:
$ ./scripts/qmp/qmp-shell /tmp/qmp
[...]
(QEMU) object-add qom-type=host-x86_64-cpu id=probing-host-cpu-type
{u'return': {}}
(QEMU) object-add qom-type=Nehalem-x86_64-cpu id=probing-cpu-type-Nehalem
{u'return': {}}
(QEMU) object-add qom-type=Westmere-x86_64-cpu id=probing-cpu-type-Westmere
{u'return': {}}
(QEMU) object-add qom-type=Haswell-x86_64-cpu id=probing-cpu-type-Haswell
(QEMU) qom-list path=/objects/
{u'return': [{u'type': u'child<Haswell-x86_64-cpu>', u'name': u'probing-cpu-type-Haswell'}, {u'type': u'child<Westmere-x86_64-cpu>', u'name': u'probing-cpu-type-Westmere'}, {u'type': u'child<Nehalem-x86_64-cpu>', u'name': u'probing-cpu-type-Nehalem'}, {u'type': u'child<host-x86_64-cpu>', u'name': u'probing-host-cpu-type'}, {u'type': u'string', u'name': u'type'}]}
(QEMU) qom-list path=/objects/probing-cpu-type-Haswell/
{u'return': [{u'type': u'X86CPUFeatureWordInfo', u'name': u'filtered-features'}, {u'type': u'X86CPUFeatureWordInfo', u'name': u'feature-words'}, {u'type': u'int', u'name': u'apic-id'}, {u'type': u'int', u'name': u'tsc-frequency'}, {u'type': u'string', u'name': u'model-id'}, {u'type': u'string', u'name': u'vendor'}, {u'type': u'int', u'name': u'xlevel'}, {u'type': u'int', u'name': u'level'}, {u'type': u'int', u'name': u'stepping'}, {u'type': u'int', u'name': u'model'}, {u'type': u'int', u'name': u'family'}, {u'type': u'link<bus>', u'name': u'parent_bus'}, {u'type': u'boolean', u'name': u'enforce'}, {u'type': u'boolean', u'name': u'check'}, {u'type': u'boolean', u'name': u'hv-time'}, {u'type': u'boolean', u'name': u'hv-vapic'}, {u'type': u'boolean', u'name': u'hv-relaxed'}, {u'type': u'int', u'name': u'hv-spinlocks'}, {u'type': u'boolean', u'name': u'pmu'}, {u'type': u'bool', u'name': u'realized'}, {u'type': u'string', u'name': u'type'}]}
(QEMU) qom-get path=/objects/probing-cpu-type-Haswell property=feature-words
{u'return': [{u'cpuid-register': u'EDX', u'cpuid-input-eax': 2147483658, u'features': 0}, {u'cpuid-register': u'EAX', u'cpuid-input-eax': 1073741825, u'features': 16777339}, {u'cpuid-register': u'EDX', u'cpuid-input-eax': 3221225473, u'features': 0}, {u'cpuid-register': u'ECX', u'cpuid-input-eax': 2147483649, u'features': 1}, {u'cpuid-register': u'EDX', u'cpuid-input-eax': 2147483649, u'features': 672139264}, {u'cpuid-register': u'EBX', u'cpuid-input-eax': 7, u'features': 4025, u'cpuid-input-ecx': 0}, {u'cpuid-register': u'ECX', u'cpuid-input-eax': 1, u'features': 2549756419}, {u'cpuid-register': u'EDX', u'cpuid-input-eax': 1, u'features': 126614525}]}
(QEMU) qom-get path=/objects/probing-cpu-type-Haswell property=filtered-features
{u'return': [{u'cpuid-register': u'EDX', u'cpuid-input-eax': 2147483658, u'features': 0}, {u'cpuid-register': u'EAX', u'cpuid-input-eax': 1073741825, u'features': 0}, {u'cpuid-register': u'EDX', u'cpuid-input-eax': 3221225473, u'features': 0}, {u'cpuid-register': u'ECX', u'cpuid-input-eax': 2147483649, u'features': 0}, {u'cpuid-register': u'EDX', u'cpuid-input-eax': 2147483649, u'features': 0}, {u'cpuid-register': u'EBX', u'cpuid-input-eax': 7, u'features': 0, u'cpuid-input-ecx': 0}, {u'cpuid-register': u'ECX', u'cpuid-input-eax': 1, u'features': 0}, {u'cpuid-register': u'EDX', u'cpuid-input-eax': 1, u'features': 0}]}
(QEMU) qom-get path=/objects/probing-host-cpu-type property=feature-words
{u'return': [{u'cpuid-register': u'EDX', u'cpuid-input-eax': 2147483658, u'features': 0}, {u'cpuid-register': u'EAX', u'cpuid-input-eax': 1073741825, u'features': 16777467}, {u'cpuid-register': u'EDX', u'cpuid-input-eax': 3221225473, u'features': 0}, {u'cpuid-register': u'ECX', u'cpuid-input-eax': 2147483649, u'features': 1}, {u'cpuid-register': u'EDX', u'cpuid-input-eax': 2147483649, u'features': 697564159}, {u'cpuid-register': u'EBX', u'cpuid-input-eax': 7, u'features': 2, u'cpuid-input-ecx': 0}, {u'cpuid-register': u'ECX', u'cpuid-input-eax': 1, u'features': 2193236483}, {u'cpuid-register': u'EDX', u'cpuid-input-eax': 1, u'features': 260832255}]}
(QEMU) qom-get path=/objects/probing-host-cpu-type property=filtered-features
{u'return': [{u'cpuid-register': u'EDX', u'cpuid-input-eax': 2147483658, u'features': 0}, {u'cpuid-register': u'EAX', u'cpuid-input-eax': 1073741825, u'features': 0}, {u'cpuid-register': u'EDX', u'cpuid-input-eax': 3221225473, u'features': 0}, {u'cpuid-register': u'ECX', u'cpuid-input-eax': 2147483649, u'features': 0}, {u'cpuid-register': u'EDX', u'cpuid-input-eax': 2147483649, u'features': 0}, {u'cpuid-register': u'EBX', u'cpuid-input-eax': 7, u'features': 0, u'cpuid-input-ecx': 0}, {u'cpuid-register': u'ECX', u'cpuid-input-eax': 1, u'features': 0}, {u'cpuid-register': u'EDX', u'cpuid-input-eax': 1, u'features': 0}]}
Changes from take 6:
* Rebase against uq/master
* Patch 1/7:
* Check for __i386__ on host_cpuid() so the code compiles properly
on non-x86 hosts.
Suggested-by: Paolo Bonzini <pbonzini(a)redhat.com>
* Don't add assert(kvm_enabled()) line, which is not necessary to help
the compiler (and wouldn't help it if using -DNDEBUG, anyway).
Reported-by: Richard Henderson <rth(a)twiddle.net>
* Commit message update
Eduardo Habkost (7):
target-i386: Eliminate CONFIG_KVM #ifdefs
target-i386: Don't change x86_def_t struct on cpu_x86_register()
target-i386: Move KVM default-vendor hack to instance_init
target-i386: Rename cpu_x86_register() to x86_cpu_load_def()
target-i386: Call x86_cpu_load_def() earlier
target-i386: Rename x86_def_t to X86CPUDefinition
target-i386: CPU model subclasses
target-i386/cpu-qom.h | 13 ++
target-i386/cpu.c | 402 ++++++++++++++++++++++++++++++--------------------
target-i386/cpu.h | 2 -
3 files changed, 256 insertions(+), 161 deletions(-)
--
1.8.4.2
10 years, 9 months
[libvirt] [PATCH] daemon: Enhance documentation for changinging NOFILE limit
by Jiri Denemark
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
daemon/libvirtd.sysconf | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/daemon/libvirtd.sysconf b/daemon/libvirtd.sysconf
index 3af1f03..06f6a2c 100644
--- a/daemon/libvirtd.sysconf
+++ b/daemon/libvirtd.sysconf
@@ -20,5 +20,7 @@
#
#SDL_AUDIODRIVER=pulse
-# Override the maximum number of opened files
+# Override the maximum number of opened files.
+# This only works with traditional init scripts. In systemd world, limits
+# can only be changed by setting LimitNOFILE in libvirtd.service unit file.
#LIBVIRTD_NOFILES_LIMIT=2048
--
1.8.5.4
10 years, 9 months
[libvirt] [PATCHv2] build: correctly check for SOICGIFVLAN GET_VLAN_VID_CMD command
by Laine Stump
In order to make a client-only build successful on RHEL4, commit
3ed2e54 modified src/util/virnetdev.c so that the functional version
of virNetDevGetVLanID() was only compiled if GET_VLAN_VID_CMD was
defined. However, it is *never* defined, but is only an enum value, so
the proper version was no longer compiled even on platforms that
support it. This resulted in the vlan tag not being properly set for
guest traffic on VEPA mode guest macvtap interfaces that were bound to
a vlan interface (that's the only place that libvirt currently uses
virNetDevGetVLanID)
Since there is no way to compile conditionally based on the presence
of an enum value, this patch modifies configure.ac to check for said
enum value with AC_CHECK_DECLS(), which #defines HAVE_GET_VLAN_VID_CMD
if it's successful compiling a test program that uses
GET_VLAN_VID_CMD. We can then make the compilation of
virNetDevGetVLanID() conditional on that #define instead.
---
Difference from V1:
Use the amazingly compact AC_CHECK_DECLS() instead
of deprecated AC_TRY_COMPILE() + extra trappings.
configure.ac | 2 ++
src/util/virnetdev.c | 4 ++--
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index 7ecbee9..0d505d3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2470,6 +2470,8 @@ if test "$with_virtualport" != "no"; then
fi
AM_CONDITIONAL([WITH_VIRTUALPORT], [test "$with_virtualport" = "yes"])
+dnl GET_VLAN_VID_CMD is required for virNetDevGetVLanID
+AC_CHECK_DECLS([GET_VLAN_VID_CMD], [], [], [[#include <linux/if_vlan.h>]])
dnl netlink library
diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
index e74fc5f..72f52c7 100644
--- a/src/util/virnetdev.c
+++ b/src/util/virnetdev.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2007-2013 Red Hat, Inc.
+ * Copyright (C) 2007-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
@@ -732,7 +732,7 @@ int virNetDevGetIndex(const char *ifname ATTRIBUTE_UNUSED,
#endif /* ! SIOCGIFINDEX */
-#if defined(SIOCGIFVLAN) && defined(HAVE_STRUCT_IFREQ) && defined(GET_VLAN_VID_CMD)
+#if defined(SIOCGIFVLAN) && defined(HAVE_STRUCT_IFREQ) && defined(HAVE_GET_VLAN_VID_CMD)
int virNetDevGetVLanID(const char *ifname, int *vlanid)
{
struct vlan_ioctl_args vlanargs = {
--
1.8.5.3
10 years, 9 months
[libvirt] [PATCH RFC 2/2] support configuring the format of dumping memory in qemu.conf
by Qiao Nuohan
This patch is used to add dump_memory_format to qemu.conf and make the
specified format as the default dump format of 'virsh dump --memory-only'.
But when "--compress" is specified with dump command, the format configured
by dump_memory_format will be overrided. dump_memory_format can one of elf,
kdump-zlib, kdump-lzo and kdump-snappy. And elf is the default value.
Signed-off-by: Qiao Nuohan <qiaonuohan(a)cn.fujitsu.com>
---
src/qemu/libvirtd_qemu.aug | 1 +
src/qemu/qemu.conf | 6 ++++++
src/qemu/qemu_conf.c | 2 ++
src/qemu/qemu_conf.h | 1 +
src/qemu/qemu_driver.c | 37 ++++++++++++++++++++++++++++++++++---
src/qemu/test_libvirtd_qemu.aug.in | 1 +
6 files changed, 45 insertions(+), 3 deletions(-)
diff --git a/src/qemu/libvirtd_qemu.aug b/src/qemu/libvirtd_qemu.aug
index a9ff421..25737e8 100644
--- a/src/qemu/libvirtd_qemu.aug
+++ b/src/qemu/libvirtd_qemu.aug
@@ -60,6 +60,7 @@ module Libvirtd_qemu =
let save_entry = str_entry "save_image_format"
| str_entry "dump_image_format"
+ | str_entry "dump_memory_format"
| str_entry "snapshot_image_format"
| str_entry "auto_dump_path"
| bool_entry "auto_dump_bypass_cache"
diff --git a/src/qemu/qemu.conf b/src/qemu/qemu.conf
index 17f1b10..8dc9d29 100644
--- a/src/qemu/qemu.conf
+++ b/src/qemu/qemu.conf
@@ -294,6 +294,11 @@
# the requested compression program can't be found, this falls
# back to "raw" compression.
#
+# dump_memory_format is used when you use 'virsh dump --memory-only' to dump
+# guest memory, and if specifing format with 'virsh dump --memory-only',
+# dump_memory_format will not work. dump_memory_format can be elf, kdump-zlib,
+# kdump-lzo and kdump-snappy.
+#
# snapshot_image_format specifies the compression algorithm of the memory save
# image when an external snapshot of a domain is taken. This does not apply
# on disk image format. It is an error if the specified format isn't valid,
@@ -301,6 +306,7 @@
#
#save_image_format = "raw"
#dump_image_format = "raw"
+#dump_memory_format = "elf"
#snapshot_image_format = "raw"
# When a domain is configured to be auto-dumped when libvirtd receives a
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 4378791..7893e31 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -296,6 +296,7 @@ static void virQEMUDriverConfigDispose(void *obj)
VIR_FREE(cfg->saveImageFormat);
VIR_FREE(cfg->dumpImageFormat);
+ VIR_FREE(cfg->dumpMemoryFormat);
VIR_FREE(cfg->autoDumpPath);
virStringFreeList(cfg->securityDriverNames);
@@ -546,6 +547,7 @@ int virQEMUDriverConfigLoadFile(virQEMUDriverConfigPtr cfg,
GET_VALUE_STR("save_image_format", cfg->saveImageFormat);
GET_VALUE_STR("dump_image_format", cfg->dumpImageFormat);
+ GET_VALUE_STR("dump_memory_format", cfg->dumpMemoryFormat);
GET_VALUE_STR("snapshot_image_format", cfg->snapshotImageFormat);
GET_VALUE_STR("auto_dump_path", cfg->autoDumpPath);
diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h
index 1f44a76..3bb1935 100644
--- a/src/qemu/qemu_conf.h
+++ b/src/qemu/qemu_conf.h
@@ -147,6 +147,7 @@ struct _virQEMUDriverConfig {
char *saveImageFormat;
char *dumpImageFormat;
+ char *dumpMemoryFormat;
char *snapshotImageFormat;
char *autoDumpPath;
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index c4e1aef..06f39c0 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -3407,6 +3407,21 @@ static int qemuDumpToFd(virQEMUDriverPtr driver,
virDomainObjPtr vm,
return ret;
}
+typedef enum {
+ QEMU_DUMP_MEMORY_FORMAT_ELF = 0,
+ QEMU_DUMP_MEMORY_FORMAT_KDUMP_ZLIB = 1,
+ QEMU_DUMP_MEMORY_FORMAT_KDUMP_LZO = 2,
+ QEMU_DUMP_MEMORY_FORMAT_KDUMP_SNAPPY = 3,
+ QEMU_DUMP_MEMORY_FORMAT_LAST
+} virQEMUDumpMemoryFormat;
+
+VIR_ENUM_DECL(qemuDumpMemoryCompression)
+VIR_ENUM_IMPL(qemuDumpMemoryCompression, QEMU_DUMP_MEMORY_FORMAT_LAST,
+ "elf",
+ "kdump-zlib",
+ "kdump-lzo",
+ "kdump-snappy")
+
static int
doCoreDump(virQEMUDriverPtr driver,
virDomainObjPtr vm,
@@ -3419,7 +3434,9 @@ doCoreDump(virQEMUDriverPtr driver,
virFileWrapperFdPtr wrapperFd = NULL;
int directFlag = 0;
unsigned int flags = VIR_FILE_WRAPPER_NON_BLOCKING;
- const char *dump_format;
+ const char *dump_format = "elf";
+ virQEMUDriverConfigPtr cfg = NULL;
+ int dump_memory_format;
/* Create an empty file with appropriate ownership. */
if (dump_flags & VIR_DUMP_BYPASS_CACHE) {
@@ -3449,8 +3466,22 @@ doCoreDump(virQEMUDriverPtr driver,
dump_format = "kdump-lzo";
else if (dump_flags & VIR_DUMP_COMPRESS_SNAPPY)
dump_format = "kdump-snappy";
- else
- dump_format = "elf";
+ else {
+ /* when --compress option is specified, qemu.conf will not work */
+ cfg = virQEMUDriverGetConfig(driver);
+ if (cfg->dumpMemoryFormat) {
+ dump_memory_format = qemuDumpMemoryCompressionTypeFromString(
+ cfg->dumpMemoryFormat);
+ if (dump_memory_format == QEMU_DUMP_MEMORY_FORMAT_KDUMP_ZLIB)
+ dump_format = "kdump-zlib";
+ else if (dump_memory_format ==
+ QEMU_DUMP_MEMORY_FORMAT_KDUMP_LZO)
+ dump_format = "kdump-lzo";
+ else if (dump_memory_format ==
+ QEMU_DUMP_MEMORY_FORMAT_KDUMP_SNAPPY)
+ dump_format = "kdump-snappy";
+ }
+ }
ret = qemuDumpToFd(driver, vm, fd, QEMU_ASYNC_JOB_DUMP,
dump_format);
} else {
diff --git a/src/qemu/test_libvirtd_qemu.aug.in b/src/qemu/test_libvirtd_qemu.aug.in
index 81fedd6..9d0bcec 100644
--- a/src/qemu/test_libvirtd_qemu.aug.in
+++ b/src/qemu/test_libvirtd_qemu.aug.in
@@ -51,6 +51,7 @@ module Test_libvirtd_qemu =
}
{ "save_image_format" = "raw" }
{ "dump_image_format" = "raw" }
+{ "dump_memory_format" = "elf" }
{ "snapshot_image_format" = "raw" }
{ "auto_dump_path" = "/var/lib/libvirt/qemu/dump" }
{ "auto_dump_bypass_cache" = "0" }
--
1.8.3.1
10 years, 9 months
[libvirt] [PATCH] Skip the 'copyright-check' on -maint branches
by Daniel P. Berrange
The maint branches will often have out of date copyright headers
so we must skip the 'sc_copyright_check' rule there.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
cfg.mk | 11 +++++++++++
1 file changed, 11 insertions(+)
Perhaps there's a better way to detect -maint branches than the
logic I tried.
diff --git a/cfg.mk b/cfg.mk
index 207dfeb..47c7798 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -88,6 +88,17 @@ else
distdir: sc_vulnerable_makefile_CVE-2012-3386.z
endif
+GIT_BRANCH := $(shell if test -d $(srcdir)/.git; then \
+ cd $(srcdir) && \
+ (git status -s -b | grep '\#\#' | \
+ sed -e 's/.*-maint/-maint/'); fi)
+
+# We fully expect -maint branches to have out of date
+# copyright dates, so we must skip that check
+ifeq ($(GIT_BRANCH),-maint)
+ local-checks-to-skip += sc_copyright_check
+endif
+
# Files that should never cause syntax check failures.
VC_LIST_ALWAYS_EXCLUDE_REGEX = \
(^(HACKING|docs/(news\.html\.in|.*\.patch))|\.po)$$
--
1.8.5.3
10 years, 9 months
[libvirt] [PATCH] docs: grammar fixes in formatdomain
by Chen Hanxiao
From: Chen Hanxiao <chenhanxiao(a)cn.fujitsu.com>
Some grammar fixes.
s/namespace,set/namespace, set
s/container being allowed/container are allowed
s/the <code>uid/The <code>uid
Signed-off-by: Chen Hanxiao <chenhanxiao(a)cn.fujitsu.com>
---
docs/formatdomain.html.in | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index fd02864..34993bb 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -286,18 +286,18 @@
<p>
- If you want to enable user namespace,set the <code>idmap</code> element.
- the <code>uid</code> and <code>gid</code> elements have three attributes:
+ If you want to enable user namespace, set the <code>idmap</code> element.
+ The <code>uid</code> and <code>gid</code> elements have three attributes:
</p>
<dl>
<dt><code>start</code></dt>
- <dd>First user id in container.</dd>
+ <dd>First user ID in container.</dd>
<dt><code>target</code></dt>
- <dd>The first user id in container will be mapped to this target user
- id in host.</dd>
+ <dd>The first user ID in container will be mapped to this target user
+ ID in host.</dd>
<dt><code>count</code></dt>
- <dd>How many users in container being allowed to map to host's user.</dd>
+ <dd>How many users in container are allowed to map to host's user.</dd>
</dl>
<pre>
--
1.8.2.1
10 years, 9 months
[libvirt] [PATCH] maint: fix line numbers in check-aclrules reports
by Roman Bogorodskiy
Reset line numbering on each input file in check-aclrules.pl. Otherwise
it reports wrong line numbers in its error messages.
Signed-off-by: Yuri Myasoedov <ymyasoedov(a)yandex.ru>
---
src/check-aclrules.pl | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/check-aclrules.pl b/src/check-aclrules.pl
index f54b934..9151e6a 100755
--- a/src/check-aclrules.pl
+++ b/src/check-aclrules.pl
@@ -254,6 +254,8 @@ while (<>) {
$brace += $count;
$count = s/}//g;
$brace -= $count;
+} continue {
+ close ARGV if eof;
}
exit $status;
--
1.8.4.3
10 years, 9 months
[libvirt] [PATCH] build: correctly check for SOICGIFVLAN GET_VLAN_VID_CMD command
by Laine Stump
In order to make a client-only build successful on RHEL4, commit
3ed2e54 modified src/util/virnetdev.c so that the functional version
of virNetDevGetVLanID() was only compiled if GET_VLAN_VID_CMD was
defined. However, it is *never* defined, but is only an enum value, so
the proper version was no longer compiled even on platforms that
support it. This resulted in the vlan tag not being properly set for
guest traffic on VEPA mode guest macvtap interfaces that were bound to
a vlan interface (that's the only place that libvirt currently uses
virNetDevGetVLanID)
Since there is no way to compile conditionally based on the presence
of an enum value, this patch modifies configure.ac to check for said
enum value with AC_TRY_COMPILE(), and #defines HAVE_GET_VLAN_VID_CMD
if it's successful compiling a test program that uses
GET_VLAN_VID_CMD. We can then make the compilation of
virNetDevGetVLanID() conditional on that #define instead.
---
configure.ac | 10 ++++++++++
src/util/virnetdev.c | 4 ++--
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index 7ecbee9..fcd0170 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2470,6 +2470,16 @@ if test "$with_virtualport" != "no"; then
fi
AM_CONDITIONAL([WITH_VIRTUALPORT], [test "$with_virtualport" = "yes"])
+AC_MSG_CHECKING([for GET_VLAN_VID_CMD in /usr/linux/if_vlan.h])
+AC_TRY_COMPILE([ #include <linux/if_vlan.h> ],
+ [ int x = GET_VLAN_VID_CMD; ],
+ [ have_get_vlan_vid_cmd=yes ],
+ [ have_get_vlan_vid_cmd=no ])
+if test "$have_get_vlan_vid_cmd" = "yes"; then
+ AC_DEFINE_UNQUOTED([HAVE_GET_VLAN_VID_CMD], 1,
+ [whether the kernel SIOCGIFVLAN ioctl supports GET_VLAN_VID_CMD])
+fi
+AC_MSG_RESULT([$have_get_vlan_vid_cmd])
dnl netlink library
diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
index e74fc5f..72f52c7 100644
--- a/src/util/virnetdev.c
+++ b/src/util/virnetdev.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2007-2013 Red Hat, Inc.
+ * Copyright (C) 2007-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
@@ -732,7 +732,7 @@ int virNetDevGetIndex(const char *ifname ATTRIBUTE_UNUSED,
#endif /* ! SIOCGIFINDEX */
-#if defined(SIOCGIFVLAN) && defined(HAVE_STRUCT_IFREQ) && defined(GET_VLAN_VID_CMD)
+#if defined(SIOCGIFVLAN) && defined(HAVE_STRUCT_IFREQ) && defined(HAVE_GET_VLAN_VID_CMD)
int virNetDevGetVLanID(const char *ifname, int *vlanid)
{
struct vlan_ioctl_args vlanargs = {
--
1.8.5.3
10 years, 9 months
[libvirt] [PATCH] virNetworkLoadState: Disallow mangled 'floor' element
by Michal Privoznik
In the network status XML we may have the <floor/> element with the
'sum' attribute. The attribute represents sum of all 'floor'-s of
computed over each interface connected to the network (this is needed to
guarantee certain bandwidth for certain domain). The sum is therefore a
number. However, if the number was mangled (e.g. by an user's
interference to network status file), we've just ignored it without
refusing to parse such file. This was all due to 'goto error' missing.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/conf/network_conf.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c
index e59938c..dd3fa19 100644
--- a/src/conf/network_conf.c
+++ b/src/conf/network_conf.c
@@ -2959,6 +2959,7 @@ virNetworkLoadState(virNetworkObjListPtr nets,
_("Malformed 'floor_sum' attribute: %s"),
floor_sum);
VIR_FREE(floor_sum);
+ goto error;
}
VIR_FREE(floor_sum);
}
--
1.8.5.3
10 years, 9 months
[libvirt] [PATCH v2 0/3] Network hooks
by Michal Privoznik
Yet another version, this time with more hooks (after the network is started,
on interface plug and unplug) and tainting.
Michal Privoznik (3):
networkStartNetwork: Be more verbose
network: Introduce start and shutdown hooks
network: Taint networks that are using hook script
docs/hooks.html.in | 60 ++++++++++++---
src/conf/network_conf.c | 16 ++++
src/conf/network_conf.h | 17 +++++
src/libvirt_private.syms | 3 +
src/lxc/lxc_driver.c | 4 +-
src/lxc/lxc_process.c | 6 +-
src/network/bridge_driver.c | 179 +++++++++++++++++++++++++++++++++++++++-----
src/network/bridge_driver.h | 14 ++--
src/qemu/qemu_command.c | 2 +-
src/qemu/qemu_hotplug.c | 14 ++--
src/qemu/qemu_process.c | 2 +-
src/util/virhook.c | 13 +++-
src/util/virhook.h | 11 +++
13 files changed, 292 insertions(+), 49 deletions(-)
--
1.8.5.2
10 years, 9 months