[libvirt] [PATCH] Add forwarders attribute to <dns /> element.
by Diego Woitasen
Useful to set custom forwarders instead of using the contents of
/etc/resolv.conf. It helps me to setup dnsmasq as local nameserver to resolv VM
domain names from domain 0, when domain option is used.
Signed-off-by: Diego Woitasen <diego.woitasen(a)vhgroup.net>
---
docs/formatnetwork.html.in | 8 ++++
docs/schemas/network.rng | 5 +++
src/conf/network_conf.c | 43 ++++++++++++++++++++--
src/conf/network_conf.h | 2 +
src/network/bridge_driver.c | 8 ++++
.../nat-network-dns-forwarders.conf | 16 ++++++++
.../nat-network-dns-forwarders.xml | 12 ++++++
tests/networkxml2conftest.c | 1 +
8 files changed, 92 insertions(+), 3 deletions(-)
create mode 100644 tests/networkxml2confdata/nat-network-dns-forwarders.conf
create mode 100644 tests/networkxml2confdata/nat-network-dns-forwarders.xml
diff --git a/docs/formatnetwork.html.in b/docs/formatnetwork.html.in
index e1482db..4dd809a 100644
--- a/docs/formatnetwork.html.in
+++ b/docs/formatnetwork.html.in
@@ -631,6 +631,8 @@
<domain name="example.com"/>
<dns>
<txt name="example" value="example value" />
+ <forwarders addr="8.8.8.8" />
+ <forwarders addr="8.8.4.4" />
<srv service='name' protocol='tcp' domain='test-domain-name' target='.' port='1024' priority='10' weight='10'/>
<host ip='192.168.122.2'>
<hostname>myhost</hostname>
@@ -685,6 +687,12 @@
Currently supported sub-elements of <code><dns></code> are:
<dl>
+ <dt><code>forwarders</code></dt>
+ <dd>A <code>dns</code> element can have 0 or more <code>forwarders</code> elements.
+ Each forwarders element defines an IP address to be used as forwarder
+ in DNS server configuration. The addr attribute is required and defines the
+ IP address of every forwarder. <span class="since">Since N/A</span>
+ </dd>
<dt><code>txt</code></dt>
<dd>A <code>dns</code> element can have 0 or more <code>txt</code> elements.
Each txt element defines a DNS TXT record and has two attributes, both
diff --git a/docs/schemas/network.rng b/docs/schemas/network.rng
index ab183f1..e0c2b51 100644
--- a/docs/schemas/network.rng
+++ b/docs/schemas/network.rng
@@ -217,6 +217,11 @@
</attribute>
</optional>
<zeroOrMore>
+ <element name="forwarders">
+ <attribute name="addr"><ref name="ipAddr"/></attribute>
+ </element>
+ </zeroOrMore>
+ <zeroOrMore>
<element name="txt">
<attribute name="name"><ref name="dnsName"/></attribute>
<attribute name="value"><text/></attribute>
diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c
index d54f2aa..1c1aa64 100644
--- a/src/conf/network_conf.c
+++ b/src/conf/network_conf.c
@@ -175,6 +175,11 @@ virNetworkDNSSrvDefClear(virNetworkDNSSrvDefPtr def)
static void
virNetworkDNSDefClear(virNetworkDNSDefPtr def)
{
+ if (def->forwarders) {
+ while (def->nfwds)
+ VIR_FREE(def->forwarders[--def->nfwds]);
+ VIR_FREE(def->forwarders);
+ }
if (def->txts) {
while (def->ntxts)
virNetworkDNSTxtDefClear(&def->txts[--def->ntxts]);
@@ -1037,8 +1042,9 @@ virNetworkDNSDefParseXML(const char *networkName,
xmlNodePtr *hostNodes = NULL;
xmlNodePtr *srvNodes = NULL;
xmlNodePtr *txtNodes = NULL;
+ xmlNodePtr *fwdNodes = NULL;
char *forwardPlainNames = NULL;
- int nhosts, nsrvs, ntxts;
+ int nfwds, nhosts, nsrvs, ntxts;
size_t i;
int ret = -1;
xmlNodePtr save = ctxt->node;
@@ -1058,6 +1064,30 @@ virNetworkDNSDefParseXML(const char *networkName,
}
}
+ nfwds = virXPathNodeSet("./forwarders", ctxt, &fwdNodes);
+ if (nfwds < 0) {
+ virReportError(VIR_ERR_XML_ERROR,
+ _("invalid <forwarders> element found in <dns> of network %s"),
+ networkName);
+ goto cleanup;
+ }
+ if (nfwds > 0) {
+ if (VIR_ALLOC_N(def->forwarders, nfwds) < 0)
+ goto cleanup;
+
+ for (i = 0; i < nfwds; i++) {
+ def->forwarders[i] = virXMLPropString(fwdNodes[i], "addr");
+ if (virSocketAddrParse(NULL, def->forwarders[i], AF_UNSPEC) < 0) {
+ virReportError(VIR_ERR_XML_ERROR,
+ _("Invalid forwarder IP address '%s' "
+ "in network '%s'"),
+ def->forwarders[i], networkName);
+ goto cleanup;
+ }
+ def->nfwds++;
+ }
+ }
+
nhosts = virXPathNodeSet("./host", ctxt, &hostNodes);
if (nhosts < 0) {
virReportError(VIR_ERR_XML_ERROR,
@@ -1121,6 +1151,7 @@ virNetworkDNSDefParseXML(const char *networkName,
ret = 0;
cleanup:
VIR_FREE(forwardPlainNames);
+ VIR_FREE(fwdNodes);
VIR_FREE(hostNodes);
VIR_FREE(srvNodes);
VIR_FREE(txtNodes);
@@ -2267,13 +2298,14 @@ virNetworkDNSDefFormat(virBufferPtr buf,
int result = 0;
size_t i, j;
- if (!(def->forwardPlainNames || def->nhosts || def->nsrvs || def->ntxts))
+ if (!(def->forwardPlainNames || def->forwarders || def->nhosts ||
+ def->nsrvs || def->ntxts))
goto out;
virBufferAddLit(buf, "<dns");
if (def->forwardPlainNames) {
virBufferAddLit(buf, " forwardPlainNames='yes'");
- if (!(def->nhosts || def->nsrvs || def->ntxts)) {
+ if (!(def->forwarders || def->nhosts || def->nsrvs || def->ntxts)) {
virBufferAddLit(buf, "/>\n");
goto out;
}
@@ -2282,6 +2314,11 @@ virNetworkDNSDefFormat(virBufferPtr buf,
virBufferAddLit(buf, ">\n");
virBufferAdjustIndent(buf, 2);
+ for (i = 0; i < def->nfwds; i++) {
+ virBufferAsprintf(buf, "<forwarders addr='%s' />\n",
+ def->forwarders[i]);
+ }
+
for (i = 0; i < def->ntxts; i++) {
virBufferAsprintf(buf, "<txt name='%s' value='%s'/>\n",
def->txts[i].name,
diff --git a/src/conf/network_conf.h b/src/conf/network_conf.h
index c28bfae..b425986 100644
--- a/src/conf/network_conf.h
+++ b/src/conf/network_conf.h
@@ -122,6 +122,8 @@ struct _virNetworkDNSDef {
virNetworkDNSHostDefPtr hosts;
size_t nsrvs;
virNetworkDNSSrvDefPtr srvs;
+ size_t nfwds;
+ char **forwarders;
};
typedef struct _virNetworkIpDef virNetworkIpDef;
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 3a8be90..a2cfb35 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -708,6 +708,14 @@ networkDnsmasqConfContents(virNetworkObjPtr network,
if (!network->def->dns.forwardPlainNames)
virBufferAddLit(&configbuf, "domain-needed\n");
+ if (network->def->dns.forwarders) {
+ virBufferAddLit(&configbuf, "no-resolv\n");
+ for (i=0; i < network->def->dns.nfwds; i++) {
+ virBufferAsprintf(&configbuf, "server=%s\n",
+ network->def->dns.forwarders[i]);
+ }
+ }
+
if (network->def->domain) {
virBufferAsprintf(&configbuf,
"domain=%s\n"
diff --git a/tests/networkxml2confdata/nat-network-dns-forwarders.conf b/tests/networkxml2confdata/nat-network-dns-forwarders.conf
new file mode 100644
index 0000000..ebca289
--- /dev/null
+++ b/tests/networkxml2confdata/nat-network-dns-forwarders.conf
@@ -0,0 +1,16 @@
+##WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
+##OVERWRITTEN AND LOST. Changes to this configuration should be made using:
+## virsh net-edit default
+## or other application using the libvirt API.
+##
+## dnsmasq conf file created by libvirt
+strict-order
+domain-needed
+no-resolv
+server=8.8.8.8
+server=8.8.4.4
+local=//
+except-interface=lo
+bind-dynamic
+interface=virbr0
+addn-hosts=/var/lib/libvirt/dnsmasq/default.addnhosts
diff --git a/tests/networkxml2confdata/nat-network-dns-forwarders.xml b/tests/networkxml2confdata/nat-network-dns-forwarders.xml
new file mode 100644
index 0000000..9cd2667
--- /dev/null
+++ b/tests/networkxml2confdata/nat-network-dns-forwarders.xml
@@ -0,0 +1,12 @@
+<network>
+ <name>default</name>
+ <uuid>81ff0d90-c91e-6742-64da-4a736edb9a9c</uuid>
+ <forward dev='eth0' mode='nat'/>
+ <bridge name='virbr0' stp='on' delay='0' />
+ <dns>
+ <forwarders addr='8.8.8.8' />
+ <forwarders addr='8.8.4.4' />
+ </dns>
+ <ip address='192.168.122.1' netmask='255.255.255.0'>
+ </ip>
+</network>
diff --git a/tests/networkxml2conftest.c b/tests/networkxml2conftest.c
index 5825af3..ad50e88 100644
--- a/tests/networkxml2conftest.c
+++ b/tests/networkxml2conftest.c
@@ -145,6 +145,7 @@ mymain(void)
DO_TEST("nat-network-dns-srv-record", full);
DO_TEST("nat-network-dns-hosts", full);
DO_TEST("nat-network-dns-forward-plain", full);
+ DO_TEST("nat-network-dns-forwarders", full);
DO_TEST("dhcp6-network", dhcpv6);
DO_TEST("dhcp6-nat-network", dhcpv6);
DO_TEST("dhcp6host-routed-network", dhcpv6);
--
1.8.1.2
11 years, 2 months
[libvirt] [PATCHv2 0/2] Support setting the 'removable' flag for USB disks
by Fred A. Kemp
From: "Fred A. Kemp" <anonym(a)riseup.net>
The commit message of patch #2 explains the purpose of this patch set.
A review would be greatly appreciated!
Note that I've only added the new capability for usb-storage.removable
to the qemu help tests of qemu(-kvm) version 1.2.0, since that's what I
had easily available to get the output of `-device usb-storage,?` from.
I hope that's not an issue, otherwise, is there a way to obtain these
outputs without having to hunt down and install all supported versions?
Previous submissions of this patch set to this list:
http://www.redhat.com/archives/libvir-list/2013-March/msg01051.html
http://www.redhat.com/archives/libvir-list/2013-May/msg02039.html
https://www.redhat.com/archives/libvir-list/2013-July/msg01635.html
https://www.redhat.com/archives/libvir-list/2013-August/msg00581.html
Fred A. Kemp (2):
qemu: Add capability flag for usb-storage
qemu: Support setting the 'removable' flag for USB disks
docs/formatdomain.html.in | 8 +++--
docs/schemas/domaincommon.rng | 8 +++++
src/conf/domain_conf.c | 31 ++++++++++++++++++--
src/conf/domain_conf.h | 1 +
src/qemu/qemu_capabilities.c | 10 +++++++
src/qemu/qemu_capabilities.h | 2 ++
src/qemu/qemu_command.c | 24 +++++++++++++++
tests/qemuhelpdata/qemu-1.2.0-device | 11 +++++++
tests/qemuhelpdata/qemu-kvm-1.2.0-device | 11 +++++++
tests/qemuhelptest.c | 20 +++++++++----
.../qemuxml2argv-disk-usb-device-removable.args | 8 +++++
.../qemuxml2argv-disk-usb-device-removable.xml | 27 +++++++++++++++++
tests/qemuxml2argvtest.c | 6 +++-
13 files changed, 155 insertions(+), 12 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-usb-device-removable.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-usb-device-removable.xml
--
1.7.10.4
11 years, 2 months
[libvirt] [PATCH 2/2] Pass AM_LDFLAGS to driver modules too
by Guido Günther
This gives us a RO got, otherwise Debian's lintian complains:
W: libvirt-bin: hardening-no-relro usr/lib/libvirt/connection-driver/libvirt_driver_qemu.so
W: libvirt-bin: hardening-no-relro usr/lib/libvirt/connection-driver/libvirt_driver_storage.so
W: libvirt-bin: hardening-no-relro usr/lib/libvirt/connection-driver/libvirt_driver_uml.so
W: libvirt-bin: hardening-no-relro usr/lib/libvirt/connection-driver/libvirt_driver_vbox.so
W: libvirt-bin: hardening-no-relro usr/lib/libvirt/connection-driver/libvirt_driver_xen.so
W: libvirt-bin: hardening-no-relro usr/lib/libvirt/connection-driver/libvirt_driver_nwfilter.so
W: libvirt-bin: hardening-no-relro usr/lib/libvirt/connection-driver/libvirt_driver_storage.so
W: libvirt-bin: hardening-no-relro usr/lib/libvirt/connection-driver/libvirt_driver_uml.so
W: libvirt-sanlock: hardening-no-relro usr/lib/libvirt/lock-driver/sanlock.so
---
src/Makefile.am | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index 19dfb81..097682c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1000,7 +1000,7 @@ libvirt_driver_xen_la_LIBADD = libvirt_driver_xen_impl.la
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_xen.la
libvirt_driver_xen_la_LIBADD += ../gnulib/lib/libgnu.la
-libvirt_driver_xen_la_LDFLAGS = -module -avoid-version
+libvirt_driver_xen_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
else
noinst_LTLIBRARIES += libvirt_driver_xen.la
# Stateful, so linked to daemon instead
@@ -1050,7 +1050,7 @@ libvirt_driver_vbox_la_LIBADD = libvirt_driver_vbox_impl.la
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_vbox.la
libvirt_driver_vbox_la_LIBADD += ../gnulib/lib/libgnu.la
-libvirt_driver_vbox_la_LDFLAGS = -module -avoid-version
+libvirt_driver_vbox_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
else
noinst_LTLIBRARIES += libvirt_driver_vbox.la
# GPLv2-only license requries that it be linked into
@@ -1083,7 +1083,7 @@ libvirt_driver_libxl_la_LIBADD = libvirt_driver_libxl_impl.la
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_libxl.la
libvirt_driver_libxl_la_LIBADD += ../gnulib/lib/libgnu.la
-libvirt_driver_libxl_la_LDFLAGS = -module -avoid-version
+libvirt_driver_libxl_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
else
noinst_LTLIBRARIES += libvirt_driver_libxl.la
# Stateful, so linked to daemon instead
@@ -1108,7 +1108,7 @@ libvirt_driver_qemu_la_LIBADD = libvirt_driver_qemu_impl.la
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_qemu.la
libvirt_driver_qemu_la_LIBADD += ../gnulib/lib/libgnu.la
-libvirt_driver_qemu_la_LDFLAGS = -module -avoid-version
+libvirt_driver_qemu_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
else
noinst_LTLIBRARIES += libvirt_driver_qemu.la
# Stateful, so linked to daemon instead
@@ -1184,7 +1184,7 @@ libvirt_driver_uml_la_LIBADD = libvirt_driver_uml_impl.la
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_uml.la
libvirt_driver_uml_la_LIBADD += ../gnulib/lib/libgnu.la
-libvirt_driver_uml_la_LDFLAGS = -module -avoid-version
+libvirt_driver_uml_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
else
noinst_LTLIBRARIES += libvirt_driver_uml.la
# Stateful, so linked to daemon instead
@@ -1361,7 +1361,7 @@ libvirt_driver_storage_la_LIBADD = libvirt_driver_storage_impl.la
if WITH_DRIVER_MODULES
mod_LTLIBRARIES += libvirt_driver_storage.la
libvirt_driver_storage_la_LIBADD += ../gnulib/lib/libgnu.la
-libvirt_driver_storage_la_LDFLAGS = -module -avoid-version
+libvirt_driver_storage_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
else
noinst_LTLIBRARIES += libvirt_driver_storage.la
# Stateful, so linked to daemon instead
@@ -2114,7 +2114,7 @@ if WITH_SANLOCK
lockdriver_LTLIBRARIES += sanlock.la
sanlock_la_SOURCES = $(LOCK_DRIVER_SANLOCK_SOURCES)
sanlock_la_CFLAGS = -I$(top_srcdir)/src/conf $(AM_CFLAGS)
-sanlock_la_LDFLAGS = -module -avoid-version
+sanlock_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
sanlock_la_LIBADD = -lsanlock_client \
../gnulib/lib/libgnu.la
--
1.8.4.rc3
11 years, 2 months
[libvirt] [PATCH 1/3] CPU: Implement guestData for PPC CPU driver
by Li Zhang
From: Li Zhang <zhlcindy(a)linux.vnet.ibm.com>
On Power platform, Power7+ can support Power7 guest.
It needs to define XML configuration to specify guest's CPU model.
For exmaple:
<cpu match='exact'>
<model>POWER7+_v2.1</model>
<vendor>IBM</vendor>
</cpu>
Signed-off-by: Li Zhang <zhlcindy(a)linux.vnet.ibm.com>
---
src/cpu/cpu_powerpc.c | 166 +++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 164 insertions(+), 2 deletions(-)
diff --git a/src/cpu/cpu_powerpc.c b/src/cpu/cpu_powerpc.c
index 647a8a1..84fa3f7 100644
--- a/src/cpu/cpu_powerpc.c
+++ b/src/cpu/cpu_powerpc.c
@@ -99,6 +99,23 @@ ppcModelFindPVR(const struct ppc_map *map,
return NULL;
}
+static struct ppc_model *
+ppcModelCopy(const struct ppc_model *model)
+{
+ struct ppc_model *copy;
+
+ if (VIR_ALLOC(copy) < 0 ||
+ VIR_STRDUP(copy->name, model->name) < 0) {
+ ppcModelFree(copy);
+ return NULL;
+ }
+
+ copy->data.pvr = model->data.pvr;
+ copy->vendor = model->vendor;
+
+ return copy;
+}
+
static struct ppc_vendor *
ppcVendorFind(const struct ppc_map *map,
const char *name)
@@ -126,6 +143,29 @@ ppcVendorFree(struct ppc_vendor *vendor)
VIR_FREE(vendor);
}
+static struct ppc_model *
+ppcModelFromCPU(const virCPUDefPtr cpu,
+ const struct ppc_map *map)
+{
+ struct ppc_model *model = NULL;
+
+ if ((model = ppcModelFind(map, cpu->model)) == NULL) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unknown CPU model %s"), cpu->model);
+ goto error;
+ }
+
+ if ((model = ppcModelCopy(model)) == NULL)
+ goto error;
+
+ return model;
+
+error:
+ ppcModelFree(model);
+ return NULL;
+}
+
+
static int
ppcVendorLoad(xmlXPathContextPtr ctxt,
struct ppc_map *map)
@@ -288,6 +328,112 @@ error:
return NULL;
}
+static virCPUDataPtr
+ppcMakeCPUData(virArch arch, struct cpuPPCData *data)
+{
+ virCPUDataPtr cpuData;
+
+ if (VIR_ALLOC(cpuData) < 0)
+ return NULL;
+
+ cpuData->arch = arch;
+ cpuData->data.ppc = *data;
+ data = NULL;
+
+ return cpuData;
+}
+
+static virCPUCompareResult
+ppcCompute(virCPUDefPtr host,
+ const virCPUDefPtr cpu,
+ virCPUDataPtr *guestData,
+ char **message)
+
+{
+ struct ppc_map *map = NULL;
+ struct ppc_model *host_model = NULL;
+ struct ppc_model *guest_model = NULL;
+
+ int ret = 0;
+ virArch arch;
+ size_t i;
+
+ if (cpu->arch != VIR_ARCH_NONE) {
+ bool found = false;
+
+ for (i = 0; i < ARRAY_CARDINALITY(archs); i++) {
+ if (archs[i] == cpu->arch) {
+ found = true;
+ break;
+ }
+ }
+
+ if (!found) {
+ VIR_DEBUG("CPU arch %s does not match host arch",
+ virArchToString(cpu->arch));
+ if (message &&
+ virAsprintf(message,
+ _("CPU arch %s does not match host arch"),
+ virArchToString(cpu->arch)) < 0)
+ goto error;
+ return VIR_CPU_COMPARE_INCOMPATIBLE;
+ }
+ arch = cpu->arch;
+ } else {
+ arch = host->arch;
+ }
+
+ if (cpu->vendor &&
+ (!host->vendor || STRNEQ(cpu->vendor, host->vendor))) {
+ VIR_DEBUG("host CPU vendor does not match required CPU vendor %s",
+ cpu->vendor);
+ if (message &&
+ virAsprintf(message,
+ _("host CPU vendor does not match required "
+ "CPU vendor %s"),
+ cpu->vendor) < 0)
+ goto error;
+ return VIR_CPU_COMPARE_INCOMPATIBLE;
+ }
+
+ if (!(map = ppcLoadMap()) ||
+ !(host_model = ppcModelFromCPU(host, map)) ||
+ !(guest_model = ppcModelFromCPU(cpu, map)))
+ goto error;
+
+ if (guestData != NULL) {
+ if (cpu->type == VIR_CPU_TYPE_GUEST &&
+ cpu->match == VIR_CPU_MATCH_STRICT &&
+ STRNEQ(guest_model->name, host_model->name)) {
+ VIR_DEBUG("host CPU model does not match required CPU model %s",
+ guest_model->name);
+ if (message &&
+ virAsprintf(message,
+ _("host CPU model does not match required "
+ "CPU model %s"),
+ guest_model->name) < 0)
+ goto error;
+ return VIR_CPU_COMPARE_INCOMPATIBLE;
+ }
+
+ if (!(*guestData = ppcMakeCPUData(arch, &guest_model->data)))
+ goto error;
+ }
+
+ ret = VIR_CPU_COMPARE_IDENTICAL;
+
+out:
+ ppcMapFree(map);
+ ppcModelFree(host_model);
+ ppcModelFree(guest_model);
+ return ret;
+
+error:
+ ret = VIR_CPU_COMPARE_ERROR;
+ goto out;
+
+}
+
static virCPUCompareResult
ppcCompare(virCPUDefPtr host,
virCPUDefPtr cpu)
@@ -369,6 +515,15 @@ ppcNodeData(void)
}
#endif
+static virCPUCompareResult
+ppcGuestData(virCPUDefPtr host,
+ virCPUDefPtr guest,
+ virCPUDataPtr *data,
+ char **message)
+{
+ return ppcCompute(host, guest, data, message);
+}
+
static int
ppcUpdate(virCPUDefPtr guest ATTRIBUTE_UNUSED,
const virCPUDefPtr host ATTRIBUTE_UNUSED)
@@ -466,6 +621,13 @@ error:
goto cleanup;
}
+static int
+ppcHasFeature(const virCPUDataPtr data ATTRIBUTE_UNUSED,
+ const char *name ATTRIBUTE_UNUSED)
+{
+ return 0;
+}
+
struct cpuArchDriver cpuDriverPowerPC = {
.name = "ppc64",
.arch = archs,
@@ -479,8 +641,8 @@ struct cpuArchDriver cpuDriverPowerPC = {
#else
.nodeData = NULL,
#endif
- .guestData = NULL,
+ .guestData = ppcGuestData,
.baseline = ppcBaseline,
.update = ppcUpdate,
- .hasFeature = NULL,
+ .hasFeature = ppcHasFeature,
};
--
1.8.1.4
11 years, 2 months
[libvirt] Release of libvirt-1.1.2
by Daniel Veillard
As scheduled I have pushed the tarballs and rpms of the new release at
the usual place:
ftp://libvirt.org/libvirt/
This is a medium sized release with less than 300 commits, with a
inclination toward code improvements and bugs fixes, in particular
fixes for 4 CVEs. It may be a good idea to upgrade !
Features:
- various improvements to libxl driver (Jim Fehlig, Bamvor Jian Zhang)
- systemd integration improvements (Daniel P. Berrange, Mooli Tayer)
- Add flag to BaselineCPU API to return detailed CPU features (Don Dugger)
- Introduce a virt-login-shell binary (Dan Walsh)
- conf: add startupPolicy attribute for harddisk (Guannan Ren)
Security:
- provide supplemental groups even when parsing label (CVE-2013-4291) (Eric Blake)
- Add bounds checking on virDomainMigrate*Params RPC calls (CVE-2013-4292) (Daniel P. Berrange)
- CVE-2013-5651 virbitmap: Refactor virBitmapParse to avoid access beyond bounds of array (Peter Krempa)
- CVE-2013-4239 xen: fix memory corruption in legacy driver (Jim Fehlig)
Documentation:
- Reformat <disk> attribute description in formatdomain (John Ferlan)
- Update iSCSI storage pool example (John Ferlan)
- Update formatsecrets to include more examples of each type (John Ferlan)
- Update the formatdomain disk examples (John Ferlan)
- Clean 09adfdc62de2b up (Michal Privoznik)
- virt-pki-validate: add --help/--version option (Eric Blake)
- virt-xml-validate: add --help/--version option (Eric Blake)
- Discourage users to set hard_limit (Michal Privoznik)
- Update polkit examples to use 'lookup' method (Daniel P. Berrange)
- fix usb node device sub-element names (Xuesong Zhang)
- virt-login-shell: improve error message grammar (Ruben Kerkhof)
- storage pool permission copy-paste fix (Philipp Hahn)
- mention VIR_TEST_RANGE (Eric Blake)
- Document use of systemd socket activation (Daniel P. Berrange)
- Remove leftovers from hyperv spinlocks documentation (Ján Tomko)
- Fix typo in domain name in polkit acl example (Daniel P. Berrange)
- Add documentation for access control system (Daniel P. Berrange)
- Add an example config file for virtlockd (Daniel P. Berrange)
- Add a man page for virtlockd daemon (Daniel P. Berrange)
- Add info about access control checks into API reference (Daniel P. Berrange)
- Fix minor typos in messages and docs (Yuri Chornoivan)
Portability:
- build: fix virtlockd file distribution (Eric Blake)
- build: shipped files must not depend on BUILT_SOURCES (Eric Blake)
- build: only create virt-login-shell for lxc builds (Eric Blake)
- qemu: Only setup vhost if virtType == "kvm" (Cole Robinson)
- Process virtlockd.conf instead of libvirtd.conf (Guido Günther)
- Change way we fake dbus method calls (Daniel P. Berrange)
- random: don't mix RAND_MAX with random_r (Eric Blake)
- tests: skip schema validation tests if xmllint is missing (Eric Blake)
- Check for --no-copy-dt-needed linker flag (Guido Günther)
- Simplify RELRO_LDFLAGS (Guido Günther)
- tests: fix building without xattr support (Claudio Bley)
- nwfilter: Don't fail to start if DBus isn't available (Peter Krempa)
- virsystemd: Don't fail to start VM if DBus isn't available or compiled in (Peter Krempa)
- tools: Make sure to distribute conf_DATA, fix RPM build (Cole Robinson)
- Directly link against needed libraries (Guido Günther)
- Directly link against needed libraries (Guido Günther)
- build: avoid -lgcrypt with newer gnutls (Eric Blake)
- build: more workarounds for if_bridge.h (Eric Blake)
- tests: avoid too-large constants (Eric Blake)
- tests: work with older dbus (Eric Blake)
- build: fix compilation of virt-login-shell.c (Jim Fehlig)
- maint: the compiler is not always named gcc (Eric Blake)
- build: fix qemuagenttest build with -O0 in fedora 19. (Jincheng Miao)
- spec: RHEL-7 does not have sanlock on i686 (Jiri Denemark)
- spec: Disable libssh2 support for RHEL (Peter Krempa)
Bug Fixes:
- qemu_hotplug: Resolve DEADCODE coverity error (John Ferlan)
- Fix memory leak in cmdAttachDisk (Hongwei Bi)
- python: Fix a PyList usage mistake (Guan Qiang)
- qemu: Remove hostdev entry when freeing the depending network entry (Peter Krempa)
- virsh: detect programming errors with option parsing (Eric Blake)
- virt-sanlock-cleanup; Fix augtool usage (Jiri Denemark)
- virsh: Fix debugging (Martin Kletzander)
- virsh: free the caps list properly if one of them is invalid (Ján Tomko)
- virsh: free the formatting string when listing pool details (Ján Tomko)
- virsh: free the list from ListAll APIs even for 0 items (Ján Tomko)
- virsh: free messages after logging them to a file (Ján Tomko)
- Test network update XML parsing (Ján Tomko)
- Always specify qcow2 compat level on qemu-img command line (Ján Tomko)
- virsh: fix return value error of cpu-stats (Guannan Ren)
- Don't free NULL network in cmdNetworkUpdate (Ján Tomko)
- schema: Allow dots in device aliases (Jiri Denemark)
- qemu: Don't update count of vCPUs if hot-plug fails silently (Peter Krempa)
- tests: Add URI precedence checking (Martin Kletzander)
- Fix URI connect precedence (Martin Kletzander)
- libxl: fix libvirtd crash when reconnecting domains (Jim Fehlig)
- migration: do not restore labels on failed migration (Eric Blake)
- storage: Fix the use-after-free memory bug (Osier Yang)
- storage: Fix coverity warning (Osier Yang)
- qemu_conf: Fix broken logic for adding passthrough iscsi lun (Osier Yang)
- libxl: Resolve possible NULL dereference (John Ferlan)
- virsh: Don't leak list of volumes when undefining domain with storage (Peter Krempa)
- virbitmaptest: Shut coverity up in case of broken test (Peter Krempa)
- storage: Update pool metadata after adding/removing/resizing volume (Osier Yang)
- virbitmaptest: Add test for out of bounds condition (Peter Krempa)
- virsh-domain: Fix memleak in cmdCPUBaseline (Peter Krempa)
- libxl: unref DomainObjPrivate on error path (Jim Fehlig)
- virsh-domain: Fix memleak in cmdUndefine with storage (Peter Krempa)
- Fix qemuProcessReadLog with non-zero offset (Ján Tomko)
- network: permit upstream forwarding of unqualified DNS names (Laine Stump)
- virsh-domain: Flip logic in cmdSetvcpus (Peter Krempa)
- Don't crash in qemuBuildDeviceAddressStr (Guido Günther)
- libxl: fix libvirtd segfault (Jim Fehlig)
- Make check for /dev/loop device names stricter to avoid /dev/loop-control (Daniel P. Berrange)
- libxl: fix node ranges in libxlNodeGetCellsFreeMemory() (Dario Faggioli)
- Fix double-free and broken logic in virt-login-shell (Daniel P. Berrange)
- virnettlscontext: Resolve Coverity warnings (UNINIT) (John Ferlan)
- remote: Fix a segfault in remoteDomainCreateWithFlags (Alex Jia)
- qemu: Allow hotplug of multiple SCSI devices (Eric Farman)
- Fix validation of CA certificate chains (Daniel P. Berrange)
- Reverse logic allowing partial DHCP host XML (Ján Tomko)
- xen: Use internal interfaces in xenDomainUsedCpus (Stefan Bader)
- qemu_migration: Don't error on tunelled migration with --copy-storage (Michal Privoznik)
- build: fix missing max_queued_clients in augeas test file for libvirtd.conf (Laine Stump)
- Fix crashing upgrading from older libvirts with running guests (Daniel P. Berrange)
- Avoid crash if NULL is passed for filename/funcname in logging (Daniel P. Berrange)
- qemumonitortestutils: Don't skip va_end() on error path (Peter Krempa)
- tests: Coverity found new NULL_RETURNS (John Ferlan)
- Configuring systemd to restart libvirt on failure (Mooli Tayer)
- xen: Avoid double free of virDomainDef in xenDaemonCreateXML (Stefan Bader)
Improvements:
- build: fix 'make distcheck' out of the box (Eric Blake)
- virsh-domain: rename print_job_progress to vshPrintJobProgress (Peter Krempa)
- Prohibit unbounded arrays in XDR protocols (Daniel P. Berrange)
- Add bounds checking on virConnectListAllSecrets RPC call (Daniel P. Berrange)
- Add bounds checking on virConnectListAllNWFilters RPC call (Daniel P. Berrange)
- Add bounds checking on virConnectListAllNodeDevices RPC call (Daniel P. Berrange)
- Add bounds checking on virConnectListAllInterfaces RPC call (Daniel P. Berrange)
- Add bounds checking on virConnectListAllNetworks RPC call (Daniel P. Berrange)
- Add bounds checking on virStoragePoolListAllVolumes RPC call (Daniel P. Berrange)
- Add bounds checking on virConnectListAllStoragePools RPC call (Daniel P. Berrange)
- Add bounds checking on virConnectListAllDomains RPC call (Daniel P. Berrange)
- Add bounds checking on virDomain{SnapshotListAllChildren,ListAllSnapshots} RPC calls (Daniel P. Berrange)
- Add bounds checking on virDomainGetJobStats RPC call (Daniel P. Berrange)
- autogen.sh: Correctly detect .git as a file (Michal Privoznik)
- bridge_driver: Introduce networkObjFromNetwork (Michal Privoznik)
- virsh-pool.c: Don't jump over variable declaration (Michal Privoznik)
- Remove the space before the slash in network XML (Ján Tomko)
- Build QEMU command line for pcihole64 (Ján Tomko)
- Add pcihole64 element to root PCI controllers (Ján Tomko)
- Allow controller XML parsing to use XPath context (Ján Tomko)
- Move virDomainParseScaledValue earlier (Ján Tomko)
- Add ftp protocol support for cdrom disk (Aline Manera)
- Add http protocol support for cdrom disk (Aline Manera)
- virsh: C99 style for info_domfstrim and opts_lxc_enter_namespace (Tomas Meszaros)
- qemuDomainAttachHostPciDevice: Fall back to mem balloon if there's no hard_limit (Michal Privoznik)
- qemuhotplugtest: Add tests for virtio SCSI disk hotplug (Jiri Denemark)
- qemuhotplugtest: Add tests for USB disk hotplug (Jiri Denemark)
- qemuhotplugtest: Add tests for async virtio disk detach (Jiri Denemark)
- qemuhotplugtest: Add support for DEVICE_DELETED event (Jiri Denemark)
- qemu: Let tests override waiting time for device unplug (Jiri Denemark)
- qemu: Export qemuProcessHandleDeviceDeleted for tests (Jiri Denemark)
- tests: Add support for passing driver to qemu monitor (Jiri Denemark)
- tests: Add support for passing vm to qemu monitor (Jiri Denemark)
- qemuhotplugtest: Add tests for virtio disk hotplug (Jiri Denemark)
- qemuxml2argvtest: Add XML for testing device hotplug (Jiri Denemark)
- qemuhotplugtest: Define QMP_OK for the most common reply (Jiri Denemark)
- qemuhotplugtest: Compare domain XML after device hotplug (Jiri Denemark)
- qemuhotplugtest: Generate better output (Jiri Denemark)
- qemu: Move qemuDomainDetachDeviceDiskLive to qemu_hotplug.c (Jiri Denemark)
- qemu: Move qemuDomainAttachDeviceDiskLive to qemu_hotplug.c (Jiri Denemark)
- qemu: Avoid using global qemu_driver in event handlers (Jiri Denemark)
- qemu: Typedef monitor callbacks (Jiri Denemark)
- python: simplify complicated conditional assignment (Claudio Bley)
- Test for object identity when checking for None in Python (Claudio Bley)
- qemuagenttest.c: Missing documentation (Timeout) (Nehal J Wani)
- python: Use RELRO_LDFLAGS and NO_INDIRECT_LDFLAGS (Guido Günther)
- Set security label on FD for virDomainOpenGraphics (Daniel P. Berrange)
- qemuBuildNicDevStr: Add mq=on for multiqueue networking (Michal Privoznik)
- virBitmapParse: Fix behavior in case of error and fix up callers (Peter Krempa)
- VMX: Improve disk parse error for unknown values (Doug Goldstein)
- bridge driver: implement networkEnableIpForwarding for BSD (Roman Bogorodskiy)
- BSD: implement virNetDev(Set|Clear)IPv4Address (Roman Bogorodskiy)
- Test handling of non-existent x509 certs (Daniel P. Berrange)
- Report secret usage error message similarly (John Ferlan)
- virsh: Print cephx and iscsi usage (John Ferlan)
- selinux: enhance test to cover nfs label failure (Eric Blake)
- selinux: distinguish failure to label from request to avoid label (Eric Blake)
- virsh-pool: Improve error message in cmdPoolList (Peter Krempa)
- virsh: modify vshStringToArray to duplicate the elements too (Peter Krempa)
- qemuBuildCommandLine: Fall back to mem balloon if there's no hard_limit (Michal Privoznik)
- qemuSetupMemoryCgroup: Handle hard_limit properly (Michal Privoznik)
- virt-xml-validate: add missing schemas (Eric Blake)
- libxl: implement NUMA capabilities reporting (Jim Fehlig)
- virdbus: Add virDBusHasSystemBus() (Peter Krempa)
- Make max_clients in virtlockd configurable (David Weber)
- snapshot_conf: Allow parsing an XML node (Cole Robinson)
- test: Unify object XML parsing (Cole Robinson)
- test: Simplify args passed to testDomainStartState (Cole Robinson)
- test: Split object parsing into their own functions (Cole Robinson)
- maint: slightly reduce configure size (Eric Blake)
- libxl: refactor capabilities code (Jim Fehlig)
- virbitmaptest: Fix function header formatting (Peter Krempa)
- maint: update gnulib submodule (Eric Blake)
- maint: fix typo for 'switch' (Eric Blake)
- examples: support crash events in event-test.py (Giuseppe Scrivano)
- cpu: Add Power7+ and Power8 CPU definition in map.xml (Li Zhang)
- Ensure that /dev exists in the container root filesystem (Daniel P. Berrange)
- Properly handle -h / -V for --help/--version aliases in virtlockd/libvirtd (Daniel P. Berrange)
- Address missed feedback from review of virt-login-shell (Daniel P. Berrange)
- Honour root prefix in lxcContainerMountFSBlockAuto (Daniel P. Berrange)
- tests: Fix parallel runs of TLS test suites (Martin Kletzander)
- cgroup macros refactoring, part 5 (Roman Bogorodskiy)
- cgroup macros refactoring, part 4 (Roman Bogorodskiy)
- cgroup macros refactoring, part 3 (Roman Bogorodskiy)
- cgroup macros refactoring, part 2 (Roman Bogorodskiy)
- cgroup macros refactoring, part 1 (Roman Bogorodskiy)
- cgroup: functional sort (Eric Blake)
- cgroup: topological sort (Eric Blake)
- cgroup: use consistent formatting (Eric Blake)
- Add missing ATTRIBUTE_UNUSED (Guido Günther)
- virsh: nicer abort of blockcopy (Eric Blake)
- tests: Skip virsh-all test as expensive (Peter Krempa)
- qemuagenttest: Test timeout of agent commands (Peter Krempa)
- tests: add helper to determine when to skip expensive tests (Eric Blake)
- build: add configure option to disable gnulib tests (Eric Blake)
- qemuagenttest: Test arbitrary command passthrough (Peter Krempa)
- Record the where the auto-generated data comes from (Daniel P. Berrange)
- tests: test negative number through dbus (Eric Blake)
- libxl: Create per-domain log file (Jim Fehlig)
- Fix parallel runs of TLS test suites (Daniel P. Berrange)
- configure: fix formatting of missing pkg-config modules error (Giuseppe Scrivano)
- Ensure securityfs is mounted readonly in container (Dan Walsh)
- Change data passed into TLS test cases (Daniel P. Berrange)
- Avoid re-generating certs every time (Daniel P. Berrange)
- Split TLS test into two separate tests (Daniel P. Berrange)
- maint: avoid C99 loop declaration (Eric Blake)
- qemu: support to drop disk with 'optional' startupPolicy (Guannan Ren)
- nwfilter: Use -m conntrack rather than -m state (Stefan Berger)
- virGetGroupList: always include the primary group (Guido Günther)
- qemu: improve error reporting during PCI address validation (Laine Stump)
- qemu: enable using implicit sata controller in q35 machines (Laine Stump)
- qemu: properly set/use device alias for pci controllers (Laine Stump)
- qemu: fix handling of default/implicit devices for q35 (Laine Stump)
- qemu: add dmi-to-pci-bridge controller (Laine Stump)
- qemu: add pcie-root controller (Laine Stump)
- qemu: enable auto-allocate of all PCI addresses (Laine Stump)
- Introduce max_queued_clients (Michal Privoznik)
- RPC: Don't accept client if it would overcommit max_clients (Michal Privoznik)
- qemu: eliminate almost-duplicate code in qemu_command.c (Laine Stump)
- qemu: rename some functions in qemu_command.c (Laine Stump)
- conf: add default USB controller in qemu post-parse callback (Laine Stump)
- spec: Explicitly claim ownership of channel subdir (Jiri Denemark)
- Ensure LXC/QEMU APIs set the filename for errors (Daniel P. Berrange)
- Remove reference to python/tests from RPM %doc (Daniel P. Berrange)
- qemuagenttest: Check invalid response in shutdown test (Peter Krempa)
- qemuagenttest: Fix checking of shutdown mode (Peter Krempa)
- bridge driver: extract platform specifics (Roman Bogorodskiy)
- valgrind: Adjust filter for _dl_allocate_tls (John Ferlan)
- maint: use modern autoconf idioms (Eric Blake)
- qemu: check presence of each disk and its backing file as well (Guannan Ren)
- qemu: add helper functions for diskchain checking (Guannan Ren)
- qemu: refactor qemuDomainCheckDiskPresence for only disk presence check (Guannan Ren)
- Enable support for systemd-machined in cgroups creation (Daniel P. Berrange)
- Cope with races while killing processes (Daniel P. Berrange)
- Add support for systemd cgroup mount (Daniel P. Berrange)
- Add APIs for formatting systemd slice/scope names (Daniel P. Berrange)
- qemuagenttest: Add tests for CPU plug functions and helpers (Peter Krempa)
- qemuagenttest: Introduce testing of shutdown commands (Peter Krempa)
- qemuagenttest: Add testing of agent suspend modes (Peter Krempa)
- qemuagenttest: Test the filesystem trimming (Peter Krempa)
- tests: Add qemuagenttest (Peter Krempa)
- qemumonitortestutils: Add the ability to check arguments of commands (Peter Krempa)
- qemumonitortestutils: Improve error reporting from mock qemu monitor (Peter Krempa)
- qemumonitortestutils: Add instrumentation for guest agent testing (Peter Krempa)
- qemumonitortestutils: Split lines on \n instead of \r\n (Peter Krempa)
- qemumonitortestutils: Refactor the test helpers to allow reuse (Peter Krempa)
- qemumonitortestutils: Split up creation of the test to allow reuse (Peter Krempa)
- qemumonitortestutils: Don't crash on non fully initialized test (Peter Krempa)
- qemumonitortestutils: remove multiline function calls (Peter Krempa)
- qemumonitortestutils: Use VIR_DELETE_ELEMENT and VIR_APPEND_ELEMENT (Peter Krempa)
- qemumonitortestutils: Use consistent header style and line spacing (Peter Krempa)
- qemu_agent: Remove obvious comments (Peter Krempa)
- qemu_agent: Move updater function for VCPU hotplug into qemu_agent.c (Peter Krempa)
- qemu_agent: Output newline at the end of the sync JSON message (Peter Krempa)
- conf: Export virDomainChrSourceDefClear() (Peter Krempa)
- add console support in libxl (Bamvor Jian Zhang)
- util: add virGetUserDirectoryByUID (Dan Walsh)
- maint: fix typo for SENTINEL (Eric Blake)
- spec: Don't mix commands with macro definitions (Jiri Denemark)
- spec: Use --enable-werror on RHEL (Jiri Denemark)
- tests: Put a mock library at the start of LD_PRELOAD (Jiri Denemark)
- Support apparmor in RPM spec (Daniel P. Berrange)
- Delete obsolete / unused python test files (Daniel P. Berrange)
Cleanups:
- qemu_hotplug: Fix whitespace around addition in argument (Peter Krempa)
- qemu: Drop qemuDomainMemoryLimit (Michal Privoznik)
- maint: avoid bootstrap warning (Eric Blake)
- libxl: remove unnecessary curly braces (Jim Fehlig)
- virtio-rng: Remove double space in error message (Peter Krempa)
- Don't mark parentIndex with ATTRIBUTE_UNUSED (Ján Tomko)
Thanks everybody who contributed to this release in some ways, ideas,
bug reports, patches or reviews ! Including localization updates, we now
have a dozen of languague with complete or near complate translations :-)
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/
11 years, 2 months
[libvirt] [PATCH] qemu_hotplug: Resolve DEADCODE coverity error
by John Ferlan
Remove unused 'cgroup' variable in qemuDomainAttachDeviceDiskLive() to
resolve coverity DEADCODE complaint
---
Refactoring of qemuDomainAttachDeviceDiskLive() in the following patch:
https://www.redhat.com/archives/libvir-list/2013-August/msg00079.html
seemed to wake up Coverity and it complained about deadcode as a result
of 'cgroup' only ever been NULL thus the check for it to be non-NULL in
order to call qemuTeardownDiskCgroup() would not be able to occur. The
code actually hadn't changed, but for some reason coverity now found it.
Followed example in qemuDomainChangeDiskMediaLive() and just removed the
'cgroup' variable.
src/qemu/qemu_hotplug.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 9c655ff..6cdee44 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -683,7 +683,6 @@ qemuDomainAttachDeviceDiskLive(virConnectPtr conn,
virDomainDiskDefPtr orig_disk = NULL;
virDomainDeviceDefPtr dev_copy = NULL;
virDomainDiskDefPtr tmp = NULL;
- virCgroupPtr cgroup = NULL;
virCapsPtr caps = NULL;
int ret = -1;
@@ -773,10 +772,10 @@ qemuDomainAttachDeviceDiskLive(virConnectPtr conn,
break;
}
- if (ret != 0 && cgroup) {
- if (qemuTeardownDiskCgroup(vm, disk) < 0)
- VIR_WARN("Failed to teardown cgroup for disk path %s",
- NULLSTR(disk->src));
+ if (ret != 0 &&
+ qemuTeardownDiskCgroup(vm, disk) < 0) {
+ VIR_WARN("Failed to teardown cgroup for disk path %s",
+ NULLSTR(disk->src));
}
end:
--
1.8.3.1
11 years, 2 months