[libvirt] [PATCH] Add automatic generation of a todo item page
by Daniel P. Berrange
This adds a script to generate the todo item page from
bugzilla. This requires a valid username+password for
bugzilla, so it is intended that this only be run on
the libvirt.org website via cron. Normal usage will just
generate an empty stub page.
* docs/todo.pl: Script to extract todo items from bugzilla
* docs/todo.cfg-example: Example config file
* docs/sitemap.html.in: Add todo page
* docs/Makefile.am: Generation rules for todo items
---
docs/.gitignore | 1 +
docs/Makefile.am | 20 +++++++-
docs/sitemap.html.in | 6 +++
docs/todo.cfg-example | 26 +++++++++++
docs/todo.pl | 120 +++++++++++++++++++++++++++++++++++++++++++++++++
5 files changed, 171 insertions(+), 2 deletions(-)
create mode 100644 docs/todo.cfg-example
create mode 100644 docs/todo.pl
diff --git a/docs/.gitignore b/docs/.gitignore
index 80bf00f..dd78dd0 100644
--- a/docs/.gitignore
+++ b/docs/.gitignore
@@ -5,3 +5,4 @@ apibuild.pyc
*.html
libvirt-api.xml
libvirt-refs.xml
+todo.html.in
diff --git a/docs/Makefile.am b/docs/Makefile.am
index 114ea1f..9a80ec0 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -1,6 +1,8 @@
## Process this file with automake to produce Makefile.in
SUBDIRS= schemas
+PERL = perl
+
# The directory containing the source code (if it contains documentation).
DOC_SOURCE_DIR=../src
@@ -53,7 +55,7 @@ gif = \
architecture.gif \
node.gif
-dot_html_in = $(notdir $(wildcard $(srcdir)/*.html.in))
+dot_html_in = $(notdir $(wildcard $(srcdir)/*.html.in)) todo.html.in
dot_html = $(dot_html_in:%.html.in=%.html)
patches = $(wildcard api_extension/*.patch)
@@ -97,6 +99,20 @@ ChangeLog.html.in: ChangeLog.xml ChangeLog.xsl
$(XSLTPROC) --nonet $(top_srcdir)/docs/ChangeLog.xsl $< > $@ \
|| { rm $@ && exit 1; }; fi
+todo.html.in: todo.pl
+ if [ -f todo.cfg ]; then \
+ echo "Generating $@"; \
+ $(PERL) $(srcdir)/$< > $@ \
+ || { rm $@ && exit 1; }; \
+ else \
+ echo "Stubbing $@"; \
+ echo "<html><body><h1>Todo list</h1></body></html>" >> $@ ; \
+ fi
+
+todo:
+ rm -f todo.html.in
+ $(MAKE) todo.html
+
%.png: %.fig
convert -rotate 90 $< $@
@@ -153,7 +169,7 @@ clean-local:
rm -f *~ *.bak *.hierarchy *.signals *-unused.txt *.html
maintainer-clean-local: clean-local
- rm -rf libvirt-api.xml libvirt-refs.xml
+ rm -rf libvirt-api.xml libvirt-refs.xml todo.html.in
rebuild: api all
diff --git a/docs/sitemap.html.in b/docs/sitemap.html.in
index bb9cd8e..481507e 100644
--- a/docs/sitemap.html.in
+++ b/docs/sitemap.html.in
@@ -275,6 +275,12 @@
<li>
<a href="bugs.html">Bug reports</a>
<span>How and where to report bugs and request features</span>
+ <ul>
+ <li>
+ <a href="todo.html">Todo list</a>
+ <span>Main feature request list</span>
+ </li>
+ </ul>
</li>
<li>
<a href="contact.html">Contact</a>
diff --git a/docs/todo.cfg-example b/docs/todo.cfg-example
new file mode 100644
index 0000000..a99c61a
--- /dev/null
+++ b/docs/todo.cfg-example
@@ -0,0 +1,26 @@
+bugzilla = {
+ #username = ...some email addr...
+ #password = ...some bz password...
+ server = https://bugzilla.redhat.com
+}
+query = {
+ product = Virtualization Tools
+ alias = libvirtTodo
+}
+
+output = {
+ title = Todo list
+ blurb = <<EOF
+This is a summary of all the ideas submitted for future todo items in
+libvirt. Listing an idea here does not imply that it is committed to
+for inclusion in libvirt, just that someone thought it might be a
+useful feature. Discussion for final approval of features always takes
+place on the <a href="contact.html">development mailing list</a>.
+If you intend to work on one of the items here, it is recommended to
+add a comment to the corresponding bugzilla ticket to this effect.
+This will reduce the risk of duplicated effort between developers.
+It is also strongly recommended to mail the development mailing list
+with proposals for new APIs & XML before fully implementing them, to
+allow for early design review.
+EOF
+}
diff --git a/docs/todo.pl b/docs/todo.pl
new file mode 100644
index 0000000..e541932
--- /dev/null
+++ b/docs/todo.pl
@@ -0,0 +1,120 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use BZ::Client;
+use BZ::Client::Bug;
+
+use Config::Record;
+
+my $cfg = Config::Record->new(file => "todo.cfg");
+my $server = $cfg->get("bugzilla/server", "https://bugzilla.redhat.com");
+my $username = $cfg->get("bugzilla/username");
+my $password = $cfg->get("bugzilla/password");
+
+my $product = $cfg->get("query/product", "Virtualization Tools");
+my $todoalias = $cfg->get("query/todoalias", "libvirtTodo");
+
+my $title = $cfg->get("output/title", undef);
+my $blurb = $cfg->get("output/blurb", undef);
+
+$SIG{__DIE__} = sub {
+ my $err = shift;
+ if (UNIVERSAL::isa($err, "BZ::Client::Exception")) {
+ die "Unable to access bugzilla: " . $err->message;
+ }
+ die $err;
+};
+
+my $client = BZ::Client->new(url => $server,
+ user => $username,
+ password => $password);
+
+my $todo = BZ::Client::Bug->search($client, {'product' => $product,
+ 'alias' => $todoalias});
+
+die "Cannot find bug alias 'libvirtTodo'" unless $#{$todo} > -1;
+my $todoid = $todo->[0]->{'bug_id'};
+my $todosummary = $todo->[0]->{'short_desc'};
+$todosummary =~ s/^\s*RFE\s*:\s*//;
+$todosummary =~ s/^\s*\[\s*RFE\s*\]\s*:?\s*//;
+$todosummary =~ s/^\s*Tracker\s*:\s*//;
+
+my $trackers = BZ::Client::Bug->search($client, {'product' => $product,
+ 'blocked' => $todoid });
+
+my @trackers;
+
+foreach my $tracker (@{$trackers}) {
+ my $summary = $tracker->{'short_desc'};
+ $summary =~ s/^\s*RFE\s*:\s*//;
+ $summary =~ s/^\s*\[\s*RFE\s*\]\s*:?\s*//;
+ $summary =~ s/^\s*Tracker\s*:\s*//;
+
+ push @trackers, {
+ id => $tracker->{'bug_id'},
+ summary => $summary,
+ features => [],
+ };
+}
+
+foreach my $tracker (@trackers) {
+ my $features = BZ::Client::Bug->search($client, {'product' => $product,
+ 'blocked' => $tracker->{id}});
+
+ foreach my $feature (@{$features}) {
+ my $summary = $feature->{'short_desc'};
+ $summary =~ s/^\s*RFE\s*:\s*//;
+ $summary =~ s/^\s*\[\s*RFE\s*\]\s*:?\s*//;
+
+ push @{$tracker->{features}}, {
+ id => $feature->{'bug_id'},
+ summary => $summary,
+ };
+ }
+}
+
+sub escape {
+ my $txt = shift;
+ $txt =~ s/&/&/g;
+ $txt =~ s/</</g;
+ $txt =~ s/>/>/g;
+ return $txt;
+};
+
+print "<?xml version=\"1.0\"?>\n";
+print "<html>\n";
+print " <body>\n";
+if (defined $title) {
+ print " <h1>", &escape($title), "</h1>\n";
+} else {
+ print " <h1>", &escape($todosummary), "</h1>\n";
+}
+if (defined $blurb) {
+ print " <p>\n";
+ print $blurb;
+ print " </p>\n";
+}
+foreach my $tracker (sort { $a->{summary} cmp $b->{summary} } @trackers) {
+ next unless $#{$tracker->{features}} > 0;
+
+ my $summary = &escape($tracker->{summary});
+ my $id = $tracker->{id};
+ print " <h2><a href=\"$server/$id\">$summary</a></h2>\n";
+ print " <ul>\n";
+ foreach my $feature (sort { $a->{summary} cmp $b->{summary} } @{$tracker->{features}}) {
+ $summary = &escape($feature->{summary});
+ $summary =~ s,^([^:]+):,<strong>$1</strong>,;
+
+ $id = $feature->{id};
+ print " <li>$summary (<strong>rhbz <a href=\"$server/$id\">$id</a></strong>)</li>\n";
+ }
+ print " </ul>\n";
+}
+
+print " <p>\n";
+print " This page is automatatically generated from <a href=\"$server/$todoid\">", &escape($todosummary), "</a>\n";
+print " </p>\n";
+print " </body>\n";
+print "</html>\n";
--
1.7.2.3
14 years, 1 month
[libvirt] [PATCH] maint: grammar cleanups
by Eric Blake
* docs/logging.html.in: Fix spelling and grammar.
---
This quickly grew into something large enough that I no longer
feel comfortable applying it under the obvious rule, even though
it only touches documentation.
docs/logging.html.in | 34 +++++++++++++++++-----------------
1 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/docs/logging.html.in b/docs/logging.html.in
index f4a5878..dc1f107 100644
--- a/docs/logging.html.in
+++ b/docs/logging.html.in
@@ -4,33 +4,33 @@
<h1 >Logging in the library and the daemon</h1>
<p>Libvirt includes logging facilities starting from version 0.6.0,
this complements the <a href="errors.html">error handling</a>
- mechanism and APIs to allow tracing though the execution of the
+ mechanism and APIs to allow tracing through the execution of the
library as well as in the libvirtd daemon.</p>
<p>The logging functionalities in libvirt are based on 3 key concepts,
similar to the one present in other generic logging facilities like
log4j:</p>
<ul>
<li>log messages: they are information generated at runtime by
- the libvirt code, it includes a priority level (DEBUG = 1,
+ the libvirt code. Each message includes a priority level (DEBUG = 1,
INFO = 2, WARNING = 3, ERROR = 4), a category, function name and
line number, indicating where it originated from, and finally
- a formatted message, in addition the library adds a timestamp
+ a formatted message. In addition the library adds a timestamp
at the begining of the message</li>
- <li>log filters: it's a set of patter and priorities allowing to acept
- or reject a log message, if the message category matches a filter,
+ <li>log filters: a set of patterns and priorities to accept
+ or reject a log message. If the message category matches a filter,
the message priority is compared to the filter priority, if lower
the message is discarded, if higher the message is output. If
no filter matches, then a general priority level is applied to
- all remaining messages. This allows to capture for example all
- debug messages for the QEmu driver, but otherwise only allow
- errors to show up from other parts</li>
- <li>log outputs: once a message has gone though filtering a set of
+ all remaining messages. This allows, for example, capturing all
+ debug messages for the QEmu driver, but otherwise only allowing
+ errors to show up from other parts.</li>
+ <li>log outputs: once a message has gone through filtering a set of
output defines where to send the message, they can also filter
based on the priority, for example it may be useful to output
all messages to a debugging file but only allow errors to be
- logged though syslog.</li>
+ logged through syslog.</li>
</ul>
- <p>The library configuration of logging is though 3 environment variables
+ <p>The library configuration of logging is through 3 environment variables
allowing to control the logging behaviour:</p>
<ul>
<li>LIBVIRT_DEBUG: it can take the four following values:
@@ -41,14 +41,14 @@
<li>3 or "warn": log warnings and errors, that's the default value</li>
<li>4 or "error": log only error messages</li>
</ul></li>
- <li>LIBVIRT_LOG_FILTERS: allow to define logging filters</li>
- <li>LIBVIRT_LOG_OUTPUTS: allow to define logging outputs</li>
+ <li>LIBVIRT_LOG_FILTERS: defines logging filters</li>
+ <li>LIBVIRT_LOG_OUTPUTS: defines logging outputs</li>
</ul>
<p>Note that, for example, setting LIBVIRT_DEBUG= is the same as unset. If
you specify an invalid value, it will be ignored with a warning. If you
have an error in a filter or output string, some of the settings may be
applied up to the point at which libvirt encountered the error.</p>
- <p>Similary the daemon logging behaviour can be tuned using 3 config
+ <p>Similarly the daemon logging behaviour can be tuned using 3 config
variables, stored in the configuration file:
<ul>
<li>log_level: accepts the following values:
@@ -58,8 +58,8 @@
<li>2: informations, warnings and errors</li>
<li>1: debug and everything</li>
</ul></li>
- <li>log_filters: allow to define logging filters</li>
- <li>log_outputs: allow to define logging outputs</li>
+ <li>log_filters: defines logging filters</li>
+ <li>log_outputs: defines logging outputs</li>
</ul>
<p>When starting the libvirt daemon, any logging environment variable
settings will override settings in the config file. Command line options
@@ -106,7 +106,7 @@
<li>3: WARNING</li>
<li>4: ERROR</li>
</ul>
- <p>Multiple output can be defined , they just need to be separated by
+ <p>Multiple output can be defined, they just need to be separated by
spaces, e.g.: <code>"3:syslog:libvirtd 1:file:/tmp/libvirt.log"</code>
will log all warnings and errors to syslog under the libvirtd ident
but also log everything debugging and informations included in the
--
1.7.2.3
14 years, 1 month
[libvirt] [PATCH] Enable support for nested SVM
by Daniel P. Berrange
This enables support for nested SVM using the regular CPU
model/features block. If the CPU model or features include
'svm' or 'vmx', then the '-enable-nesting' flag will be
added to the QEMU command line. Several of the models
already include svm support, but QEMU was just masking out
the svm bit silently. So this will enable SVM on such
models
* src/qemu/qemu_conf.h: flag for -enable-nesting
* src/qemu/qemu_conf.c: Use -enable-nesting if VMX or SVM are in
the CPUID
* src/cpu/cpu.h, src/cpu/cpu.c: API to check for a named feature
* src/cpu/cpu_x86.c: x86 impl of feature check
* src/libvirt_private.syms: Add cpuHasFeature
---
src/cpu/cpu.c | 24 ++++++++++++++++++++++
src/cpu/cpu.h | 12 +++++++++++
src/cpu/cpu_x86.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++
src/libvirt_private.syms | 1 +
src/qemu/qemu_conf.c | 19 +++++++++++++++-
src/qemu/qemu_conf.h | 1 +
6 files changed, 105 insertions(+), 2 deletions(-)
diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c
index def6974..c7a282e 100644
--- a/src/cpu/cpu.c
+++ b/src/cpu/cpu.c
@@ -424,3 +424,27 @@ cpuUpdate(virCPUDefPtr guest,
return driver->update(guest, host);
}
+
+bool
+cpuHasFeature(const char *arch,
+ const union cpuData *data,
+ const char *feature)
+{
+ struct cpuArchDriver *driver;
+
+ VIR_DEBUG("arch=%s, data=%p, feature=%s",
+ arch, data, feature);
+
+ if ((driver = cpuGetSubDriver(arch)) == NULL)
+ return -1;
+
+ if (driver->hasFeature == NULL) {
+ virCPUReportError(VIR_ERR_NO_SUPPORT,
+ _("cannot check guest CPU data for %s architecture"),
+ arch);
+ return -1;
+ }
+
+ return driver->hasFeature(arch, data, feature);
+}
+
diff --git a/src/cpu/cpu.h b/src/cpu/cpu.h
index a745917..405af48 100644
--- a/src/cpu/cpu.h
+++ b/src/cpu/cpu.h
@@ -82,6 +82,11 @@ typedef int
(*cpuArchUpdate) (virCPUDefPtr guest,
const virCPUDefPtr host);
+typedef bool
+(*cpuArchHasFeature) (const char *arch,
+ const union cpuData *data,
+ const char *feature);
+
struct cpuArchDriver {
const char *name;
@@ -95,6 +100,7 @@ struct cpuArchDriver {
cpuArchGuestData guestData;
cpuArchBaseline baseline;
cpuArchUpdate update;
+ cpuArchHasFeature hasFeature;
};
@@ -151,4 +157,10 @@ extern int
cpuUpdate (virCPUDefPtr guest,
const virCPUDefPtr host);
+extern bool
+cpuHasFeature(const char *arch,
+ const union cpuData *data,
+ const char *feature);
+
+
#endif /* __VIR_CPU_H__ */
diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
index 1937901..cc82d58 100644
--- a/src/cpu/cpu_x86.c
+++ b/src/cpu/cpu_x86.c
@@ -1754,6 +1754,55 @@ cleanup:
return ret;
}
+static bool x86HasFeature(const char *arch ATTRIBUTE_UNUSED,
+ const union cpuData *data,
+ const char *name)
+{
+ struct x86_map *map;
+ struct x86_feature *feature;
+ bool ret = false;
+ int i;
+
+ if (!(map = x86LoadMap()))
+ return false;
+
+ if (!(feature = x86FeatureFind(map, name)))
+ goto cleanup;
+
+ for (i = 0 ; i < data->x86.basic_len ; i++) {
+ if (data->x86.basic[i].function == feature->cpuid->function &&
+ ((data->x86.basic[i].eax & feature->cpuid->eax)
+ == feature->cpuid->eax) &&
+ ((data->x86.basic[i].ebx & feature->cpuid->ebx)
+ == feature->cpuid->ebx) &&
+ ((data->x86.basic[i].ecx & feature->cpuid->ecx)
+ == feature->cpuid->ecx) &&
+ ((data->x86.basic[i].edx & feature->cpuid->edx)
+ == feature->cpuid->edx)) {
+ ret = true;
+ goto cleanup;
+ }
+ }
+
+ for (i = 0 ; i < data->x86.extended_len ; i++) {
+ if (data->x86.extended[i].function == feature->cpuid->function &&
+ ((data->x86.extended[i].eax & feature->cpuid->eax)
+ == feature->cpuid->eax) &&
+ ((data->x86.extended[i].ebx & feature->cpuid->ebx)
+ == feature->cpuid->ebx) &&
+ ((data->x86.extended[i].ecx & feature->cpuid->ecx)
+ == feature->cpuid->ecx) &&
+ ((data->x86.extended[i].edx & feature->cpuid->edx)
+ == feature->cpuid->edx)) {
+ ret = true;
+ goto cleanup;
+ }
+ }
+
+cleanup:
+ x86MapFree(map);
+ return ret;
+}
struct cpuArchDriver cpuDriverX86 = {
.name = "x86",
@@ -1771,4 +1820,5 @@ struct cpuArchDriver cpuDriverX86 = {
.guestData = x86GuestData,
.baseline = x86Baseline,
.update = x86Update,
+ .hasFeature = x86HasFeature,
};
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index c2905ba..428b887 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -90,6 +90,7 @@ cpuEncode;
cpuGuestData;
cpuNodeData;
cpuUpdate;
+cpuHasFeature;
# cpu_conf.h
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 7a37c70..88dbf9b 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -1210,6 +1210,8 @@ static unsigned long long qemudComputeCmdFlags(const char *help,
flags |= QEMUD_CMD_FLAG_NO_KVM_PIT;
if (strstr(help, "-tdf"))
flags |= QEMUD_CMD_FLAG_TDF;
+ if (strstr(help, "-enable-nesting"))
+ flags |= QEMUD_CMD_FLAG_NESTING;
if (strstr(help, ",menu=on"))
flags |= QEMUD_CMD_FLAG_BOOT_MENU;
@@ -3500,7 +3502,8 @@ qemuBuildCpuArgStr(const struct qemud_driver *driver,
const char *emulator,
unsigned long long qemuCmdFlags,
const struct utsname *ut,
- char **opt)
+ char **opt,
+ bool *hasHwVirt)
{
const virCPUDefPtr host = driver->caps->host.cpu;
virCPUDefPtr guest = NULL;
@@ -3511,6 +3514,8 @@ qemuBuildCpuArgStr(const struct qemud_driver *driver,
virBuffer buf = VIR_BUFFER_INITIALIZER;
int i;
+ *hasHwVirt = false;
+
if (def->cpu && def->cpu->model) {
if (qemudProbeCPUModels(emulator, qemuCmdFlags, ut->machine,
&ncpus, &cpus) < 0)
@@ -3552,6 +3557,10 @@ qemuBuildCpuArgStr(const struct qemud_driver *driver,
if (cpuDecode(guest, data, cpus, ncpus, preferred) < 0)
goto cleanup;
+ *hasHwVirt =
+ cpuHasFeature(guest->arch, data, "svm") ||
+ cpuHasFeature(guest->arch, data, "vmx");
+
virBufferVSprintf(&buf, "%s", guest->model);
for (i = 0; i < guest->nfeatures; i++) {
char sign;
@@ -3678,6 +3687,7 @@ int qemudBuildCommandLine(virConnectPtr conn,
char *cpu;
char *smp;
int last_good_net = -1;
+ bool hasHwVirt = false;
uname_normalize(&ut);
@@ -3871,13 +3881,18 @@ int qemudBuildCommandLine(virConnectPtr conn,
ADD_ARG_LIT(def->os.machine);
}
- if (qemuBuildCpuArgStr(driver, def, emulator, qemuCmdFlags, &ut, &cpu) < 0)
+ if (qemuBuildCpuArgStr(driver, def, emulator, qemuCmdFlags,
+ &ut, &cpu, &hasHwVirt) < 0)
goto error;
if (cpu) {
ADD_ARG_LIT("-cpu");
ADD_ARG_LIT(cpu);
VIR_FREE(cpu);
+
+ if ((qemuCmdFlags & QEMUD_CMD_FLAG_NESTING) &&
+ hasHwVirt)
+ ADD_ARG_LIT("-enable-nesting");
}
if (disableKQEMU)
diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h
index 2c9e608..16f72f5 100644
--- a/src/qemu/qemu_conf.h
+++ b/src/qemu/qemu_conf.h
@@ -93,6 +93,7 @@ enum qemud_cmd_flags {
QEMUD_CMD_FLAG_NODEFCONFIG = (1LL << 37), /* -nodefconfig */
QEMUD_CMD_FLAG_BOOT_MENU = (1LL << 38), /* -boot menu=on support */
QEMUD_CMD_FLAG_ENABLE_KQEMU = (1LL << 39), /* -enable-kqemu flag */
+ QEMUD_CMD_FLAG_NESTING = (1LL << 40), /* -enable-nesting (SVM/VMX) */
};
/* Main driver state */
--
1.7.2.3
14 years, 1 month
[libvirt] [PATCH] Fix spelling of Xen
by Philipp Hahn
Trivial s/Xem/Xen/ in 4 comments.
Signed-off-by: Philipp Hahn <hahn(a)univention.de>
---
src/xen/xend_internal.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
14 years, 1 month
[libvirt] [PATCH] nwfilter: enable bridge netfilter calls via proc filesystem
by Stefan Berger
On a recent installation of FC13, the filtering of IP/IPv6 using
iptables/ip6tables traffic did not work since the proc filesystem
entries /proc/sys/net/bridge/bridge-nf-call-iptables and
/proc/sys/net/bridge/bridge-nf-call-ip6tables contained a zero each and
no traffic went into the FORWARD chain. The patch below makes sure that
if iptables or ip6tables are being used by the nwfilter driver that a
'1' is written into the relevant proc filesystem entry so that the
traffic goes into the FORWARD chain.
Signed-off-by: Stefan Berger <stefanb(a)us.ibm.com>
---
src/nwfilter/nwfilter_ebiptables_driver.c | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
Index: libvirt-acl/src/nwfilter/nwfilter_ebiptables_driver.c
===================================================================
--- libvirt-acl.orig/src/nwfilter/nwfilter_ebiptables_driver.c
+++ libvirt-acl/src/nwfilter/nwfilter_ebiptables_driver.c
@@ -63,6 +63,11 @@
: ""
+#define PROC_BRIDGE_NF_CALL_IPTABLES \
+ "/proc/sys/net/bridge/bridge-nf-call-iptables"
+#define PROC_BRIDGE_NF_CALL_IP6TABLES\
+ "/proc/sys/net/bridge/bridge-nf-call-ip6tables"
+
static char *ebtables_cmd_path;
static char *iptables_cmd_path;
static char *ip6tables_cmd_path;
@@ -429,16 +434,20 @@ static int iptablesLinkIPTablesBaseChain
static int iptablesCreateBaseChains(const char *iptables_cmd,
- virBufferPtr buf)
+ virBufferPtr buf,
+ bool isIPv6)
{
virBufferVSprintf(buf,"%s -N " VIRT_IN_CHAIN CMD_SEPARATOR
"%s -N " VIRT_OUT_CHAIN CMD_SEPARATOR
"%s -N " VIRT_IN_POST_CHAIN CMD_SEPARATOR
- "%s -N " HOST_IN_CHAIN CMD_SEPARATOR,
+ "%s -N " HOST_IN_CHAIN CMD_SEPARATOR
+ "echo 1 > %s" CMD_SEPARATOR,
+ iptables_cmd,
iptables_cmd,
iptables_cmd,
iptables_cmd,
- iptables_cmd);
+ isIPv6 ? PROC_BRIDGE_NF_CALL_IP6TABLES
+ : PROC_BRIDGE_NF_CALL_IPTABLES);
iptablesLinkIPTablesBaseChain(iptables_cmd, buf,
VIRT_IN_CHAIN , "FORWARD", 1, 1);
iptablesLinkIPTablesBaseChain(iptables_cmd, buf,
@@ -3074,7 +3083,7 @@ ebiptablesApplyNewRules(virConnectPtr co
iptablesUnlinkTmpRootChains(iptables_cmd_path, &buf, ifname);
iptablesRemoveTmpRootChains(iptables_cmd_path, &buf, ifname);
- iptablesCreateBaseChains(iptables_cmd_path, &buf);
+ iptablesCreateBaseChains(iptables_cmd_path, &buf, false);
if (ebiptablesExecCLI(&buf, &cli_status) || cli_status != 0)
goto tear_down_tmpebchains;
@@ -3105,7 +3114,7 @@ ebiptablesApplyNewRules(virConnectPtr co
iptablesUnlinkTmpRootChains(ip6tables_cmd_path, &buf, ifname);
iptablesRemoveTmpRootChains(ip6tables_cmd_path, &buf, ifname);
- iptablesCreateBaseChains(ip6tables_cmd_path, &buf);
+ iptablesCreateBaseChains(ip6tables_cmd_path, &buf, true);
if (ebiptablesExecCLI(&buf, &cli_status) || cli_status != 0)
goto tear_down_tmpiptchains;
14 years, 1 month
[libvirt] [RFC PATCH] maint: update to latest gnulib
by Eric Blake
* .gnulib: Update to latest.
* bootstrap.conf (gnulib_modules): Add new termios module.
(gnulib_tool_option_extras): Make libtool usage explicit.
* src/util/util.c (includes): Gnulib now guarantees termios.h.
* bootstrap: Resync from gnulib.
---
On IRC, hallyn_ pointed out that libvirt doesn't build with the
latest gnulib. This fixes that situation. However, until
http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/23111/focus=23241
is fixed upstream, this patch points .gnulib at a commit that is
only in my repository; hence marking it as an RFC (I can't push this
until I rebase it to point .gnulib to a public commit that works).
.gnulib | 2 +-
bootstrap | 11 +++++++----
bootstrap.conf | 2 ++
src/util/util.c | 4 +---
4 files changed, 11 insertions(+), 8 deletions(-)
* .gnulib 7ba06c8...d2a65f2 (174):
> termios: relax license
> threadlib: Allow the package to change the default to 'no'.
> autoupdate
> Fix endless loop in mbmemcasecoll.
> Tests for module 'memcoll'.
> memcoll, xmemcoll: Clarify size vs. length.
> Tests for module 'memcasecmp'.
> pthread: add to system <pthread.h> instead of replacing it all, for MacOS
> net_if: enhance tests
> Add ChangeLog entry for last commit.
> Manual: improve out-of-memory documentation.
> autoupdate
> Add ChangeLog entry.
> Use src/ not lib/ as root of source in example Makefile.am code.
> Set cut_dir properly, and add mode line for Emacs.
> Set cut_dir properly, and add mode line for Emacs.
> Make Makefile.am example code more cut-and-paste friendly.
> New module to test <net/if.h> interfaces.
> pthread: add pthread_spin_destroy
> gnulib-tool: Fix --help output.
> maint.mk: avoid unexpanded \n in two diagnostics
> netinet_in: Doc tweak.
> init.sh: correct an outdated comment
> init.sh: don't let an ephemeral "*.exe" make us skip all dir entries
> mirbsd: add some more support
> tests: fix unportable assumption on sys/wait.h
> init.sh: accomodate directory with no .exes
> tests: avoid compiler warning
> fdutimens, fdutimensat: update signature, again
> Take over the maintenance of some older macros from Autoconf.
> fdutimensat: drop atflag validation
> unlockpt: Fix declaration within GNULIB_POSIXCHECK.
> login_tty: Fix detection of function on FreeBSD, OpenBSD, NetBSD.
> login_tty: Make the replacement code work on BSD systems.
> login_tty: Stricter unit test.
> New module 'tcgetsid'.
> Tests for module 'termios'.
> New module 'termios'.
> fdutimensat: add an atflag parameter
> Fix typos in comments.
> Fix typo in last commit.
> stdlib: clarify MirBSD WEXITSTATUS bug
> stdlib: work around MirBSD WEXITSTATUS bug
> docs: mention MacOS issue with WEXITSTATUS(constant)
> strnlen: add tests
> unistr/base: Avoid link errors when module 'libunistring' is also used.
> test-rawmemchr: make more robust
> memchr: detect glibc Alpha bug
> fts, getcwd, glob: audit for dirfd returning -1
> float: fix broken MirBSD header
> fts: use O_NOFOLLOW to avoid race condition when opening a directory
> fdopendir: preserve argument fd before returning
> regex: Pass the system regex if its only problem is 32-bit regoff_t.
> fts: don't operate on an invalid file descriptor after failed dup
> savedir: add streamsavedir, deprecate fdsavedir
> autoupdate
> langinfo: Fix last commit.
> relocatable-prog-wrapper: Fix compilation failure due to O_EXEC.
> Improve NEWS entry.
> * NEWS: Document recent changes to fcntl-h.
> fcntl-h: define O_CLOEXEC and O_EXEC if not defined; use new defines
> langinfo, nl_langinfo: Fix for IRIX 5.3.
> pty, readutmp: Fix for FreeBSD 8.0 and OpenBSD 4.6.
> strsignal: work around NetBSD bug
> gnulib-tool: work with NetBSD /bin/sh
> autoupdate
> gnulib-tool: Avoid stderr output on IRIX related to 'alias', 'unalias'.
> init.sh: penalize a set-x-impaired shell; don't disqualify it
> unsetenv: fix OpenBSD bug
> strtod: work around IRIX 6.5 bug
> autoupdate
> maint: fix ChangeLog ordering
> getopt: optimize previous patch
> init.sh: disqualify shells for which set -x corrupts stderr
> gnulib-tool: Avoid stderr output on IRIX related to 'alias', 'unalias'.
> Fix formatting of ChangeLog entry.
> regex documentation update from Reuben Thomas <rrt(a)sc3d.org>, 20 Aug 2010 12:04:39 +0100
> regex documentation update from Reuben Thomas <rrt(a)sc3d.org>, 20 Aug 2010 12:04:39 +0100
> getopt: handle POSIXLY_CORRECT set but not exported
> gnulib-tool: Highlight the changed options.
> update from texinfo
> doc tweaks
> uniwidth/width: Update comment.
> isinf, isnan: Relax license.
> gnulib-tool: Help migration from --import to --add-import or --update.
> Update doc about gnulib-tool.
> gnulib-tool: Change --import. New options --add/remove-import.
> Doc update.
> gnulib-tool: Don't talk about CVS any more.
> maint.mk: avoid obscure sc_copyright_check failure in coreutils
> gnulib-tool: Fix expression that counts directories.
> avoid coreutils "make distcheck" failure
> gnulib-tool: Avoid error when run in a package without Makefile.am.
> update-copyright test: Improve output when perl is missing or too old.
> Don't augment PATH in TESTS_ENVIRONMENT.
> tests: prohibit augmenting PATH via TESTS_ENVIRONMENT
> strdup: Fix compilation error in C++ mode.
> dirfd: Fix compilation error in C++ mode on MacOS X, *BSD, IRIX.
> Set PATH_SEPARATOR the same way autoconf does.
> Set PATH_SEPARATOR the same way autoconf does.
> autoupdate
> tests: init.sh improvements for re-exec'ing with zsh
> hash: fix safe_hasher const typo
> test-update-copyright.sh: require perl 5.8.0
> wctype: fix typo in previous commit
> test-update-copyright.sh: skip test if Perl is too old
> wctype: Avoid compilation error on IRIX 6.5.30.
> New module 'socketlib'.
> fcntl-h, etc.: prefer O_SEARCH to O_RDONLY when applicable
> autoupdate
> New module 'host-cpu-c-abi'.
> hash: factor, and guard against misbehaving hasher function
> hash: silence spurious clang warning
> strstr, memmem, strcasestr: avoid leaked shell message
> tests: silence clang warning
> gettext: Fix recent mistake.
> selinux-h: Offer a --without-selinux option.
> Make the module 'realloc-gnu' work again on AIX and OSF/1.
> Make the module 'calloc-gnu' work again on AIX and OSF/1.
> Make the module 'malloc-gnu' work again on AIX and OSF/1.
> Update modules list.
> realloc-gnu: Really add the module description.
> Tests for module 'realloc-gnu'. * modules/realloc-gnu-tests: New file. * tests/test-realloc-gnu.c: New file.
> Tests for module 'calloc-gnu'. * modules/calloc-gnu-tests: New file. * tests/test-calloc-gnu.c: New file.
> Tests for module 'malloc-gnu'. * modules/malloc-gnu-tests: New file. * tests/test-malloc-gnu.c: New file.
> Rename module 'realloc' -> 'realloc-gnu'.
> Rename module 'calloc' -> 'calloc-gnu'.
> Rename module 'malloc' -> 'malloc-gnu'.
> pread, pwrite: add missing dependency
> unistr/u*-strchr: Fix tests dependencies.
> read-file: Don't occupy too much unused memory.
> read-file: Avoid memory reallocations with regular files. * lib/read-file.c: Include <sys/stat.h>, <stdio.h>, <stdint.h>. (fread_file): With regular files, use the remaining length as the initial buffer size. Check against overflow. * modules/read-file (Depends-on): Add ftello, malloc-posix, stdint, sys_stat.
> autoupdate
> ftello: Relax license.
> Avoid relocwrapper link errors due to gnulib replacement functions.
> Prefer using AC_DEFUN_ONCE over AC_DEFUN in projects with gnulib.
> sys_socket, netdb: Ensure socklen_t gets defined.
> * ChangeLog: fix typo
> login_tty: add missing dependeny
> lib-symbol-versions: fix m4 quoting
> glob: fix compile test
> btowc: fix missing file
> lseek: fix link test
> include_next: silence autoconf 2.68 warning
> acl: fix compilation test
> Modernize AC_TRY_RUN invocations.
> Modernize AC_TRY_LINK invocations.
> Modernize AC_TRY_COMPILE invocations.
> stat-time: relax license LGPL
> autoupdate
> poll: return immediately on POLLHUP.
> Fix test-unlinkat, test-rmdir failure on AIX 5.3.
> stdbool: avoid spurious failure with modern xlc
> getloadavg: simplify code
> getloadavg: don't define SVR4 on cygwin
> priv-set: fix comment
> priv-set: fix comments
> stdbool: avoid rejecting clang
> argz: fix shell quoting issue
> poll, select: handle ERROR_BROKEN_PIPE.
> fts: allow compilation with C++
> autoupdate
> Fix gnulib-tool sed script de-commentation for AIX sed.
> update from texinfo
> autoupdate
> test-stddef: test for (some) offsetof bugs
> stpncpy: Allow stpncpy to be defined as a macro.
> Rename module 'memxfrm' to 'amemxfrm'.
> Tests for module 'astrxfrm'.
> New module 'astrxfrm'.
> Document not_eol.
> Document not_eol and remove mention of regex.c.
> Ignore one more generated index from makeinfo.
> git-merge-changelog: add doc relating to use with bzr and hg.
diff --git a/.gnulib b/.gnulib
index 7ba06c8..d2a65f2 160000
--- a/.gnulib
+++ b/.gnulib
@@ -1 +1 @@
-Subproject commit 7ba06c8ff37d8725cb824c64b94be41b9294ffb7
+Subproject commit d2a65f2441f89114642a5dc9a775050839423dca
diff --git a/bootstrap b/bootstrap
index 2422549..5ab4cf7 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1,6 +1,6 @@
#! /bin/sh
# Print a version string.
-scriptversion=2010-05-17.18; # UTC
+scriptversion=2010-07-06.10; # UTC
# Bootstrap this package from checked-out sources.
@@ -90,7 +90,8 @@ bootstrap_epilogue() { :; }
# options because the latest/%s directory and the .po files within are
# all symlinks.
po_download_command_format=\
-"rsync -Lrtvz 'translationproject.org::tp/latest/%s/' '%s'"
+"rsync --delete --exclude '*.s1' -Lrtvz \
+ 'translationproject.org::tp/latest/%s/' '%s'"
extract_package_name='
/^AC_INIT(/{
@@ -475,15 +476,17 @@ download_po_files() {
eval "$cmd"
}
-# Download .po files to $po_dir/.reference and copy only the new
+# Mirror .po files to $po_dir/.reference and copy only the new
# or modified ones into $po_dir. Also update $po_dir/LINGUAS.
+# Note po files that exist locally only are left in $po_dir but will
+# not be included in LINGUAS and hence will not be distributed.
update_po_files() {
# Directory containing primary .po files.
# Overwrite them only when we're sure a .po file is new.
po_dir=$1
domain=$2
- # Download *.po files into this dir.
+ # Mirror *.po files into this dir.
# Usually contains *.s1 checksum files.
ref_po_dir="$po_dir/.reference"
diff --git a/bootstrap.conf b/bootstrap.conf
index 8a85b91..1f1d416 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -65,6 +65,7 @@ strsep
strtok_r
sys_stat
sys_wait
+termios
time_r
timegm
uname
@@ -132,6 +133,7 @@ gnulib_mk=Makefile.am
gnulib_tool_option_extras="\
--lgpl=2\
--with-tests\
+ --libtool\
"
# Convince bootstrap to use multiple m4 directories.
diff --git a/src/util/util.c b/src/util/util.c
index b6b9712..586baee 100644
--- a/src/util/util.c
+++ b/src/util/util.c
@@ -43,9 +43,7 @@
#endif
#include <string.h>
#include <signal.h>
-#if HAVE_TERMIOS_H
-# include <termios.h>
-#endif
+#include <termios.h>
#include "c-ctype.h"
#ifdef HAVE_PATHS_H
--
1.7.2.3
14 years, 1 month
[libvirt] [PATCH] Set sensible defaults for cpu match and feature policy
by Daniel P. Berrange
To enable the CPU XML from the capabilities to be pasted directly
into the guest XML with no editing, pick a sensible default for
match and feature policy. The CPU match will be exact and the
feature policy will be require. This should ensure safety for
migration and give DWIM semantics for users
* src/conf/cpu_conf.c: Default to exact match and require policy
* docs/formatdomain.html.in: Document new defaults
---
docs/formatdomain.html.in | 6 ++++++
src/conf/cpu_conf.c | 15 ++++++++-------
2 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 5e56dae..45709e4 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -268,6 +268,9 @@
<dd>The guest will not be created unless the host CPU does exactly
match the specification.</dd>
</dl>
+
+ <span class="since">Since 0.8.5</span> the <code>match</code>
+ attribute can be omitted and will default to <code>exact</code>.
</dd>
<dt><code>model</code></dt>
@@ -314,6 +317,9 @@
<dd>Guest creation will fail if the feature is supported by host
CPU.</dd>
</dl>
+
+ <span class="since">Since 0.8.5</span> the <code>policy</code>
+ attribute can be omitted and will default to <code>require</code>.
</dd>
</dl>
diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c
index 3274659..68d3daf 100644
--- a/src/conf/cpu_conf.c
+++ b/src/conf/cpu_conf.c
@@ -147,12 +147,10 @@ virCPUDefParseXML(const xmlNodePtr node,
char *match = virXMLPropString(node, "match");
if (!match) {
- if (virXPathBoolean("boolean(./model)", ctxt)) {
- virCPUReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("Missing match attribute for CPU specification"));
- goto error;
- }
- def->match = -1;
+ if (virXPathBoolean("boolean(./model)", ctxt))
+ def->match = VIR_CPU_MATCH_EXACT;
+ else
+ def->match = -1;
} else {
def->match = virCPUMatchTypeFromString(match);
VIR_FREE(match);
@@ -251,7 +249,10 @@ virCPUDefParseXML(const xmlNodePtr node,
char *strpolicy;
strpolicy = virXMLPropString(nodes[i], "policy");
- policy = virCPUFeaturePolicyTypeFromString(strpolicy);
+ if (strpolicy == NULL)
+ policy = VIR_CPU_FEATURE_REQUIRE;
+ else
+ policy = virCPUFeaturePolicyTypeFromString(strpolicy);
VIR_FREE(strpolicy);
if (policy < 0) {
--
1.7.2.3
14 years, 1 month
[libvirt] [PATCH v2 00/11] Implement memory control api
by Nikunj A. Dadhania
Changelog from v1:
* Patch re-ordering for compilation
* Folded python bindings changes to patch 01
* Added defines for string constants for memory tunables
* Typo fix: min_guarantee
* Moved initialization of function pointers in driver.h patch
This patch series implement public api for controlling various memory tunables
exported by the OS. This is based on the following RFC[1].
* Implement virDomainSetMemoryParameters api
* Provide implementation for remote, QEmu and LXC drivers
* Enable memory controller support fro QEmu
* virsh command for runtime changes to the memory parameters
* Domain configuration parsing for memory control parameters
* Cgroup memory controller code for memory hard_limit/soft_limit, swap
hard_limit
To Do
* Python bindings is just a place holder, need to implement
* virDomainGetMemoryParameters
1. https://www.redhat.com/archives/libvir-list/2010-August/msg00607.html
2. https://www.redhat.com/archives/libvir-list/2010-August/msg00699.html
---
Nikunj A. Dadhania (11):
Adding structure and defines for virDomainSetMemoryParameter
Adding virDomainSetMemoryParameters API
Adds xml entries for memory tunables
XML parsing for memory tunables
Implement cgroup memory controller tunables
Implement driver interface domainSetMemoryParamters for QEmu
Adding memtunables to libvirt-lxc command
Adding memtunables to qemuSetupCgroup
Adding memtune command to virsh tool
Implements virDomainSetMemoryParameters for the remote driver
Implement domainSetMemoryParameters function
daemon/remote.c | 66 +++++++++++++++++
daemon/remote_dispatch_prototypes.h | 8 ++
daemon/remote_dispatch_table.h | 5 +
docs/schemas/domain.rng | 31 ++++++++
include/libvirt/libvirt.h.in | 60 +++++++++++++++
python/generator.py | 1
python/libvirt-override-api.xml | 6 ++
python/libvirt-override.c | 7 ++
src/conf/domain_conf.c | 50 +++++++++++--
src/conf/domain_conf.h | 12 ++-
src/driver.h | 6 ++
src/esx/esx_driver.c | 1
src/esx/esx_vmx.c | 30 ++++----
src/libvirt.c | 48 ++++++++++++
src/libvirt_private.syms | 6 ++
src/libvirt_public.syms | 5 +
src/lxc/lxc_controller.c | 24 ++++++
src/lxc/lxc_driver.c | 101 ++++++++++++++++++++++++--
src/openvz/openvz_driver.c | 9 +-
src/phyp/phyp_driver.c | 1
src/qemu/qemu.conf | 4 +
src/qemu/qemu_conf.c | 11 ++-
src/qemu/qemu_driver.c | 138 +++++++++++++++++++++++++++++++++--
src/remote/remote_driver.c | 66 +++++++++++++++++
src/remote/remote_protocol.c | 62 +++++++++++++++-
src/remote/remote_protocol.h | 36 +++++++++
src/test/test_driver.c | 13 ++-
src/uml/uml_conf.c | 2 -
src/uml/uml_driver.c | 15 ++--
src/util/cgroup.c | 106 +++++++++++++++++++++++++++
src/util/cgroup.h | 7 ++
src/xen/xen_driver.c | 1
tools/virsh.c | 89 +++++++++++++++++++++++
33 files changed, 959 insertions(+), 68 deletions(-)
14 years, 1 month