[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>
---
src/conf/network_conf.c | 34 +++++++++++++++++++++-
src/conf/network_conf.h | 1 +
src/network/bridge_driver.c | 8 +++++
.../nat-network-dns-forwarders.conf | 15 ++++++++++
.../nat-network-dns-forwarders.xml | 9 ++++++
tests/networkxml2conftest.c | 1 +
6 files changed, 67 insertions(+), 1 deletion(-)
create mode 100644 tests/networkxml2confdata/nat-network-dns-forwarders.conf
create mode 100644 tests/networkxml2confdata/nat-network-dns-forwarders.xml
diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c
index d54f2aa..99f12d2 100644
--- a/src/conf/network_conf.c
+++ b/src/conf/network_conf.c
@@ -175,6 +175,12 @@ virNetworkDNSSrvDefClear(virNetworkDNSSrvDefPtr def)
static void
virNetworkDNSDefClear(virNetworkDNSDefPtr def)
{
+ if (def->forwarders) {
+ size_t i;
+ for (i = 0; def->forwarders[i] != NULL; i++)
+ VIR_FREE(def->forwarders[i]);
+ VIR_FREE(def->forwarders);
+ }
if (def->txts) {
while (def->ntxts)
virNetworkDNSTxtDefClear(&def->txts[--def->ntxts]);
@@ -1038,6 +1044,7 @@ virNetworkDNSDefParseXML(const char *networkName,
xmlNodePtr *srvNodes = NULL;
xmlNodePtr *txtNodes = NULL;
char *forwardPlainNames = NULL;
+ char *forwarders = NULL;
int nhosts, nsrvs, ntxts;
size_t i;
int ret = -1;
@@ -1058,6 +1065,20 @@ virNetworkDNSDefParseXML(const char *networkName,
}
}
+ forwarders = virXPathString("string(./@forwarders)", ctxt);
+ if (forwarders) {
+ def->forwarders = virStringSplit(forwarders, ",", 0);
+ for (i = 0; def->forwarders[i] != NULL; i++) {
+ 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;
+ }
+ }
+ }
+
nhosts = virXPathNodeSet("./host", ctxt, &hostNodes);
if (nhosts < 0) {
virReportError(VIR_ERR_XML_ERROR,
@@ -1120,6 +1141,7 @@ virNetworkDNSDefParseXML(const char *networkName,
ret = 0;
cleanup:
+ VIR_FREE(forwarders);
VIR_FREE(forwardPlainNames);
VIR_FREE(hostNodes);
VIR_FREE(srvNodes);
@@ -2267,12 +2289,22 @@ 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->forwarders || def->nhosts || def->nsrvs || def->ntxts)) {
+ virBufferAddLit(buf, "/>\n");
+ goto out;
+ }
+ }
+
+ if (def->forwarders) {
+ char *forwarders = virStringJoin((const char **)def->forwarders, ",");
+ virBufferAsprintf(buf, " forwarders='%s'", forwarders);
if (!(def->nhosts || def->nsrvs || def->ntxts)) {
virBufferAddLit(buf, "/>\n");
goto out;
diff --git a/src/conf/network_conf.h b/src/conf/network_conf.h
index c28bfae..3bedc2f 100644
--- a/src/conf/network_conf.h
+++ b/src/conf/network_conf.h
@@ -122,6 +122,7 @@ struct _virNetworkDNSDef {
virNetworkDNSHostDefPtr hosts;
size_t nsrvs;
virNetworkDNSSrvDefPtr srvs;
+ char **forwarders;
};
typedef struct _virNetworkIpDef virNetworkIpDef;
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 3a8be90..c167254 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; network->def->dns.forwarders[i] != NULL; 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..ea6a54a
--- /dev/null
+++ b/tests/networkxml2confdata/nat-network-dns-forwarders.conf
@@ -0,0 +1,15 @@
+##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
+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..7955cc7
--- /dev/null
+++ b/tests/networkxml2confdata/nat-network-dns-forwarders.xml
@@ -0,0 +1,9 @@
+<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='8.8.8.8'/>
+ <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] [PATCH] Fix leaks in python bindings
by Ján Tomko
https://bugzilla.redhat.com/show_bug.cgi?id=1003828
---
python/libvirt-lxc-override.c | 1 +
python/libvirt-qemu-override.c | 3 +++
2 files changed, 4 insertions(+)
diff --git a/python/libvirt-lxc-override.c b/python/libvirt-lxc-override.c
index fa7e963..f76ff4b 100644
--- a/python/libvirt-lxc-override.c
+++ b/python/libvirt-lxc-override.c
@@ -92,6 +92,7 @@ libvirt_lxc_virDomainLxcOpenNamespace(PyObject *self ATTRIBUTE_UNUSED,
goto error;
}
}
+ VIR_FREE(fdlist);
return py_retval;
error:
diff --git a/python/libvirt-qemu-override.c b/python/libvirt-qemu-override.c
index 8f1ce5e..6249031 100644
--- a/python/libvirt-qemu-override.c
+++ b/python/libvirt-qemu-override.c
@@ -21,6 +21,7 @@
#include <libvirt/virterror.h>
#include "typewrappers.h"
#include "libvirt-qemu.h"
+#include "viralloc.h"
#ifndef __CYGWIN__
extern void initlibvirtmod_qemu(void);
@@ -79,6 +80,7 @@ libvirt_qemu_virDomainQemuMonitorCommand(PyObject *self ATTRIBUTE_UNUSED,
return VIR_PY_NONE;
py_retval = PyString_FromString(result);
+ VIR_FREE(result);
return py_retval;
}
@@ -108,6 +110,7 @@ libvirt_qemu_virDomainQemuAgentCommand(PyObject *self ATTRIBUTE_UNUSED, PyObject
return VIR_PY_NONE;
py_retval = PyString_FromString(result);
+ VIR_FREE(result);
return py_retval;
}
/************************************************************************
--
1.8.1.5
11 years, 2 months
[libvirt] [PATCH] qemu: Handle huge number of queues correctly
by Michal Privoznik
Currently, kernel supports up to 8 queues for a multiqueue tap device.
However, if user tries to enter a huge number (e.g. one million) the tap
allocation fails, as expected. But what is not expected is the log full
of warnings:
warning : virFileClose:83 : Tried to close invalid fd 0
The problem is, upon error we iterate over an array of FDs (handlers to
queues) and VIR_FORCE_CLOSE() over each item. However, the array is
pre-filled with zeros. Hence, we repeatedly close stdin. Ouch.
But there's more. The queues allocation is done in virNetDevTapCreate()
which cleans up the FDs in case of error. Then, its caller, the
virNetDevTapCreateInBridgePort() iterates over the FD array and tries to
close them too. And so does qemuNetworkIfaceConnect() and
qemuBuildInterfaceCommandLine().
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_command.c | 10 +++++++---
src/util/virnetdevtap.c | 4 ++--
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index f8fccea..73a13b3 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -405,7 +405,7 @@ qemuNetworkIfaceConnect(virDomainDefPtr def,
cleanup:
if (ret < 0) {
size_t i;
- for (i = 0; i < *tapfdSize; i++)
+ for (i = 0; i < *tapfdSize && tapfd[i] >= 0; i++)
VIR_FORCE_CLOSE(tapfd[i]);
if (template_ifname)
VIR_FREE(net->ifname);
@@ -7241,6 +7241,8 @@ qemuBuildInterfaceCommandLine(virCommandPtr cmd,
VIR_ALLOC_N(tapfdName, tapfdSize) < 0)
goto cleanup;
+ memset(tapfd, -1, tapfdSize * sizeof(tapfd[0]));
+
if (qemuNetworkIfaceConnect(def, conn, driver, net,
qemuCaps, tapfd, &tapfdSize) < 0)
goto cleanup;
@@ -7268,6 +7270,8 @@ qemuBuildInterfaceCommandLine(virCommandPtr cmd,
VIR_ALLOC_N(vhostfdName, vhostfdSize))
goto cleanup;
+ memset(vhostfd, -1, vhostfdSize * sizeof(vhostfd[0]));
+
if (qemuOpenVhostNet(def, net, qemuCaps, vhostfd, &vhostfdSize) < 0)
goto cleanup;
}
@@ -7329,13 +7333,13 @@ qemuBuildInterfaceCommandLine(virCommandPtr cmd,
cleanup:
if (ret < 0)
virDomainConfNWFilterTeardown(net);
- for (i = 0; tapfd && i < tapfdSize; i++) {
+ for (i = 0; tapfd && i < tapfdSize && tapfd[i] >= 0; i++) {
if (ret < 0)
VIR_FORCE_CLOSE(tapfd[i]);
if (tapfdName)
VIR_FREE(tapfdName[i]);
}
- for (i = 0; vhostfd && i < vhostfdSize; i++) {
+ for (i = 0; vhostfd && i < vhostfdSize && vhostfd[i] >= 0; i++) {
if (ret < 0)
VIR_FORCE_CLOSE(vhostfd[i]);
if (vhostfdName)
diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c
index 42e8dfe..dc2c224 100644
--- a/src/util/virnetdevtap.c
+++ b/src/util/virnetdevtap.c
@@ -498,8 +498,8 @@ int virNetDevTapCreateInBridgePort(const char *brname,
return 0;
error:
- while (tapfdSize)
- VIR_FORCE_CLOSE(tapfd[--tapfdSize]);
+ while (tapfdSize && tapfd[--tapfdSize] >= 0)
+ VIR_FORCE_CLOSE(tapfd[tapfdSize]);
return -1;
}
--
1.8.1.5
11 years, 2 months
[libvirt] [PATCH v2] kvm: warn if num cpus is greater than num recommended
by Andrew Jones
The comment in kvm_max_vcpus() states that it's using the recommended
procedure from the kernel API documentation to get the max number
of vcpus that kvm supports. It is, but by always returning the
maximum number supported. The maximum number should only be used
for development purposes. qemu should check KVM_CAP_NR_VCPUS for
the recommended number of vcpus. This patch adds a warning if a user
specifies a number of cpus between the recommended and max.
v2:
Incorporate tests for max_cpus, which specifies the maximum number
of hotpluggable cpus. An additional note is that the message for
the fail case was slightly changed, 'exceeds max cpus' to
'exceeds the maximum cpus'. If this is unacceptable change for
users like libvirt, then I'll need to spin a v3.
Signed-off-by: Andrew Jones <drjones(a)redhat.com>
---
kvm-all.c | 69 ++++++++++++++++++++++++++++++++++++---------------------------
1 file changed, 40 insertions(+), 29 deletions(-)
diff --git a/kvm-all.c b/kvm-all.c
index a2d49786365e3..021f5f47e53da 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -1322,24 +1322,20 @@ static int kvm_irqchip_create(KVMState *s)
return 0;
}
-static int kvm_max_vcpus(KVMState *s)
+/* Find number of supported CPUs using the recommended
+ * procedure from the kernel API documentation to cope with
+ * older kernels that may be missing capabilities.
+ */
+static int kvm_recommended_vcpus(KVMState *s)
{
- int ret;
-
- /* Find number of supported CPUs using the recommended
- * procedure from the kernel API documentation to cope with
- * older kernels that may be missing capabilities.
- */
- ret = kvm_check_extension(s, KVM_CAP_MAX_VCPUS);
- if (ret) {
- return ret;
- }
- ret = kvm_check_extension(s, KVM_CAP_NR_VCPUS);
- if (ret) {
- return ret;
- }
+ int ret = kvm_check_extension(s, KVM_CAP_NR_VCPUS);
+ return (ret) ? ret : 4;
+}
- return 4;
+static int kvm_max_vcpus(KVMState *s)
+{
+ int ret = kvm_check_extension(s, KVM_CAP_MAX_VCPUS);
+ return (ret) ? ret : kvm_recommended_vcpus(s);
}
int kvm_init(void)
@@ -1347,11 +1343,19 @@ int kvm_init(void)
static const char upgrade_note[] =
"Please upgrade to at least kernel 2.6.29 or recent kvm-kmod\n"
"(see http://sourceforge.net/projects/kvm).\n";
+ struct {
+ const char *name;
+ int num;
+ } num_cpus[] = {
+ { "SMP", smp_cpus },
+ { "hotpluggable", max_cpus },
+ { NULL, }
+ }, *nc = num_cpus;
+ int soft_vcpus_limit, hard_vcpus_limit;
KVMState *s;
const KVMCapabilityInfo *missing_cap;
int ret;
int i;
- int max_vcpus;
s = g_malloc0(sizeof(KVMState));
@@ -1392,19 +1396,26 @@ int kvm_init(void)
goto err;
}
- max_vcpus = kvm_max_vcpus(s);
- if (smp_cpus > max_vcpus) {
- ret = -EINVAL;
- fprintf(stderr, "Number of SMP cpus requested (%d) exceeds max cpus "
- "supported by KVM (%d)\n", smp_cpus, max_vcpus);
- goto err;
- }
+ /* check the vcpu limits */
+ soft_vcpus_limit = kvm_recommended_vcpus(s);
+ hard_vcpus_limit = kvm_max_vcpus(s);
- if (max_cpus > max_vcpus) {
- ret = -EINVAL;
- fprintf(stderr, "Number of hotpluggable cpus requested (%d) exceeds max cpus "
- "supported by KVM (%d)\n", max_cpus, max_vcpus);
- goto err;
+ while (nc->name) {
+ if (nc->num > soft_vcpus_limit) {
+ fprintf(stderr,
+ "Warning: Number of %s cpus requested (%d) exceeds "
+ "the recommended cpus supported by KVM (%d)\n",
+ nc->name, nc->num, soft_vcpus_limit);
+
+ if (nc->num > hard_vcpus_limit) {
+ ret = -EINVAL;
+ fprintf(stderr, "Number of %s cpus requested (%d) exceeds "
+ "the maximum cpus supported by KVM (%d)\n",
+ nc->name, nc->num, hard_vcpus_limit);
+ goto err;
+ }
+ }
+ nc++;
}
s->vmfd = kvm_ioctl(s, KVM_CREATE_VM, 0);
--
1.8.1.4
11 years, 2 months
[libvirt] [PATCH] Drop ChangeLog generation
by Cole Robinson
Fedora is perpetually low on space for its live cd, and a bug was filed
asking libvirt to drop the rather large ChangeLog from the RPM:
https://bugzilla.redhat.com/show_bug.cgi?id=977099
Really though, what's the point of a static ChangeLog these days? git
has won, and is far more useful for querying log info than a large
static blob.
This patch drops the ChangeLog generation. In its place there's now
a small stub file pointing to the online git log.
Additionally, the RPM was installing the ChangeLog and other doc
bits twice, once with the daemon and once with the client. Drop the
docs from the daemon package, it requires the client anyways.
---
I clipped the removal of ChangeLog-old since it exceeded mail size for
the list.
.gitignore | 1 -
ChangeLog | 8 +
ChangeLog-old | 16699 ------------------------------------------------------
Makefile.am | 15 +-
bootstrap.conf | 4 +-
cfg.mk | 2 +-
libvirt.spec.in | 4 +-
7 files changed, 13 insertions(+), 16720 deletions(-)
create mode 100644 ChangeLog
delete mode 100644 ChangeLog-old
diff --git a/.gitignore b/.gitignore
index 8a94748..07594f4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -28,7 +28,6 @@
.sc-start-sc_*
/ABOUT-NLS
/AUTHORS
-/ChangeLog
/GNUmakefile
/INSTALL
/NEWS
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..13c0fa4
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,8 @@
+The git repository log is the canonical changelog. It can be viewed online
+at:
+
+http://libvirt.org/git/?p=libvirt.git;a=log
+
+The historical ChangeLog from pre-git times is at:
+
+http://libvirt.org/git/?p=libvirt.git;a=blob;f=ChangeLog-old;h=b5d44d5dced1382e62b43db7e16614231aeb15dd;hb=HEAD
diff --git a/Makefile.am b/Makefile.am
index 4e24ecf..92ba1d4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -31,7 +31,6 @@ XML_EXAMPLES = \
test/*.xml storage/*.xml)))
EXTRA_DIST = \
- ChangeLog-old \
libvirt.spec libvirt.spec.in \
mingw-libvirt.spec.in \
libvirt.pc.in \
@@ -95,19 +94,7 @@ MAINTAINERCLEANFILES = .git-module-status
# disable this check
distuninstallcheck:
-dist-hook: gen-ChangeLog gen-AUTHORS
-
-# Generate the ChangeLog file (with all entries since the switch to git)
-# and insert it into the directory we're about to use to create a tarball.
-gen_start_date = 2009-07-04
-.PHONY: gen-ChangeLog
-gen-ChangeLog:
- $(AM_V_GEN)if test -d .git; then \
- $(top_srcdir)/build-aux/gitlog-to-changelog \
- --since=$(gen_start_date) > $(distdir)/cl-t; \
- rm -f $(distdir)/ChangeLog; \
- mv $(distdir)/cl-t $(distdir)/ChangeLog; \
- fi
+dist-hook: gen-AUTHORS
.PHONY: gen-AUTHORS
gen-AUTHORS:
diff --git a/bootstrap.conf b/bootstrap.conf
index 68c4a89..63f79c9 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -228,8 +228,8 @@ if `(${PYTHON_CONFIG-python-config} --version;
PYTHON_CONFIG=true
fi
-# Automake requires that ChangeLog and AUTHORS exist.
-touch AUTHORS ChangeLog || exit 1
+# Automake requires that AUTHORS exists.
+touch AUTHORS || exit 1
# Override bootstrap's list - we don't use mdate-sh or texinfo.tex.
gnulib_extra_files="
diff --git a/cfg.mk b/cfg.mk
index 9a9616c..d223e48 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -874,7 +874,7 @@ ifeq (0,$(MAKELEVEL))
_clean_requested = $(filter %clean,$(MAKECMDGOALS))
ifeq (1,$(_update_required)$(_clean_requested))
$(info INFO: gnulib update required; running ./autogen.sh first)
- $(shell touch $(srcdir)/AUTHORS $(srcdir)/ChangeLog)
+ $(shell touch $(srcdir)/AUTHORS)
maint.mk Makefile: _autogen
endif
endif
diff --git a/libvirt.spec.in b/libvirt.spec.in
index 85881ae..dd9702e 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -1413,7 +1413,6 @@ of recent versions of Linux (and other OSes).
--enable-expensive-tests \
%{init_scripts}
make %{?_smp_mflags}
-gzip -9 ChangeLog
%install
rm -fr %{buildroot}
@@ -1739,7 +1738,6 @@ fi
%files daemon
%defattr(-, root, root)
-%doc AUTHORS ChangeLog.gz NEWS README COPYING COPYING.LESSER TODO
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/
%if %{with_network}
@@ -2011,7 +2009,7 @@ fi
%files client -f %{name}.lang
%defattr(-, root, root)
-%doc AUTHORS ChangeLog.gz NEWS README COPYING COPYING.LESSER TODO
+%doc AUTHORS ChangeLog NEWS README COPYING COPYING.LESSER TODO
%config(noreplace) %{_sysconfdir}/libvirt/libvirt.conf
%config(noreplace) %{_sysconfdir}/libvirt/virt-login-shell.conf
--
1.8.3.1
11 years, 2 months
[libvirt] [PATCH 0/3] virsh: Handle interrupting of jobs manually
by Peter Krempa
Using Ctrl+C to abort migration has a side effect of killing
ssh transports used to execute the migration. Add manual handling
to avoid this issue.
Peter Krempa (3):
virsh-domain: rename print_job_progress to vshPrintJobProgress
virsh: Remember terminal state when starting and add helpers
virsh-domain: Avoid killing ssh transport tunnels when cancelling job
tools/virsh-domain.c | 65 +++++++++++++++++++++++++++++++++-------------------
tools/virsh.c | 54 +++++++++++++++++++++++++++++++++++++++++++
tools/virsh.h | 9 ++++++++
3 files changed, 105 insertions(+), 23 deletions(-)
--
1.8.3.2
11 years, 2 months
[libvirt] Is virsh blockcommit supported? Thanks a lot
by Guozhonghua
I had test the command virsh blockcommit, but it failed, with the libvirt version 1.1.0, and qemu version 1.6.0.
Is this feature being developing? Thanks
root@cvk-31:/vms/images# virsh -v
1.1.0
root@cvk-31:/vms/images# qemu-img -V
qemu-img version 1.6.0, Copyright (c) 2004-2008 Fabrice Bellard
usage: qemu-img command [command options]
root@cvk-31:/vms/images# virsh blockcommit Vmtest /vms/images/Vmtest1 --base /vms/image
s/Vmtest1_base --top /vms/images/Vmtest1_base_1 --wait --verbose ;echo $?
error: invalid argument: top '/vms/images/Vmtest1_base_1' in chain for '/vms/images/Vmtest1' has no backing file
1
root@cvk-31:/vms/images# qemu-img info /vms/images/Vmtest1_base_1
image: /vms/images/Vmtest1_base_1
file format: qcow2
virtual size: 9.8G (10485760000 bytes)
disk size: 6.0M
cluster_size: 2097152
backing file: /vms/images/Vmtest1_base
root@cvk-31:/vms/images# qemu-img info --backing-chain /vms/images/Vmtest1
image: /vms/images/Vmtest1
file format: qcow2
virtual size: 9.8G (10485760000 bytes)
disk size: 140M
cluster_size: 2097152
backing file: /vms/images/Vmtest1_base_1
image: /vms/images/Vmtest1_base_1
file format: qcow2
virtual size: 9.8G (10485760000 bytes)
disk size: 6.0M
cluster_size: 2097152
backing file: /vms/images/Vmtest1_base
image: /vms/images/Vmtest1_base
file format: qcow2
virtual size: 9.8G (10485760000 bytes)
disk size: 3.4G
cluster_size: 2097152
root@cvk-31:/vms/images# virsh blockcommit Vmtest /vms/images/Vmtest1 --base /vms/image
s/Vmtest1_base --wait --verbose ;echo $?
error: invalid argument: could not find base '/vms/images/Vmtest1_base' below '/vms/images/Vmtest1' in chain for '/vms/images/Vmtest1'
1
root@cvk-31:/vms/images# ls -al /vms/images/Vmtest1_base
-rw------- 1 root root 3705667584 Aug 23 10:19 /vms/images/Vmtest1_base
root@cvk-31:/vms/images# qemu-img info /vms/images/Vmtest1_base
image: /vms/images/Vmtest1_base
file format: qcow2
virtual size: 9.8G (10485760000 bytes)
disk size: 3.4G
cluster_size: 2097152
-------------------------------------------------------------------------------------------------------------------------------------
????????????????????????????????????????
????????????????????????????????????????
????????????????????????????????????????
???
This e-mail and its attachments contain confidential information from H3C, which is
intended only for the person or entity whose address is listed above. Any use of the
information contained herein in any way (including, but not limited to, total or partial
disclosure, reproduction, or dissemination) by persons other than the intended
recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender
by phone or email immediately and delete it!
11 years, 2 months
[libvirt] [PATCHv3 0/4] VMX: CD-ROM handling improvements
by Doug Goldstein
A user came into #virt the other day and was trying to get libvirtd
to work with VMWare Fusion 5, which is basically the Mac OS X version of
VMWare Workstation. In helping him out I noticed a few limitations of our
VMX parser so I've added support through this patchset. However I came
across the fact that we only support 2 types of CD-ROMs instead of the 3
types that VMWare has lead to adding support for a <driver> element to
CD-ROM drives.
v3:
* Dropped 'auto detect' support from series as it needs more work based on
feedback
* Added patch to combine virVMXFormatHardDisk and virVMXFormatCDROM into
one function.
* Converted to <disk type='block' device='lun'> instead of adding a
<driver> element to better match the behavior available via QEMU.
v2:
* Added additional test cases and fixed issues that arose from those
Doug Goldstein (4):
VMX: Create virVMXFormatDisk() from HD and CD-ROM
VMX: Add cdrom-raw dev type from VMWare Fusion
VMX: Add a VMWare Fusion 5 configuration for tests
VMX: Some serial ports are not actually connected
docs/formatdomain.html.in | 3 +-
src/libvirt_vmx.syms | 3 +-
src/vmx/vmx.c | 216 ++++++++-------------
src/vmx/vmx.h | 5 +-
tests/vmx2xmldata/vmx2xml-cdrom-ide-raw-device.vmx | 5 +
tests/vmx2xmldata/vmx2xml-cdrom-ide-raw-device.xml | 24 +++
.../vmx2xmldata/vmx2xml-cdrom-scsi-raw-device.vmx | 6 +
.../vmx2xmldata/vmx2xml-cdrom-scsi-raw-device.xml | 24 +++
tests/vmx2xmldata/vmx2xml-fusion-in-the-wild-1.vmx | 88 +++++++++
tests/vmx2xmldata/vmx2xml-fusion-in-the-wild-1.xml | 38 ++++
tests/vmx2xmltest.c | 4 +
tests/xml2vmxdata/xml2vmx-cdrom-ide-raw-device.vmx | 13 ++
tests/xml2vmxdata/xml2vmx-cdrom-ide-raw-device.xml | 14 ++
.../xml2vmxdata/xml2vmx-cdrom-scsi-raw-device.vmx | 14 ++
.../xml2vmxdata/xml2vmx-cdrom-scsi-raw-device.xml | 14 ++
tests/xml2vmxdata/xml2vmx-fusion-in-the-wild-1.vmx | 30 +++
tests/xml2vmxdata/xml2vmx-fusion-in-the-wild-1.xml | 40 ++++
tests/xml2vmxtest.c | 4 +
18 files changed, 400 insertions(+), 145 deletions(-)
create mode 100644 tests/vmx2xmldata/vmx2xml-cdrom-ide-raw-device.vmx
create mode 100644 tests/vmx2xmldata/vmx2xml-cdrom-ide-raw-device.xml
create mode 100644 tests/vmx2xmldata/vmx2xml-cdrom-scsi-raw-device.vmx
create mode 100644 tests/vmx2xmldata/vmx2xml-cdrom-scsi-raw-device.xml
create mode 100644 tests/vmx2xmldata/vmx2xml-fusion-in-the-wild-1.vmx
create mode 100644 tests/vmx2xmldata/vmx2xml-fusion-in-the-wild-1.xml
create mode 100644 tests/xml2vmxdata/xml2vmx-cdrom-ide-raw-device.vmx
create mode 100644 tests/xml2vmxdata/xml2vmx-cdrom-ide-raw-device.xml
create mode 100644 tests/xml2vmxdata/xml2vmx-cdrom-scsi-raw-device.vmx
create mode 100644 tests/xml2vmxdata/xml2vmx-cdrom-scsi-raw-device.xml
create mode 100644 tests/xml2vmxdata/xml2vmx-fusion-in-the-wild-1.vmx
create mode 100644 tests/xml2vmxdata/xml2vmx-fusion-in-the-wild-1.xml
--
1.8.1.5
11 years, 2 months
[libvirt] [PATCH 1/2] Fix AM_LDFLAGS typo
by Guido Günther
---
This should probably go into 1.1.2
src/Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index 636bcbc..19dfb81 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1455,7 +1455,7 @@ libvirt_driver_nwfilter_la_CFLAGS = \
-I$(top_srcdir)/src/access \
-I$(top_srcdir)/src/conf \
$(AM_CFLAGS)
-libvirt_driver_nwfilter_la_LDFLAGS = $(LD_AMFLAGS)
+libvirt_driver_nwfilter_la_LDFLAGS = $(AM_LDFLAGS)
libvirt_driver_nwfilter_la_LIBADD = $(LIBPCAP_LIBS) $(LIBNL_LIBS) $(DBUS_LIBS)
if WITH_DRIVER_MODULES
libvirt_driver_nwfilter_la_LIBADD += ../gnulib/lib/libgnu.la
--
1.8.4.rc3
11 years, 2 months
[libvirt] How to add uplink in esx virtual switch using libvirt
by varun bhatnagar
Hi,
I have an ESXi server, on top of it I have created one VM whose IP address
is 192.168.79.1.
I want to connect to the VM on ESXi server from my host machine but I am
not able to do it.
I have created a network "networkforSC" and I have pasted my xml file
content below but I am not able to add any uplink (how to add it?) .
Below is the xml file of my node as well as the network which I am creating
on my ESXi server
*<domain type='vmware'>*
*<name>testNode</name>*
*<uuid>50115e16-9bdc-49d7-f171-53c4d7f91710</uuid>*
*<memory>1048576</memory>*
*<currentMemory>1048576</currentMemory>*
*<vcpu>1</vcpu>*
*<console>/dev/console</console>*
*<os>*
*<type arch='x86_64'>hvm</type>*
*</os>*
*<devices>*
*<disk type='file' device='disk'>*
*<source file='[datastore1] testNode/testNode.vmdk'/>*
*<target dev='sda' bus='scsi'/>*
*<address type='drive' controller='0' bus='0' unit='0'/>*
*</disk>*
*<controller type='scsi' index='0' model='lsilogic'/>*
*<!--controller type='scsi' index='0'/-->*
*<interface type='bridge'>*
*<mac address='00:50:56:25:48:c7'/>*
*<source bridge='VM Network'/>*
*</interface>*
*<interface type='bridge'>*
*<source bridge='test'/>*
*</interface>*
*</devices>*
*</domain>*
##########################################
Network File:
*<network>*
*<name>networkforSC</name>*
*<portgroup name='test'>*
*</portgroup>*
*</network>*
I have checked the network which got created on the server.
As I have not attached any uplink (vmnic0) I can not see it (I want to
attach it).
#esxcli network vswitch standard list
*
*
*networkforSC*
*Name: networkforSC*
*Class: etherswitch*
*Num Ports: 128*
*Used Ports: 2*
*Configured Ports: 128*
*MTU: 1500*
*CDP Status: listen*
*Beacon Enabled: false*
*Beacon Threshold: 3*
*Beacon Required By:*
*Uplinks:*
*Portgroups: test*
Can anyone please help me out in adding the uplink and also can anyone tell
me whether I am going in a right direction so that I could ping my virtual
machine created on ESXi server.
Regards,
Varun
11 years, 2 months