[libvirt] [PATCH] docs: fix network XML documentation
by Laine Stump
A few people have attempted to use the new forwarding modes with older
versions of libvirt. The docs where the modes are described have
always stated the minimum required libvirt version, but the examples
at the end didn't, which I believe is what has caused the confusion.
Similarly, the section on portgroups now has a version tag added at
the beginning.
I also noticed that there was no example of defining a <dns> hostname,
so I added one, as well as making the domain name example more
recognizable (by adding ".com" to the domain).
---
docs/formatnetwork.html.in | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/docs/formatnetwork.html.in b/docs/formatnetwork.html.in
index 99031d0..e06392b 100644
--- a/docs/formatnetwork.html.in
+++ b/docs/formatnetwork.html.in
@@ -58,7 +58,7 @@
<pre>
...
<bridge name="virbr0" stp="on" delay="5"/>
- <domain name="example"/>
+ <domain name="example.com"/>
<forward mode="nat" dev="eth0"/>
...</pre>
@@ -214,7 +214,7 @@
As mentioned above, a <code><forward></code> element can
have multiple <code><interface></code> subelements, each
one giving the name of a physical interface that can be used
- for this network<span class="since">Since 0.9.4</span>:
+ for this network <span class="since">Since 0.9.4</span>:
<pre>
...
<forward mode='passthrough'>
@@ -301,9 +301,11 @@
...</pre>
<p>
+ <span class="since">Since 0.9.4</span>
A portgroup provides a method of easily putting guest
connections to the network into different classes, with each
- class potentially having a different level/type of service. Each
+ class potentially having a different level/type of service.
+ <span class="since">Since 0.9.4</span> Each
network can have multiple portgroup elements (and one of those
can optionally be designated as the 'default' portgroup for the
network), and each portgroup has a name, as well as various
@@ -340,8 +342,12 @@
<pre>
...
<mac address='00:16:3E:5D:C7:9E'/>
+ <domain name="example.com"/>
<dns>
<txt name="example" value="example value" />
+ <host ip='192.168.122.2'>
+ <hostname>myhost</hostname>
+ <hostname>myhostalias</hostname>
</dns>
<ip address="192.168.122.1" netmask="255.255.255.0">
<dhcp>
@@ -542,6 +548,7 @@
<h3><a name="examplesBridge">Using an existing host bridge</a></h3>
<p>
+ <span class="since">Since 0.9.4</span>
This shows how to use a pre-existing host bridge "br0". The
guests will effectively be directly connected to the physical
network (i.e. their IP addresses will all be on the subnet of
@@ -559,6 +566,8 @@
<h3><a name="examplesDirect">Using a macvtap "direct" connection</a></h3>
<p>
+ <span class="since">Since 0.9.4, QEMU and KVM only, requires
+ Linux kernel 2.6.34 or newer</span>
This shows how to use macvtap to connect to the physical network
directly through one of a group of physical devices (without
using a host bridge device). As with the host bridge network,
--
1.7.6.4
13 years, 6 months
[libvirt] [PATCH] util: Make getaddrinfo failure nonfatal in virGetHostname
by Jiri Denemark
Setting a hostname that cannot be resolved is not the best configuration
but since virGetHostname only calls getaddrinfo to get host's canonical
name and we do not fail if the returned canonical name is NULL or
"localhost", there is no reason why we should fail if getaddrinfo itself
fails.
---
src/util/util.c | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/util/util.c b/src/util/util.c
index 1ff287d..fd4d7fa 100644
--- a/src/util/util.c
+++ b/src/util/util.c
@@ -1858,10 +1858,10 @@ char *virIndexToDiskName(int idx, const char *prefix)
* try to resolve this to a fully-qualified name. Therefore we pass it
* to getaddrinfo(). There are two possible responses:
* a) getaddrinfo() resolves to a FQDN - return the FQDN
- * b) getaddrinfo() resolves to localhost - in this case, the data we got
- * from gethostname() is actually more useful than what we got from
- * getaddrinfo(). Return the value from gethostname() and hope for
- * the best.
+ * b) getaddrinfo() files or resolves to localhost - in this case, the
+ * data we got from gethostname() is actually more useful than what
+ * we got from getaddrinfo(). Return the value from gethostname()
+ * and hope for the best.
*/
char *virGetHostname(virConnectPtr conn ATTRIBUTE_UNUSED)
{
@@ -1897,10 +1897,10 @@ char *virGetHostname(virConnectPtr conn ATTRIBUTE_UNUSED)
hints.ai_family = AF_UNSPEC;
r = getaddrinfo(hostname, NULL, &hints, &info);
if (r != 0) {
- virUtilError(VIR_ERR_INTERNAL_ERROR,
- _("getaddrinfo failed for '%s': %s"),
- hostname, gai_strerror(r));
- return NULL;
+ VIR_WARN("getaddrinfo failed for '%s': %s",
+ hostname, gai_strerror(r));
+ result = strdup(hostname);
+ goto check_and_return;
}
/* Tell static analyzers about getaddrinfo semantics. */
--
1.7.7
13 years, 6 months
[libvirt] [PATCH] qemu: Make sure BeginJob is always followed by EndJob
by Jiri Denemark
Otherwise we can end up with a dangling job that can only be cleared by
restarting libvirtd.
---
src/qemu/qemu_driver.c | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 0e307e1..98f4d7f 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -2010,42 +2010,42 @@ static int qemuDomainSendKey(virDomainPtr domain,
if (!vm) {
char uuidstr[VIR_UUID_STRING_BUFLEN];
virUUIDFormat(domain->uuid, uuidstr);
qemuReportError(VIR_ERR_NO_DOMAIN,
_("no domain with matching uuid '%s'"), uuidstr);
goto cleanup;
}
priv = vm->privateData;
if (qemuDomainObjBeginJobWithDriver(driver, vm, QEMU_JOB_MODIFY) < 0)
goto cleanup;
if (!virDomainObjIsActive(vm)) {
qemuReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("domain is not running"));
- goto cleanup;
+ goto endjob;
}
qemuDomainObjEnterMonitorWithDriver(driver, vm);
ret = qemuMonitorSendKey(priv->mon, holdtime, keycodes, nkeycodes);
qemuDomainObjExitMonitorWithDriver(driver, vm);
- if (qemuDomainObjEndJob(driver, vm) == 0) {
+
+endjob:
+ if (qemuDomainObjEndJob(driver, vm) == 0)
vm = NULL;
- goto cleanup;
- }
cleanup:
if (vm)
virDomainObjUnlock(vm);
qemuDriverUnlock(driver);
return ret;
}
static int qemudDomainGetInfo(virDomainPtr dom,
virDomainInfoPtr info)
{
struct qemud_driver *driver = dom->conn->privateData;
virDomainObjPtr vm;
int ret = -1;
int err;
unsigned long balloon;
@@ -7208,103 +7208,103 @@ qemudDomainBlockStatsFlags (virDomainPtr dom,
&errs);
qemuDomainObjExitMonitor(driver, vm);
if (ret < 0)
goto endjob;
/* Field 'errs' is meaningless for QEMU, won't set it. */
for (i = 0; i < *nparams; i++) {
virTypedParameterPtr param = ¶ms[i];
switch (i) {
case 0: /* fill write_bytes here */
if (virStrcpyStatic(param->field, VIR_DOMAIN_BLOCK_STATS_WRITE_BYTES) == NULL) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Field write bytes too long for destination"));
- goto cleanup;
+ goto endjob;
}
param->type = VIR_TYPED_PARAM_LLONG;
param->value.l = wr_bytes;
break;
case 1: /* fill wr_operations here */
if (virStrcpyStatic(param->field, VIR_DOMAIN_BLOCK_STATS_WRITE_REQ) == NULL) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Field write requests too long for destination"));
- goto cleanup;
+ goto endjob;
}
param->type = VIR_TYPED_PARAM_LLONG;
param->value.l = wr_req;
break;
case 2: /* fill read_bytes here */
if (virStrcpyStatic(param->field, VIR_DOMAIN_BLOCK_STATS_READ_BYTES) == NULL) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Field read bytes too long for destination"));
- goto cleanup;
+ goto endjob;
}
param->type = VIR_TYPED_PARAM_LLONG;
param->value.l = rd_bytes;
break;
case 3: /* fill rd_operations here */
if (virStrcpyStatic(param->field, VIR_DOMAIN_BLOCK_STATS_READ_REQ) == NULL) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Field read requests too long for destination"));
- goto cleanup;
+ goto endjob;
}
param->type = VIR_TYPED_PARAM_LLONG;
param->value.l = rd_req;
break;
case 4: /* fill flush_operations here */
if (virStrcpyStatic(param->field, VIR_DOMAIN_BLOCK_STATS_FLUSH_REQ) == NULL) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Field flush requests too long for destination"));
- goto cleanup;
+ goto endjob;
}
param->type = VIR_TYPED_PARAM_LLONG;
param->value.l = flush_req;
break;
case 5: /* fill wr_total_times_ns here */
if (virStrcpyStatic(param->field, VIR_DOMAIN_BLOCK_STATS_WRITE_TOTAL_TIMES) == NULL) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Field write total times too long for destination"));
- goto cleanup;
+ goto endjob;
}
param->type = VIR_TYPED_PARAM_LLONG;
param->value.l = wr_total_times;
break;
case 6: /* fill rd_total_times_ns here */
if (virStrcpyStatic(param->field, VIR_DOMAIN_BLOCK_STATS_READ_TOTAL_TIMES) == NULL) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Field read total times too long for destination"));
- goto cleanup;
+ goto endjob;
}
param->type = VIR_TYPED_PARAM_LLONG;
param->value.l = rd_total_times;
break;
case 7: /* fill flush_total_times_ns here */
if (virStrcpyStatic(param->field, VIR_DOMAIN_BLOCK_STATS_READ_TOTAL_TIMES) == NULL) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Field flush total times too long for destination"));
- goto cleanup;
+ goto endjob;
}
param->type = VIR_TYPED_PARAM_LLONG;
param->value.l = flush_total_times;
break;
default:
break;
/* should not hit here */
}
}
endjob:
if (qemuDomainObjEndJob(driver, vm) == 0)
vm = NULL;
cleanup:
--
1.7.7
13 years, 6 months
[libvirt] [PATCH] qemu: Log debug messages when changing job
by Jiri Denemark
Log debug messages anytime we call *BeginJob* or *EndJob* so that it's
easier to spot incorrect usage of domain job APIs.
---
src/qemu/qemu_domain.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 85bebd6..5abc900 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -761,8 +761,13 @@ retry:
qemuDomainObjResetJob(priv);
if (job != QEMU_JOB_ASYNC) {
+ VIR_DEBUG("Starting job: %s (async=%s)",
+ qemuDomainJobTypeToString(job),
+ qemuDomainAsyncJobTypeToString(priv->job.asyncJob));
priv->job.active = job;
} else {
+ VIR_DEBUG("Starting async job: %s",
+ qemuDomainAsyncJobTypeToString(asyncJob));
qemuDomainObjResetAsyncJob(priv);
priv->job.asyncJob = asyncJob;
priv->job.start = now;
@@ -873,6 +878,10 @@ int qemuDomainObjEndJob(struct qemud_driver *driver, virDomainObjPtr obj)
priv->jobs_queued--;
+ VIR_DEBUG("Stopping job: %s (async=%s)",
+ qemuDomainJobTypeToString(priv->job.active),
+ qemuDomainAsyncJobTypeToString(priv->job.asyncJob));
+
qemuDomainObjResetJob(priv);
qemuDomainObjSaveJob(driver, obj);
virCondSignal(&priv->job.cond);
@@ -887,6 +896,9 @@ qemuDomainObjEndAsyncJob(struct qemud_driver *driver, virDomainObjPtr obj)
priv->jobs_queued--;
+ VIR_DEBUG("Stopping async job: %s",
+ qemuDomainAsyncJobTypeToString(priv->job.asyncJob));
+
qemuDomainObjResetAsyncJob(priv);
qemuDomainObjSaveJob(driver, obj);
virCondBroadcast(&priv->job.asyncCond);
--
1.7.7
13 years, 6 months
[libvirt] [PATCH v2 0/2] Xen: skip xenHypervisor version init in tests
by Philipp Hahn
Several tests fail when run as root on a Xen-dom0-system, since
virInitialize() then succeeds to open /proc/xen/privcmd and returns the
actual supported features instead of the faked one when calling
xenHypervisorMakeCapabilitiesInternal(). Since Xen-3.3 supports
additional features like "hap" and "viridian", the xencapstest fails.
v2: Skip initialization of static version variables for Xen Hypervisor and use
provided values for unit test cases.
Philipp Hahn (2):
Xen: move versions to struct
Xen: Fake versions in xencapstest
src/xen/xen_driver.c | 2 +-
src/xen/xen_hypervisor.c | 307 ++++++++++++++++++++++++----------------------
src/xen/xen_hypervisor.h | 10 ++-
tests/xencapstest.c | 10 ++
4 files changed, 180 insertions(+), 149 deletions(-)
13 years, 6 months
[libvirt] [PATCH] esx: drop dead code to silence Coverity
by Eric Blake
Coverity detected that the only way to get to the cleanup label
is if objectSpec had been successfully allocated, so the null
check was dead code.
* src/esx/esx_vi.c (esxVI_LookupObjectContentByType): Drop
redundant null check.
---
I'll wait for a review on this one.
src/esx/esx_vi.c | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/src/esx/esx_vi.c b/src/esx/esx_vi.c
index 4a8c709..8bcd76c 100644
--- a/src/esx/esx_vi.c
+++ b/src/esx/esx_vi.c
@@ -1763,11 +1763,8 @@ esxVI_LookupObjectContentByType(esxVI_Context *ctx,
* Remove values given by the caller from the data structures to prevent
* them from being freed by the call to esxVI_PropertyFilterSpec_Free().
*/
- if (objectSpec != NULL) {
- objectSpec->obj = NULL;
- objectSpec->selectSet = NULL;
- }
-
+ objectSpec->obj = NULL;
+ objectSpec->selectSet = NULL;
if (propertySpec != NULL) {
propertySpec->type = NULL;
propertySpec->pathSet = NULL;
--
1.7.4.4
13 years, 6 months
[libvirt] (no subject)
by Wayne Sun
For last patch of update migrate module, remote define domain is
deleted in migrate. Now add this function into define module in
this fix.
Also update modules which include create, define and
installation for the new option uuid added.
[test-API][PATCH 1/2] Update define module with remote define
[test-API][PATCH 2/2] Add optional argument uuid in create and install module
repos/domain/create.py | 6 +-
repos/domain/define.py | 141 +++------------------------------
repos/domain/install_image.py | 5 +-
repos/domain/install_linux_cdrom.py | 12 +--
repos/domain/install_linux_net.py | 13 +--
repos/domain/install_windows_cdrom.py | 12 +--
6 files changed, 29 insertions(+), 160 deletions(-)
13 years, 6 months
[libvirt] [PATCH] [libvirt-tck] vol->as_xml: fix backing store element
by Guido Günther
Fix typo that breaks setting the backing store format.
---
lib/Sys/Virt/TCK/StorageVolBuilder.pm | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/Sys/Virt/TCK/StorageVolBuilder.pm b/lib/Sys/Virt/TCK/StorageVolBuilder.pm
index 515795f..da90788 100644
--- a/lib/Sys/Virt/TCK/StorageVolBuilder.pm
+++ b/lib/Sys/Virt/TCK/StorageVolBuilder.pm
@@ -112,7 +112,7 @@ sub as_xml {
$w->startTag("backingStore");
$w->dataElement("path", $self->{backingFile});
if ($self->{backingFormat}) {
- $w->emptyTag("format", type => $self->{backinFormat});
+ $w->emptyTag("format", type => $self->{backingFormat});
}
if ($self->{secret}) {
$w->startTag("encryption", format => "qcow");
--
1.7.6.3
13 years, 6 months
[libvirt] [PATCH] Fix syntax problem in mingw32-libvirt.spec.in
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
When defining macros, you can't put comments on the end of the
line because they will get included in the macro definition
* mingw32-libvirt.spec.in: Fix comment about hyperv
---
mingw32-libvirt.spec.in | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
Pushed under the build-breaker rule
diff --git a/mingw32-libvirt.spec.in b/mingw32-libvirt.spec.in
index 57c67ae..521790c 100644
--- a/mingw32-libvirt.spec.in
+++ b/mingw32-libvirt.spec.in
@@ -10,7 +10,8 @@
# libraries exist.
%define with_phyp 0%{!?_without_phyp:1}
%define with_esx 0%{!?_without_esx:1}
-%define with_hyperv 0%{!?_without_hyperv:0} # missing libwsman
+# missing libwsman, so can't build hyper-v
+%define with_hyperv 0%{!?_without_hyperv:0}
%define with_xenapi 0%{!?_without_xenapi:1}
# RHEL ships ESX but not PowerHypervisor, HyperV, or libxenserver (xenapi)
--
1.7.6.4
13 years, 6 months