[libvirt] [PATCH 0/6] Revert: 'IP peer address and host-side address config support'
by Ján Tomko
This series was accidentally pushed in the feature freeze.
Revert the last six commits adding the new functionality.
The rest are either bugfixes or preparation for the bugfixes.
Ján Tomko (6):
Revert "qemu: support setting host-side IP addresses/routes"
Revert "lxc: support setting host-side IP addresses/routes"
Revert "util: support setting peer for virNetDevIPInfo addresses"
Revert "conf: support host-side IP/route information in <interface>"
Revert "conf: allow setting peer address in <ip> element of
<interface>"
Revert "util: new function virNetDevIPInfoAddToDev"
docs/formatdomain.html.in | 60 +++--------
docs/schemas/domaincommon.rng | 8 +-
src/conf/domain_conf.c | 117 ++++-----------------
src/conf/domain_conf.h | 3 +-
src/libvirt_private.syms | 1 -
src/lxc/lxc_container.c | 47 +++++++--
src/lxc/lxc_process.c | 8 --
src/qemu/qemu_interface.c | 6 +-
src/util/virnetdevip.c | 60 -----------
src/util/virnetdevip.h | 7 +-
tests/lxcxml2xmldata/lxc-ethernet-hostip.xml | 44 --------
tests/lxcxml2xmltest.c | 1 -
.../qemuxml2argv-net-eth-hostip.args | 23 ----
.../qemuxml2argv-net-eth-hostip.xml | 39 -------
tests/qemuxml2argvtest.c | 1 -
.../qemuxml2xmlout-net-eth-hostip.xml | 44 --------
tests/qemuxml2xmltest.c | 1 -
17 files changed, 75 insertions(+), 395 deletions(-)
delete mode 100644 tests/lxcxml2xmldata/lxc-ethernet-hostip.xml
delete mode 100644 tests/qemuxml2argvdata/qemuxml2argv-net-eth-hostip.args
delete mode 100644 tests/qemuxml2argvdata/qemuxml2argv-net-eth-hostip.xml
delete mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-net-eth-hostip.xml
--
2.7.3
8 years, 3 months
[libvirt] [PATCH 0/5] Some USB hotplug and alias cleanups
by John Ferlan
A post 2.0.0 type adjustment...
While answering a question for bz 1289391 regarding the USB path - I figured
that making the code be more the virtio and scsi code paths would at least
have a better look'n'feel. Then I tripped in to the alias morass and cleaned
that up a bit too.
John Ferlan (5):
qemu: Reorder qemuDomainAttachUSBMassStorageDevice failure path
qemu: Move drive alias processing to qemu_alias
qemu: Use qemuAssignDeviceDiskDriveAlias
qemu: Make QEMU_DRIVE_HOST_PREFIX more private
qemu: Add attempt to call qemuMonitorDriveDel for USB failure path
src/qemu/qemu_alias.c | 34 +++++++++++++++++++++++++
src/qemu/qemu_alias.h | 4 +++
src/qemu/qemu_command.c | 23 ++++++++---------
src/qemu/qemu_command.h | 1 -
src/qemu/qemu_domain.c | 3 +--
src/qemu/qemu_driver.c | 3 +--
src/qemu/qemu_hotplug.c | 59 ++++++++++++++++++++++++++++----------------
src/qemu/qemu_migration.c | 11 +++------
src/qemu/qemu_monitor_json.c | 10 +++-----
src/qemu/qemu_monitor_text.c | 18 ++++++++------
src/qemu/qemu_process.c | 3 +--
11 files changed, 107 insertions(+), 62 deletions(-)
--
2.5.5
8 years, 3 months
[libvirt] [PATCH] Allow custom metadata in network configuration XML
by Brnadon Bennett
From: Brandon Bennett <bbennett(a)fb.com>
This replicates the metadata field found in the domain configuration
and adds it to the network configuration XML.
---
docs/formatnetwork.html.in | 13 +++++++++++++
docs/schemas/basictypes.rng | 23 +++++++++++++++++++++++
docs/schemas/domaincommon.rng | 23 -----------------------
docs/schemas/network.rng | 5 +++++
src/conf/network_conf.c | 35 ++++++++++++++++++++++++++++++++++-
src/conf/network_conf.h | 3 +++
tests/networkxml2xmlin/metadata.xml | 10 ++++++++++
tests/networkxml2xmlout/metadata.xml | 10 ++++++++++
tests/networkxml2xmltest.c | 1 +
9 files changed, 99 insertions(+), 24 deletions(-)
create mode 100644 tests/networkxml2xmlin/metadata.xml
create mode 100644 tests/networkxml2xmlout/metadata.xml
diff --git a/docs/formatnetwork.html.in b/docs/formatnetwork.html.in
index 1cea931..15ebf0c 100644
--- a/docs/formatnetwork.html.in
+++ b/docs/formatnetwork.html.in
@@ -38,6 +38,10 @@
<network ipv6='yes' trustGuestRxFilters='no'>
<name>default</name>
<uuid>3e3fce45-4f53-4fa7-bb32-11f34168b82b</uuid>
+ <metadata>
+ <app1:foo xmlns:app1="http://app1.org/app1/">..</app1:foo>
+ <app2:bar xmlns:app2="http://app1.org/app2/">..</app2:bar>
+ </metadata>
...</pre>
<dl>
@@ -54,6 +58,12 @@
The format must be RFC 4122 compliant, eg <code>3e3fce45-4f53-4fa7-bb32-11f34168b82b</code>.
If omitted when defining/creating a new network, a random
UUID is generated. <span class="since">Since 0.3.0</span></dd>
+ <dd>The <code>metadata</code> node can be used by applications to
+ store custom metadata in the form of XML nodes/trees. Applications
+ must use custom namespaces on their XML nodes/trees, with only
+ one top-level element per namespace (if the application needs
+ structure, they should have sub-elements to their namespace
+ element). <span class="since">Since 1.3.6</span></dd>
<dt><code>ipv6</code></dt>
<dd>When set to <code>yes</code>, the optional parameter
<code>ipv6</code> enables
@@ -73,6 +83,9 @@
override the setting in the network.</dd>
</dl>
++
+
+
<h3><a name="elementsConnect">Connectivity</a></h3>
<p>
diff --git a/docs/schemas/basictypes.rng b/docs/schemas/basictypes.rng
index 83fd4ec..474ad77 100644
--- a/docs/schemas/basictypes.rng
+++ b/docs/schemas/basictypes.rng
@@ -495,4 +495,27 @@
</choice>
</define>
+ <define name="metadata">
+ <element name="metadata">
+ <zeroOrMore>
+ <ref name="customElement"/>
+ </zeroOrMore>
+ </element>
+ </define>
+
+ <define name="customElement">
+ <element>
+ <anyName/>
+ <zeroOrMore>
+ <choice>
+ <attribute>
+ <anyName/>
+ </attribute>
+ <text/>
+ <ref name="customElement"/>
+ </choice>
+ </zeroOrMore>
+ </element>
+ </define>
+
</grammar>
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 162c2e0..78eb3f5 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -5338,29 +5338,6 @@
</element>
</define>
- <define name="metadata">
- <element name="metadata">
- <zeroOrMore>
- <ref name="customElement"/>
- </zeroOrMore>
- </element>
- </define>
-
- <define name="customElement">
- <element>
- <anyName/>
- <zeroOrMore>
- <choice>
- <attribute>
- <anyName/>
- </attribute>
- <text/>
- <ref name="customElement"/>
- </choice>
- </zeroOrMore>
- </element>
- </define>
-
<!--
Type library
-->
diff --git a/docs/schemas/network.rng b/docs/schemas/network.rng
index 4edb6eb..b67a5ea 100644
--- a/docs/schemas/network.rng
+++ b/docs/schemas/network.rng
@@ -37,6 +37,11 @@
<text/>
</element>
+ <!-- <metadata> element -->
+ <optional>
+ <ref name="metadata"/>
+ </optional>
+
<!-- <uuid> element -->
<optional>
<element name="uuid"><ref name="UUID"/></element>
diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c
index 02b8cd7..4239c32 100644
--- a/src/conf/network_conf.c
+++ b/src/conf/network_conf.c
@@ -419,6 +419,9 @@ virNetworkDefFree(virNetworkDefPtr def)
virNetDevBandwidthFree(def->bandwidth);
virNetDevVlanClear(&def->vlan);
+
+ xmlFreeNode(def->metadata);
+
VIR_FREE(def);
}
@@ -2059,6 +2062,7 @@ virNetworkDefParseXML(xmlXPathContextPtr ctxt)
xmlNodePtr save = ctxt->node;
xmlNodePtr bandwidthNode = NULL;
xmlNodePtr vlanNode;
+ xmlNodePtr metadataNode = NULL;
if (VIR_ALLOC(def) < 0)
return NULL;
@@ -2388,8 +2392,12 @@ virNetworkDefParseXML(xmlXPathContextPtr ctxt)
}
break;
}
-
VIR_FREE(stp);
+
+ /* Extract custom metadata */
+ if ((metadataNode = virXPathNode("./metadata[1]", ctxt)) != NULL)
+ def->metadata = xmlCopyNode(metadataNode, 1);
+
ctxt->node = save;
return def;
@@ -2412,12 +2420,14 @@ virNetworkDefParse(const char *xmlStr,
{
xmlDocPtr xml;
virNetworkDefPtr def = NULL;
+ int keepBlanksDefault = xmlKeepBlanksDefault(0);
if ((xml = virXMLParse(filename, xmlStr, _("(network_definition)")))) {
def = virNetworkDefParseNode(xml, xmlDocGetRootElement(xml));
xmlFreeDoc(xml);
}
+ xmlKeepBlanksDefault(keepBlanksDefault);
return def;
}
@@ -2736,6 +2746,29 @@ virNetworkDefFormatBuf(virBufferPtr buf,
virUUIDFormat(uuid, uuidstr);
virBufferAsprintf(buf, "<uuid>%s</uuid>\n", uuidstr);
+ if (def->metadata) {
+ xmlBufferPtr xmlbuf;
+ int oldIndentTreeOutput = xmlIndentTreeOutput;
+
+ /* Indentation on output requires that we previously set
+ * xmlKeepBlanksDefault to 0 when parsing; also, libxml does 2
+ * spaces per level of indentation of intermediate elements,
+ * but no leading indentation before the starting element.
+ * Thankfully, libxml maps what looks like globals into
+ * thread-local uses, so we are thread-safe. */
+ xmlIndentTreeOutput = 1;
+ xmlbuf = xmlBufferCreate();
+ if (xmlNodeDump(xmlbuf, def->metadata->doc, def->metadata,
+ virBufferGetIndent(buf, false) / 2, 1) < 0) {
+ xmlBufferFree(xmlbuf);
+ xmlIndentTreeOutput = oldIndentTreeOutput;
+ goto error;
+ }
+ virBufferAsprintf(buf, "%s\n", (char *) xmlBufferContent(xmlbuf));
+ xmlBufferFree(xmlbuf);
+ xmlIndentTreeOutput = oldIndentTreeOutput;
+ }
+
if (def->forward.type != VIR_NETWORK_FORWARD_NONE) {
const char *dev = NULL;
if (!def->forward.npfs)
diff --git a/src/conf/network_conf.h b/src/conf/network_conf.h
index 0d34dfe..4481f60 100644
--- a/src/conf/network_conf.h
+++ b/src/conf/network_conf.h
@@ -253,6 +253,9 @@ struct _virNetworkDef {
virNetDevBandwidthPtr bandwidth;
virNetDevVlan vlan;
int trustGuestRxFilters; /* enum virTristateBool */
+
+ /* Application-specific custom metadata */
+ xmlNodePtr metadata;
};
typedef struct _virNetworkObj virNetworkObj;
diff --git a/tests/networkxml2xmlin/metadata.xml b/tests/networkxml2xmlin/metadata.xml
new file mode 100644
index 0000000..c075f93
--- /dev/null
+++ b/tests/networkxml2xmlin/metadata.xml
@@ -0,0 +1,10 @@
+<network>
+ <name>host-bridge-net</name>
+ <uuid>81ff0d90-c91e-6742-64da-4a736edb9a8e</uuid>
+ <forward mode='bridge'/>
+ <bridge name='br0'/>
+ <metadata>
+ <app1:foo xmlns:app1="http://foo.org/">fooish</app1:foo>
+ <app2:bar xmlns:app2="http://bar.com/" maman="baz">barish</app2:bar>
+ </metadata>
+</network>
diff --git a/tests/networkxml2xmlout/metadata.xml b/tests/networkxml2xmlout/metadata.xml
new file mode 100644
index 0000000..a9364ab
--- /dev/null
+++ b/tests/networkxml2xmlout/metadata.xml
@@ -0,0 +1,10 @@
+<network>
+ <name>host-bridge-net</name>
+ <uuid>81ff0d90-c91e-6742-64da-4a736edb9a8e</uuid>
+ <metadata>
+ <app1:foo xmlns:app1="http://foo.org/">fooish</app1:foo>
+ <app2:bar xmlns:app2="http://bar.com/" maman="baz">barish</app2:bar>
+ </metadata>
+ <forward mode='bridge'/>
+ <bridge name='br0'/>
+</network>
diff --git a/tests/networkxml2xmltest.c b/tests/networkxml2xmltest.c
index d65f6aa..2a2c348 100644
--- a/tests/networkxml2xmltest.c
+++ b/tests/networkxml2xmltest.c
@@ -153,6 +153,7 @@ mymain(void)
DO_TEST("host-bridge-no-flood");
DO_TEST_PARSE_ERROR("hostdev-duplicate");
DO_TEST_PARSE_ERROR("passthrough-duplicate");
+ DO_TEST("metadata");
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
--
2.7.4
8 years, 3 months
[libvirt] [PATCH] docs: remove outdated suggestion to make patches with "diff -urp" or "git diff"
by Laine Stump
I can't think of any good reason to do either of those, and having the
examples there will just lead to unusable patch emails from people who
can't be bothered to read the entire page.
---
I'm sure there are other problems with this file, but this one really
jupmed out at me when I was suggesting to someone that they look to
this page for proper procedures.
docs/hacking.html.in | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/docs/hacking.html.in b/docs/hacking.html.in
index a471d88..5f19143 100644
--- a/docs/hacking.html.in
+++ b/docs/hacking.html.in
@@ -23,21 +23,11 @@
automatically pulls the latest version of each translation
file from zanata.</li>
- <li><p>Post patches in unified diff format, with git rename
+ <li><p>Post patches using "git send-email", with git rename
detection enabled. You need a one-time setup of:</p>
<pre>
git config diff.renames true
</pre>
- <p>After that, a command similar to this should work:</p>
-<pre>
- diff -urp libvirt.orig/ libvirt.modified/ > libvirt-myfeature.patch
-</pre>
- <p>
- or:
- </p>
-<pre>
- git diff > libvirt-myfeature.patch
-</pre>
<p>Also, for code motion patches, you may find that <code>git
diff --patience</code> provides an easier-to-read patch.
However, the usual workflow of libvirt developer is:</p>
--
2.5.5
8 years, 3 months
[libvirt] [PATCH] qemu: Let empty default VNC password work as documented
by Jiri Denemark
CVE-2016-5008
Setting an empty graphics password is documented as a way to disable
VNC/SPICE access, but QEMU does not always behaves like that. VNC would
happily accept the empty password. Let's enforce the behavior by setting
password expiration to "now".
https://bugzilla.redhat.com/show_bug.cgi?id=1180092
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/qemu/qemu_hotplug.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index e0b8230..bf6430d 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -3933,6 +3933,7 @@ qemuDomainChangeGraphicsPasswords(virQEMUDriverPtr driver,
time_t now = time(NULL);
char expire_time [64];
const char *connected = NULL;
+ const char *password;
int ret = -1;
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
@@ -3940,16 +3941,14 @@ qemuDomainChangeGraphicsPasswords(virQEMUDriverPtr driver,
ret = 0;
goto cleanup;
}
+ password = auth->passwd ? auth->passwd : defaultPasswd;
if (auth->connected)
connected = virDomainGraphicsAuthConnectedTypeToString(auth->connected);
if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
goto cleanup;
- ret = qemuMonitorSetPassword(priv->mon,
- type,
- auth->passwd ? auth->passwd : defaultPasswd,
- connected);
+ ret = qemuMonitorSetPassword(priv->mon, type, password, connected);
if (ret == -2) {
if (type != VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
@@ -3957,14 +3956,15 @@ qemuDomainChangeGraphicsPasswords(virQEMUDriverPtr driver,
_("Graphics password only supported for VNC"));
ret = -1;
} else {
- ret = qemuMonitorSetVNCPassword(priv->mon,
- auth->passwd ? auth->passwd : defaultPasswd);
+ ret = qemuMonitorSetVNCPassword(priv->mon, password);
}
}
if (ret != 0)
goto end_job;
- if (auth->expires) {
+ if (password[0] == '\0') {
+ snprintf(expire_time, sizeof(expire_time), "now");
+ } else if (auth->expires) {
time_t lifetime = auth->validTo - now;
if (lifetime <= 0)
snprintf(expire_time, sizeof(expire_time), "now");
--
2.9.0
8 years, 3 months
[libvirt] Entering freeze for libvirt-2.0.0
by Daniel Veillard
As planned the Release candidate 1 of libvirt 2.0.0 is tagged in git,
I have made signed tarball and rpms available at the usual place:
ftp://libvirt.org/libvirt/
Seems to work just fine in my limited testing, but there is a number
of packaging changes and we need to look for issues that could come
from bumping the major release version.
If things go as planned an RC2 on Tuesday or Wednesday and final release
on Friday is the schedule,
but please give it some testing it would be a shame to have 2.0.0
be a brown paper bag release ! :-)
Daniel
--
Daniel Veillard | Open Source and Standards, Red Hat
veillard(a)redhat.com | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | virtualization library http://libvirt.org/
8 years, 3 months
[libvirt] [PATCH] dist: Speed up distribution compression
by Martin Kletzander
This almost reverts b7200d723648. The size is increased from 11M to 13M
and the compression is sped up from 2 minutes to 17 seconds. The
compression level is removed because -9 doesn't allow multiple threads
to be spawned. Effectively speeds up distcheck as well.
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile.am b/Makefile.am
index 99ee4763c5cd..50c358c30d2c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -22,7 +22,7 @@ GENHTML = genhtml
SUBDIRS = . gnulib/lib include/libvirt src daemon tools docs gnulib/tests \
tests po examples
-XZ_OPT ?= -9ev
+XZ_OPT ?= -v -T0
export XZ_OPT
ACLOCAL_AMFLAGS = -I m4
--
2.9.0
8 years, 3 months
[libvirt] [PATCH 0/2] option to disable default gateway in IPv6 RA
by Maxim Perevedentsev
In case of DHCPv6 in isolated network, we start dnsmasq
which sends Router Advertisements (RA). If RA containts no gateway
then the link-local address of the source of RA is considered
a gateway (and guest installs a corresponding default route).
If a guest has two network interfaces (public and isolated network)
and the user installs a default route through "public" interface,
the guest will have something like
default via fe80::ffff:1:1 dev eth2 metric 1024
default via fe80::5054:ff:fe0a:d808 dev eth3 proto ra metric 1024 expires 1789sec
RA route metric may vary, and it is preferred.
The validity of default route is controlled by
"default [route] lifetime" field in RA. If it is 0, then
the default gateway announced is considered invalid,
and no default route is installed into guest.
dnsmasq 2.67+ supports "ra-param=<interface>,<RA interval>,<default lifetime>"
option. We can pass "ra-param=*,0,0" (here, RA_interval=0 means default)
to disable default gateway in RA.
This patchset adds <network ipv6noDefRoute="yes|no"> option
to network xml and sets the above option to dnsmasq config
if it is set to yes (default: no).
Maxim Perevedentsev (2):
dnsmasq: add option to disable IPv6 default gateway in RA
docs: add ipv6noDefRoute to schema and html.
docs/formatnetwork.html.in | 15 ++++++++++++++-
docs/schemas/network.rng | 5 +++++
src/conf/network_conf.c | 17 +++++++++++++++++
src/conf/network_conf.h | 3 +++
src/network/bridge_driver.c | 22 ++++++++++++++++++++++
src/util/virdnsmasq.h | 6 ++++++
6 files changed, 67 insertions(+), 1 deletion(-)
--
1.8.3.1
8 years, 3 months
[libvirt] [PATCH 0/2] Add support for preallocated memory
by Jaroslav Safka
This change introduces support for preallocated shared file descriptor based memory backing.
It allows vhost-user to be used without hugepages. This is achieved by introducing 3
new sub elements to the memoryBacking element: source, access & allocation
which will configure qemu commandline during VM startup accordingly
Jaroslav Safka (2):
Add new elements source,access and allocation
Add xml to argv for memorybacking access,source,..
docs/schemas/domaincommon.rng | 45 +++++++++++++++++
src/conf/domain_conf.c | 59 +++++++++++++++++++++-
src/conf/domain_conf.h | 31 ++++++++++++
src/qemu/qemu_command.c | 56 ++++++++++++++++++++
src/qemu/qemu_command.h | 4 ++
.../qemuxml2argv-memorybacking-set.args | 26 ++++++++++
.../qemuxml2argv-memorybacking-set.xml | 32 ++++++++++++
.../qemuxml2argv-memorybacking-unset.args | 22 ++++++++
.../qemuxml2argv-memorybacking-unset.xml | 32 ++++++++++++
tests/qemuxml2argvtest.c | 3 ++
.../qemuxml2xmlout-memorybacking-set.xml | 40 +++++++++++++++
.../qemuxml2xmlout-memorybacking-unset.xml | 40 +++++++++++++++
tests/qemuxml2xmltest.c | 3 ++
13 files changed, 392 insertions(+), 1 deletion(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-memorybacking-set.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-memorybacking-set.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-memorybacking-unset.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-memorybacking-unset.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-memorybacking-set.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-memorybacking-unset.xml
--
2.1.0
--------------------------------------------------------------
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare
Registered Number: 308263
This e-mail and any attachments may contain confidential material for the sole
use of the intended recipient(s). Any review or distribution by others is
strictly prohibited. If you are not the intended recipient, please contact the
sender and delete all copies.
8 years, 3 months