[libvirt] [PATCH] virsh: Improve the error for snapshot-list
by Osier Yang
It reports error "roots and --from are exclusive" even "--current"
is specified with "--roots", but no "--from".
---
tools/virsh-snapshot.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/tools/virsh-snapshot.c b/tools/virsh-snapshot.c
index b828371..6dd8bf2 100644
--- a/tools/virsh-snapshot.c
+++ b/tools/virsh-snapshot.c
@@ -1197,7 +1197,8 @@ cmdSnapshotList(vshControl *ctl, const vshCmd *cmd)
}
if (from) {
vshError(ctl, "%s",
- _("--roots and --from are mutually exclusive"));
+ _("--roots is mutually exclusive with either "
+ "--from or --current"));
goto cleanup;
}
flags |= VIR_DOMAIN_SNAPSHOT_LIST_ROOTS;
--
1.7.7.6
12 years, 1 month
[libvirt] [PATCH] virsh: Fix segfault of snapshot-list
by Osier Yang
"snaps" is used after free'ed, and the additional one entry should
be added to the list.
---
tools/virsh-snapshot.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/virsh-snapshot.c b/tools/virsh-snapshot.c
index 6dd8bf2..635edd8 100644
--- a/tools/virsh-snapshot.c
+++ b/tools/virsh-snapshot.c
@@ -856,9 +856,6 @@ vshSnapshotListCollect(vshControl *ctl, virDomainPtr dom,
snaplist->snaps = vshCalloc(ctl, count + (tree && from),
sizeof(*snaplist->snaps));
snaplist->nsnaps = count;
- for (i = 0; i < count; i++)
- snaplist->snaps[i].snap = snaps[i];
- VIR_FREE(snaps);
if (tree) {
for (i = 0; i < count; i++) {
if (vshGetSnapshotParent(ctl, snaplist->snaps[i].snap,
@@ -870,6 +867,9 @@ vshSnapshotListCollect(vshControl *ctl, virDomainPtr dom,
virDomainSnapshotRef(from);
}
}
+ for (i = 0; i < snaplist->nsnaps; i++)
+ snaplist->snaps[i].snap = snaps[i];
+ VIR_FREE(snaps);
goto success;
}
--
1.7.7.6
12 years, 1 month
[libvirt] [PATCH] qemu: Pin the emulator when only cpuset is specified
by Martin Kletzander
According to our recent changes (clarifications), we should be pinning
qemu's emulator processes using the <vcpu> 'cpuset' attribute in case
there is no <emulatorpin> specified. This however doesn't work
entirely as expected and this patch should resolve all the remaining
issues.
---
src/qemu/qemu_cgroup.c | 25 ++++++++++++++++---------
src/qemu/qemu_cgroup.h | 4 ++--
src/qemu/qemu_driver.c | 3 ++-
src/qemu/qemu_process.c | 16 ++++++++--------
4 files changed, 28 insertions(+), 20 deletions(-)
diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
index 166f9b9..6b94686 100644
--- a/src/qemu/qemu_cgroup.c
+++ b/src/qemu/qemu_cgroup.c
@@ -501,7 +501,7 @@ int qemuSetupCgroupVcpuPin(virCgroupPtr cgroup,
for (i = 0; i < nvcpupin; i++) {
if (vcpuid == vcpupin[i]->vcpuid) {
- return qemuSetupCgroupEmulatorPin(cgroup, vcpupin[i]);
+ return qemuSetupCgroupEmulatorPin(cgroup, vcpupin[i]->cpumask);
}
}
@@ -509,12 +509,12 @@ int qemuSetupCgroupVcpuPin(virCgroupPtr cgroup,
}
int qemuSetupCgroupEmulatorPin(virCgroupPtr cgroup,
- virDomainVcpuPinDefPtr vcpupin)
+ virBitmapPtr cpumask)
{
int rc = 0;
char *new_cpus = NULL;
- new_cpus = virBitmapFormat(vcpupin->cpumask);
+ new_cpus = virBitmapFormat(cpumask);
if (!new_cpus) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("failed to convert cpu mask"));
@@ -643,6 +643,7 @@ cleanup:
int qemuSetupCgroupForEmulator(struct qemud_driver *driver,
virDomainObjPtr vm)
{
+ virBitmapPtr cpumask = NULL;
virCgroupPtr cgroup = NULL;
virCgroupPtr cgroup_emulator = NULL;
virDomainDefPtr def = vm->def;
@@ -690,12 +691,18 @@ int qemuSetupCgroupForEmulator(struct qemud_driver *driver,
}
}
- if (def->cputune.emulatorpin &&
- qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_CPUSET)) {
- rc = qemuSetupCgroupEmulatorPin(cgroup_emulator,
- def->cputune.emulatorpin);
- if (rc < 0)
- goto cleanup;
+ if (def->cputune.emulatorpin)
+ cpumask = def->cputune.emulatorpin->cpumask;
+ else if (def->cpumask)
+ cpumask = def->cpumask;
+
+ if (cpumask) {
+ if (qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_CPUSET)) {
+ rc = qemuSetupCgroupEmulatorPin(cgroup_emulator, cpumask);
+ if (rc < 0)
+ goto cleanup;
+ }
+ cpumask = NULL; /* sanity */
}
if (period || quota) {
diff --git a/src/qemu/qemu_cgroup.h b/src/qemu/qemu_cgroup.h
index b7b0211..362080a 100644
--- a/src/qemu/qemu_cgroup.h
+++ b/src/qemu/qemu_cgroup.h
@@ -1,7 +1,7 @@
/*
* qemu_cgroup.h: QEMU cgroup management
*
- * Copyright (C) 2006-2007, 2009-2011 Red Hat, Inc.
+ * Copyright (C) 2006-2007, 2009-2012 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
*
* This library is free software; you can redistribute it and/or
@@ -57,7 +57,7 @@ int qemuSetupCgroupVcpuPin(virCgroupPtr cgroup,
virDomainVcpuPinDefPtr *vcpupin,
int nvcpupin,
int vcpuid);
-int qemuSetupCgroupEmulatorPin(virCgroupPtr cgroup, virDomainVcpuPinDefPtr vcpupin);
+int qemuSetupCgroupEmulatorPin(virCgroupPtr cgroup, virBitmapPtr cpumask);
int qemuSetupCgroupForVcpu(struct qemud_driver *driver, virDomainObjPtr vm);
int qemuSetupCgroupForEmulator(struct qemud_driver *driver,
virDomainObjPtr vm);
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index fa37bfd..adfbfa6 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -4245,7 +4245,8 @@ qemudDomainPinEmulator(virDomainPtr dom,
if (virCgroupForDomain(driver->cgroup, vm->def->name,
&cgroup_dom, 0) == 0) {
if (virCgroupForEmulator(cgroup_dom, &cgroup_emulator, 0) == 0) {
- if (qemuSetupCgroupEmulatorPin(cgroup_emulator, newVcpuPin[0]) < 0) {
+ if (qemuSetupCgroupEmulatorPin(cgroup_emulator,
+ newVcpuPin[0]->cpumask) < 0) {
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("failed to set cpuset.cpus in cgroup"
" for emulator threads"));
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index a94e9c4..e08ec67 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -2024,11 +2024,12 @@ cleanup:
return ret;
}
-/* Set CPU affinities for emulator threads if emulatorpin xml provided. */
+/* Set CPU affinities for emulator threads. */
static int
qemuProcessSetEmulatorAffinites(virConnectPtr conn,
virDomainObjPtr vm)
{
+ virBitmapPtr cpumask;
virDomainDefPtr def = vm->def;
virNodeInfo nodeinfo;
int ret = -1;
@@ -2036,15 +2037,14 @@ qemuProcessSetEmulatorAffinites(virConnectPtr conn,
if (virNodeGetInfo(conn, &nodeinfo) != 0)
return -1;
- if (!def->cputune.emulatorpin)
- return 0;
-
- if (virProcessInfoSetAffinity(vm->pid,
- def->cputune.emulatorpin->cpumask) < 0) {
+ if (def->cputune.emulatorpin)
+ cpumask = def->cputune.emulatorpin->cpumask;
+ else if (def->cpumask)
+ cpumask = def->cpumask;
+ else
goto cleanup;
- }
- ret = 0;
+ ret = virProcessInfoSetAffinity(vm->pid, cpumask);
cleanup:
return ret;
}
--
1.7.12.3
12 years, 1 month
[libvirt] [PATCH] migrate: v2: use VIR_DOMAIN_XML_MIGRATABLE when available
by Ján Tomko
In v2 migration protocol, XML is obtained by calling domainGetXMLDesc.
This includes the default USB controller in XML, which breaks migration
to older libvirt (before 0.9.2).
Commit 409b5f549530e7b3a33f4505f2cad2e26896107c
qemu: Emit compatible XML when migrating a domain
only fixed this for v3 migration.
This patch uses the new VIR_DOMAIN_XML_MIGRATABLE flag (detected by
VIR_DRV_FEATURE_XML_MIGRATABLE) to obtain XML without the default controller,
enabling backward v2 migration.
---
src/libvirt.c | 13 ++++++++++---
src/libvirt_internal.h | 5 +++++
src/qemu/qemu_driver.c | 1 +
3 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/src/libvirt.c b/src/libvirt.c
index e3ddf27..f6f5b91 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -4620,6 +4620,7 @@ virDomainMigrateVersion2 (virDomainPtr domain,
int cookielen = 0, ret;
virDomainInfo info;
virErrorPtr orig_err = NULL;
+ unsigned int getxml_flags = 0;
int cancelled;
VIR_DOMAIN_DEBUG(domain,
"dconn=%p, flags=%lx, dname=%s, uri=%s, bandwidth=%lu",
@@ -4646,9 +4647,15 @@ virDomainMigrateVersion2 (virDomainPtr domain,
virDispatchError(domain->conn);
return NULL;
}
- dom_xml = domain->conn->driver->domainGetXMLDesc(domain,
- VIR_DOMAIN_XML_SECURE |
- VIR_DOMAIN_XML_UPDATE_CPU);
+
+ if (VIR_DRV_SUPPORTS_FEATURE(domain->conn->driver, domain->conn,
+ VIR_DRV_FEATURE_XML_MIGRATABLE)) {
+ getxml_flags |= VIR_DOMAIN_XML_MIGRATABLE;
+ } else {
+ getxml_flags |= VIR_DOMAIN_XML_SECURE | VIR_DOMAIN_XML_UPDATE_CPU;
+ }
+
+ dom_xml = domain->conn->driver->domainGetXMLDesc(domain, getxml_flags);
if (!dom_xml)
return NULL;
diff --git a/src/libvirt_internal.h b/src/libvirt_internal.h
index 23e7153..71483e4 100644
--- a/src/libvirt_internal.h
+++ b/src/libvirt_internal.h
@@ -95,6 +95,11 @@ enum {
* messages).
*/
VIR_DRV_FEATURE_PROGRAM_KEEPALIVE = 10,
+
+ /*
+ * Support for VIR_DOMAIN_XML_MIGRATABLE flag in domainGetXMLDesc
+ */
+ VIR_DRV_FEATURE_XML_MIGRATABLE = 11,
};
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 76730c6..0c35dad 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -1130,6 +1130,7 @@ qemudSupportsFeature (virConnectPtr conn ATTRIBUTE_UNUSED, int feature)
case VIR_DRV_FEATURE_MIGRATE_CHANGE_PROTECTION:
case VIR_DRV_FEATURE_FD_PASSING:
case VIR_DRV_FEATURE_TYPED_PARAM_STRING:
+ case VIR_DRV_FEATURE_XML_MIGRATABLE:
return 1;
default:
return 0;
--
1.7.8.6
12 years, 1 month
[libvirt] [PATCH] qemu: set seamless migration capability
by Michal Privoznik
As we switched to setting capabilities based on QMP communication,
qemu seamless-migration capability was not set. In the -help output
this knob is called seamless-migration=[on|off]. The equivalent in
QMP world is SPICE_MIGRATE_COMPLETED event (qemu upstream commit
2fdd16e2).
---
src/qemu/qemu_capabilities.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index e897f86..0ddab80 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -1905,6 +1905,8 @@ qemuCapsProbeQMPEvents(qemuCapsPtr caps,
if (STREQ(name, "BALLOON_CHANGE"))
qemuCapsSet(caps, QEMU_CAPS_BALLOON_EVENT);
+ if (STREQ(name, "SPICE_MIGRATE_COMPLETED"))
+ qemuCapsSet(caps, QEMU_CAPS_SEAMLESS_MIGRATION);
VIR_FREE(name);
}
VIR_FREE(events);
--
1.7.8.6
12 years, 1 month
[libvirt] [PATCH] qemu: Cleanup the unused 'nodeinfo'
by Osier Yang
"nodeinfo" is not used in these two functions, and it's waste
of goto in qemuProcessSetEmulatorAffinites
---
src/qemu/qemu_process.c | 20 ++++----------------
1 files changed, 4 insertions(+), 16 deletions(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index d3951d1..9b7be08 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -1993,14 +1993,9 @@ qemuProcessSetVcpuAffinites(virConnectPtr conn,
{
qemuDomainObjPrivatePtr priv = vm->privateData;
virDomainDefPtr def = vm->def;
- virNodeInfo nodeinfo;
int vcpu, n;
int ret = -1;
- if (virNodeGetInfo(conn, &nodeinfo) != 0) {
- return -1;
- }
-
if (!def->cputune.nvcpupin)
return 0;
@@ -2031,23 +2026,16 @@ qemuProcessSetEmulatorAffinites(virConnectPtr conn,
{
virBitmapPtr cpumask;
virDomainDefPtr def = vm->def;
- virNodeInfo nodeinfo;
int ret = -1;
- if (virNodeGetInfo(conn, &nodeinfo) != 0)
- return -1;
-
- if (def->cputune.emulatorpin) {
+ if (def->cputune.emulatorpin)
cpumask = def->cputune.emulatorpin->cpumask;
- } else if (def->cpumask) {
+ else if (def->cpumask)
cpumask = def->cpumask;
- } else {
- ret = 0;
- goto cleanup;
- }
+ else
+ return 0;
ret = virProcessInfoSetAffinity(vm->pid, cpumask);
-cleanup:
return ret;
}
--
1.7.7.6
12 years, 1 month
[libvirt] [PATCH] network: always create dnsmasq hosts and addnhosts files, even if empty
by Laine Stump
This fixes the problem reported in:
https://bugzilla.redhat.com/show_bug.cgi?id=868389
Previously, the dnsmasq hosts file (used for static dhcp entries, and
addnhosts file (used for additional dns host entries) were only
created/referenced on the dnsmasq commandline if there was something
to put in them at the time the network was started. Once we can update
a network definition while it's active (which is now possible with
virNetworkUpdate), this is no longer a valid strategy - if there were
0 dhcp static hosts (resulting in no reference to the hosts file on the
commandline), then one was later added, the commandline wouldn't have
linked dnsmasq up to the file, so even though we create it, dnsmasq
doesn't pay any attention.
The solution is to just always create these files and reference them
on the dnsmasq commandline (almost always, anyway). That way dnsmasq
can notice when a new entry is added at runtime (a SIGHUP is sent to
dnsmasq by virNetworkUdpate whenever a host entry is added or removed)
The exception to this is that the dhcp static hosts file isn't created
if there are no lease ranges *and* no static hosts. This is because in
this case dnsmasq won't be setup to listen for dhcp requests anyway -
in that case, if the count of dhcp hosts goes from 0 to 1, dnsmasq
will need to be restarted anyway (to get it listening on the dhcp
port). Likewise, if the dhcp hosts count goes from 1 to 0 (and there
are no dhcp ranges) we need to restart dnsmasq so that it will stop
listening on port 67. These special situations are handled in the
bridge driver's networkUpdate() by checking for ((bool)
nranges||nhosts) both before and after the update, and triggering a
dnsmasq restart if the before and after don't match.
---
src/network/bridge_driver.c | 56 +++++++++++++++++++---
src/util/dnsmasq.c | 12 +++--
tests/networkxml2argvdata/isolated-network.argv | 4 +-
.../nat-network-dns-srv-record-minimal.argv | 3 +-
.../nat-network-dns-srv-record.argv | 3 +-
.../nat-network-dns-txt-record.argv | 3 +-
tests/networkxml2argvdata/nat-network.argv | 3 +-
tests/networkxml2argvdata/netboot-network.argv | 5 +-
.../networkxml2argvdata/netboot-proxy-network.argv | 2 +
tests/networkxml2argvdata/routed-network.argv | 3 +-
10 files changed, 75 insertions(+), 19 deletions(-)
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index fa909a1..1c97f29 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -751,12 +751,19 @@ networkBuildDnsmasqArgv(virNetworkObjPtr network,
if (networkBuildDnsmasqHostsfile(dctx, ipdef, network->def->dns) < 0)
goto cleanup;
- if (dctx->hostsfile->nhosts)
+ /* Even if there are currently no static hosts, if we're
+ * listening for DHCP, we should write a 0-length hosts
+ * file to allow for runtime additions.
+ */
+ if (ipdef->nranges || ipdef->nhosts)
virCommandAddArgPair(cmd, "--dhcp-hostsfile",
dctx->hostsfile->path);
- if (dctx->addnhostsfile->nhosts)
- virCommandAddArgPair(cmd, "--addn-hosts",
- dctx->addnhostsfile->path);
+
+ /* Likewise, always create this file and put it on the commandline, to allow for
+ * for runtime additions.
+ */
+ virCommandAddArgPair(cmd, "--addn-hosts",
+ dctx->addnhostsfile->path);
if (ipdef->tftproot) {
virCommandAddArgList(cmd, "--enable-tftp",
@@ -2882,7 +2889,10 @@ networkUpdate(virNetworkPtr net,
{
struct network_driver *driver = net->conn->networkPrivateData;
virNetworkObjPtr network = NULL;
- int isActive, ret = -1;
+ int isActive, ret = -1, ii;
+ virNetworkIpDefPtr ipdef;
+ bool oldDhcpActive = false;
+
virCheckFlags(VIR_NETWORK_UPDATE_AFFECT_LIVE |
VIR_NETWORK_UPDATE_AFFECT_CONFIG,
@@ -2897,6 +2907,16 @@ networkUpdate(virNetworkPtr net,
goto cleanup;
}
+ /* see if we are listening for dhcp pre-modification */
+ for (ii = 0;
+ (ipdef = virNetworkDefGetIpByIndex(network->def, AF_INET, ii));
+ ii++) {
+ if (ipdef->nranges || ipdef->nhosts) {
+ oldDhcpActive = true;
+ break;
+ }
+ }
+
/* VIR_NETWORK_UPDATE_AFFECT_CURRENT means "change LIVE if network
* is active, else change CONFIG
*/
@@ -2938,8 +2958,30 @@ networkUpdate(virNetworkPtr net,
if (networkRestartDhcpDaemon(network) < 0)
goto cleanup;
- } else if (section == VIR_NETWORK_SECTION_IP_DHCP_HOST ||
- section == VIR_NETWORK_SECTION_DNS_HOST ||
+ } else if (section == VIR_NETWORK_SECTION_IP_DHCP_HOST) {
+ /* if we previously weren't listening for dhcp and now we
+ * are (or vice-versa) then we need to do a restart,
+ * otherwise we just need to do a refresh (redo the config
+ * files and send SIGHUP)
+ */
+ bool newDhcpActive = false;
+
+ for (ii = 0;
+ (ipdef = virNetworkDefGetIpByIndex(network->def, AF_INET, ii));
+ ii++) {
+ if (ipdef->nranges || ipdef->nhosts) {
+ newDhcpActive = true;
+ break;
+ }
+ }
+
+ if ((newDhcpActive != oldDhcpActive &&
+ networkRestartDhcpDaemon(network) < 0) ||
+ networkRefreshDhcpDaemon(network) < 0) {
+ goto cleanup;
+ }
+
+ } else if (section == VIR_NETWORK_SECTION_DNS_HOST ||
section == VIR_NETWORK_SECTION_DNS_TXT ||
section == VIR_NETWORK_SECTION_DNS_SRV) {
/* these sections only change things in config files, so we
diff --git a/src/util/dnsmasq.c b/src/util/dnsmasq.c
index 91bf2c5..9d1c07b 100644
--- a/src/util/dnsmasq.c
+++ b/src/util/dnsmasq.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2007-2011 Red Hat, Inc.
+ * Copyright (C) 2007-2012 Red Hat, Inc.
* Copyright (C) 2010 Satoru SATOH <satoru.satoh(a)gmail.com>
*
* This library is free software; you can redistribute it and/or
@@ -176,8 +176,9 @@ addnhostsWrite(const char *path,
unsigned int i, ii;
int rc = 0;
- if (nhosts == 0)
- return rc;
+ /* even if there are 0 hosts, create a 0 length file, to allow
+ * for runtime addition.
+ */
if (virAsprintf(&tmp, "%s.new", path) < 0)
return -ENOMEM;
@@ -364,8 +365,9 @@ hostsfileWrite(const char *path,
unsigned int i;
int rc = 0;
- if (nhosts == 0)
- return rc;
+ /* even if there are 0 hosts, create a 0 length file, to allow
+ * for runtime addition.
+ */
if (virAsprintf(&tmp, "%s.new", path) < 0)
return -ENOMEM;
diff --git a/tests/networkxml2argvdata/isolated-network.argv b/tests/networkxml2argvdata/isolated-network.argv
index 048c72b..13e77b2 100644
--- a/tests/networkxml2argvdata/isolated-network.argv
+++ b/tests/networkxml2argvdata/isolated-network.argv
@@ -4,4 +4,6 @@
--listen-address 192.168.152.1 \
--dhcp-range 192.168.152.2,192.168.152.254 \
--dhcp-leasefile=/var/lib/libvirt/dnsmasq/private.leases --dhcp-lease-max=253 \
---dhcp-no-override\
+--dhcp-no-override \
+--dhcp-hostsfile=/var/lib/libvirt/dnsmasq/private.hostsfile \
+--addn-hosts=/var/lib/libvirt/dnsmasq/private.addnhosts\
diff --git a/tests/networkxml2argvdata/nat-network-dns-srv-record-minimal.argv b/tests/networkxml2argvdata/nat-network-dns-srv-record-minimal.argv
index a1e4200..210a60c 100644
--- a/tests/networkxml2argvdata/nat-network-dns-srv-record-minimal.argv
+++ b/tests/networkxml2argvdata/nat-network-dns-srv-record-minimal.argv
@@ -13,4 +13,5 @@
--dhcp-leasefile=/var/lib/libvirt/dnsmasq/default.leases \
--dhcp-lease-max=253 \
--dhcp-no-override \
---dhcp-hostsfile=/var/lib/libvirt/dnsmasq/default.hostsfile\
+--dhcp-hostsfile=/var/lib/libvirt/dnsmasq/default.hostsfile \
+--addn-hosts=/var/lib/libvirt/dnsmasq/default.addnhosts\
diff --git a/tests/networkxml2argvdata/nat-network-dns-srv-record.argv b/tests/networkxml2argvdata/nat-network-dns-srv-record.argv
index 8af38c4..833d3cd 100644
--- a/tests/networkxml2argvdata/nat-network-dns-srv-record.argv
+++ b/tests/networkxml2argvdata/nat-network-dns-srv-record.argv
@@ -13,4 +13,5 @@
--dhcp-leasefile=/var/lib/libvirt/dnsmasq/default.leases \
--dhcp-lease-max=253 \
--dhcp-no-override \
---dhcp-hostsfile=/var/lib/libvirt/dnsmasq/default.hostsfile\
+--dhcp-hostsfile=/var/lib/libvirt/dnsmasq/default.hostsfile \
+--addn-hosts=/var/lib/libvirt/dnsmasq/default.addnhosts\
diff --git a/tests/networkxml2argvdata/nat-network-dns-txt-record.argv b/tests/networkxml2argvdata/nat-network-dns-txt-record.argv
index 404b56a..3481507 100644
--- a/tests/networkxml2argvdata/nat-network-dns-txt-record.argv
+++ b/tests/networkxml2argvdata/nat-network-dns-txt-record.argv
@@ -7,4 +7,5 @@
--dhcp-range 192.168.122.2,192.168.122.254 \
--dhcp-leasefile=/var/lib/libvirt/dnsmasq/default.leases \
--dhcp-lease-max=253 --dhcp-no-override \
---dhcp-hostsfile=/var/lib/libvirt/dnsmasq/default.hostsfile\
+--dhcp-hostsfile=/var/lib/libvirt/dnsmasq/default.hostsfile \
+--addn-hosts=/var/lib/libvirt/dnsmasq/default.addnhosts\
diff --git a/tests/networkxml2argvdata/nat-network.argv b/tests/networkxml2argvdata/nat-network.argv
index 1dc8f73..37fd2fc 100644
--- a/tests/networkxml2argvdata/nat-network.argv
+++ b/tests/networkxml2argvdata/nat-network.argv
@@ -6,4 +6,5 @@
--dhcp-range 192.168.122.2,192.168.122.254 \
--dhcp-leasefile=/var/lib/libvirt/dnsmasq/default.leases \
--dhcp-lease-max=253 --dhcp-no-override \
---dhcp-hostsfile=/var/lib/libvirt/dnsmasq/default.hostsfile\
+--dhcp-hostsfile=/var/lib/libvirt/dnsmasq/default.hostsfile \
+--addn-hosts=/var/lib/libvirt/dnsmasq/default.addnhosts\
diff --git a/tests/networkxml2argvdata/netboot-network.argv b/tests/networkxml2argvdata/netboot-network.argv
index 5a85ec2..5408eb7 100644
--- a/tests/networkxml2argvdata/netboot-network.argv
+++ b/tests/networkxml2argvdata/netboot-network.argv
@@ -3,5 +3,8 @@
--except-interface lo --listen-address 192.168.122.1 \
--dhcp-range 192.168.122.2,192.168.122.254 \
--dhcp-leasefile=/var/lib/libvirt/dnsmasq/netboot.leases \
---dhcp-lease-max=253 --dhcp-no-override --expand-hosts --enable-tftp \
+--dhcp-lease-max=253 --dhcp-no-override --expand-hosts \
+--dhcp-hostsfile=/var/lib/libvirt/dnsmasq/netboot.hostsfile \
+--addn-hosts=/var/lib/libvirt/dnsmasq/netboot.addnhosts \
+--enable-tftp \
--tftp-root /var/lib/tftproot --dhcp-boot pxeboot.img\
diff --git a/tests/networkxml2argvdata/netboot-proxy-network.argv b/tests/networkxml2argvdata/netboot-proxy-network.argv
index 36836b0..21e01e3 100644
--- a/tests/networkxml2argvdata/netboot-proxy-network.argv
+++ b/tests/networkxml2argvdata/netboot-proxy-network.argv
@@ -4,4 +4,6 @@
--dhcp-range 192.168.122.2,192.168.122.254 \
--dhcp-leasefile=/var/lib/libvirt/dnsmasq/netboot.leases \
--dhcp-lease-max=253 --dhcp-no-override --expand-hosts \
+--dhcp-hostsfile=/var/lib/libvirt/dnsmasq/netboot.hostsfile \
+--addn-hosts=/var/lib/libvirt/dnsmasq/netboot.addnhosts \
--dhcp-boot pxeboot.img,,10.20.30.40\
diff --git a/tests/networkxml2argvdata/routed-network.argv b/tests/networkxml2argvdata/routed-network.argv
index 77e802f..9fedb2b 100644
--- a/tests/networkxml2argvdata/routed-network.argv
+++ b/tests/networkxml2argvdata/routed-network.argv
@@ -1,3 +1,4 @@
@DNSMASQ@ --strict-order --bind-interfaces \
--local=// --domain-needed --conf-file= \
---except-interface lo --listen-address 192.168.122.1\
+--except-interface lo --listen-address 192.168.122.1 \
+--addn-hosts=/var/lib/libvirt/dnsmasq/local.addnhosts\
--
1.7.11.7
12 years, 1 month
[libvirt] [PATCH] tools: Only install guests init script if --with-init=script=redhat
by Cole Robinson
Required to fix https://bugzilla.redhat.com/show_bug.cgi?id=789747
---
libvirt.spec.in | 5 ++++-
tools/Makefile.am | 4 ++--
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index 511949e..b3b280b 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -1380,7 +1380,9 @@ rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.uml
mv $RPM_BUILD_ROOT%{_datadir}/doc/libvirt-%{version} \
$RPM_BUILD_ROOT%{_datadir}/doc/libvirt-docs-%{version}
+%if ! %{with_systemd}
sed -i -e "s|$RPM_BUILD_ROOT||g" $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/libvirt-guests
+%endif
%clean
rm -fr %{buildroot}
@@ -1593,8 +1595,10 @@ fi
%if %{with_systemd}
%{_unitdir}/libvirtd.service
+%{_unitdir}/libvirt-guests.service
%else
%{_sysconfdir}/rc.d/init.d/libvirtd
+%{_sysconfdir}/rc.d/init.d/libvirt-guests
%endif
%doc daemon/libvirtd.upstart
%config(noreplace) %{_sysconfdir}/sysconfig/libvirtd
@@ -1856,7 +1860,6 @@ rm -f $RPM_BUILD_ROOT%{_sysconfdir}/sysctl.d/libvirtd
%{_datadir}/libvirt/cpu_map.xml
-%{_sysconfdir}/rc.d/init.d/libvirt-guests
%if %{with_systemd}
%{_unitdir}/libvirt-guests.service
%endif
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 0d7822d..86e48e0 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -217,12 +217,12 @@ EXTRA_DIST += libvirt-guests.service.in
SYSTEMD_UNIT_DIR = /lib/systemd/system
if LIBVIRT_INIT_SCRIPT_SYSTEMD
-install-systemd: libvirt-guests.service install-initscript install-sysconfig
+install-systemd: libvirt-guests.service install-sysconfig
$(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR)
$(INSTALL_DATA) libvirt-guests.service \
$(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirt-guests.service
-uninstall-systemd: uninstall-initscript uninstall-sysconfig
+uninstall-systemd: uninstall-sysconfig
rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirt-guests.service
rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) ||:
--
1.7.11.7
12 years, 1 month
[libvirt] [PATCH] qemu: Fix domxml-to-native network model conversion
by Cole Robinson
https://bugzilla.redhat.com/show_bug.cgi?id=636832
---
src/qemu/qemu_driver.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index feda4d9..c2ddba7 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -5362,6 +5362,13 @@ static char *qemuDomainXMLToNative(virConnectPtr conn,
for (i = 0 ; i < def->nnets ; i++) {
virDomainNetDefPtr net = def->nets[i];
int bootIndex = net->info.bootIndex;
+ char *model = NULL;
+
+ if (net->model && !(model = strdup(net->model))) {
+ virReportOOMError();
+ goto cleanup;
+ }
+
if (net->type == VIR_DOMAIN_NET_TYPE_NETWORK) {
int actualType = virDomainNetGetActualType(net);
const char *brname;
@@ -5418,8 +5425,10 @@ static char *qemuDomainXMLToNative(virConnectPtr conn,
net->data.ethernet.dev = brname;
net->data.ethernet.ipaddr = ipaddr;
}
+
VIR_FREE(net->virtPortProfile);
net->info.bootIndex = bootIndex;
+ net->model = model;
}
monitor_json = qemuCapsGet(caps, QEMU_CAPS_MONITOR_JSON);
--
1.7.11.7
12 years, 1 month
[libvirt] [PATCH] Fix disabling of apparmor security driver
by Christophe Fergeau
When using --without-apparmor --without-secdriver-apparmor, configure
will fail saying that AppArmor development package must be installed.
This is caused by a small bug in --with-secdriver-apparmor handling in
configure.ac which treats --without-secdriver-apparmor as if the user
had requested to enable apparmor.
---
configure.ac | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 13967e9..6ffcb03 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1562,7 +1562,8 @@ AC_ARG_WITH([secdriver-apparmor],
if test "$with_apparmor" != "yes" ; then
if test "$with_secdriver_apparmor" = "check" ; then
with_secdriver_apparmor=no
- else
+ fi
+ if test "$with_secdriver_apparmor" != "no" ; then
AC_MSG_ERROR([You must install the AppArmor development package in order to compile libvirt])
fi
else
--
1.7.12.1
12 years, 1 month