Re: [libvirt] Entering freeze for libvirt-1.1.1
by Daniel Veillard
On Fri, Jul 26, 2013 at 06:01:23AM -0400, Alex Jia wrote:
> Hello Daniel,
> I gave a basic try for libvirt-1.1.1-rc1 on RHEL6.
>
> [root@202 libvirt-1.1.1]# make
>
> Notes, sometimes, I can meet the following errors, it's not reproducible each time,
> maybe, it's a network issue.
>
> <slice>
>
> I/O error : Attempt to load network entity http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
> formatdomain.html.in:2: warning: failed to load external entity "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
> C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
> ^
> formatdomain.html.in:4582: parser error : Entity 'mdash' not defined
> <li> 'i6300esb' — the recommended device,
you need to install xhtml1-dtds for local validation of generated HTML
[...]
> TEST: virnetsockettest
> ........!!!.!!! 15 FAIL
weird ...
> Notes, works well with PATH environment setting, but it still is failed for
> running 'make -C tests valgrind' due to previous 'make check' fails, whether
> we my bypass/fix this for 'make check'. BTW, I also checked libvirt upstream
> with "make -C tests valgrind", it's fine and without memory leaks.
>
>
> [root@202 libvirt-1.1.1]# make syntax-check
> GEN HACKING
> GEN bracket-spacing-check
> ./build-aux/vc-list-files: Failed to determine type of version control used in /home/ajia/Workspace/rc1/libvirt-1.1.1
> Can't open perl script "./build-aux/bracket-spacing.pl": No such file or directory
> maint.mk: incorrect whitespace, see HACKING for rules
> make: *** [bracket-spacing-check] Error 1
>
> [root@202 libvirt-1.1.1]# ls ./build-aux/bracket-spacing.pl
> ls: cannot access ./build-aux/bracket-spacing.pl: No such file or directory
>
> Notes, it's okay on libvirt upstream and can find ./build-aux/bracket-spacing.pl file.
>
>
> To run coverity on libvirt-1.1.1-rc1 and attach report as an attachment.
thanks !
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, 5 months
[libvirt] [PATCH] build: avoid uninitialized use warning
by Eric Blake
Otherwise, with new enough gcc compiling at -O2, the build fails with:
../../src/conf/domain_conf.c: In function ‘virDomainDeviceDefPostParse’:
../../src/conf/domain_conf.c:2821:29: error: ‘cnt’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
for (i = 0; i < *cnt; i++) {
^
../../src/conf/domain_conf.c:2795:20: note: ‘cnt’ was declared here
size_t i, *cnt;
^
../../src/conf/domain_conf.c:2794:30: error: ‘arrPtr’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
virDomainChrDefPtr **arrPtr;
^
* src/conf/domain_conf.c (virDomainChrGetDomainPtrs): Always
assign into output parameters.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
Pushing under the build-breaker rule.
I actually found this while running ./autobuild.sh; but there,
we run libtool in both static and shared modes, and libtool, in
its "infinite wisdom", assumes that if the static build succeeds,
then the shared build can have compiler output redirected to
/dev/null, which meant I was stuck debugging this output:
CC libvirt_driver_test_la-test_driver.lo
CC libvirt_driver_remote_la-remote_driver.lo
CC libvirt_driver_remote_la-remote_protocol.lo
make[3]: *** [libvirt_conf_la-domain_conf.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
thanks for nothing, libtool.
src/conf/domain_conf.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 0e74039..a86be8c 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -10221,6 +10221,8 @@ virDomainChrGetDomainPtrs(virDomainDefPtr vmdef,
break;
case VIR_DOMAIN_CHR_DEVICE_TYPE_LAST:
+ *arrPtr = NULL;
+ *cntPtr = NULL;
break;
}
}
--
1.8.3.1
11 years, 5 months
[libvirt] [PATCH] Fix probing of legacy Xen driver to not leave URI set
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
When the legacy Xen driver probes with a NULL URI, and
finds itself running on Xen, it will set conn->uri. A
little bit later though it checks to see if libxl support
exists, and if so declines the driver. This leaves the
conn->uri set to 'xen:///', so if libxl also declines
it, it prevents probing of the QEMU driver.
Once a driver has set the conn->uri, it must *never*
decline an open request. So we must move the libxl
check earlier
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
src/xen/xen_driver.c | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c
index 39334b7..4ae38d3 100644
--- a/src/xen/xen_driver.c
+++ b/src/xen/xen_driver.c
@@ -365,6 +365,13 @@ xenUnifiedConnectOpen(virConnectPtr conn, virConnectAuthPtr auth, unsigned int f
if (!xenUnifiedProbe())
return VIR_DRV_OPEN_DECLINED;
+#ifdef WITH_LIBXL
+ /* Decline xen:// URI if xend is not running and libxenlight
+ * driver is potentially available. */
+ if (!xenUnifiedXendProbe())
+ return VIR_DRV_OPEN_DECLINED;
+#endif
+
if (!(conn->uri = virURIParse("xen:///")))
return VIR_DRV_OPEN_ERROR;
} else {
@@ -374,6 +381,12 @@ xenUnifiedConnectOpen(virConnectPtr conn, virConnectAuthPtr auth, unsigned int f
STRCASENEQ(conn->uri->scheme, "http"))
return VIR_DRV_OPEN_DECLINED;
+#ifdef WITH_LIBXL
+ /* Decline xen:// URI if xend is not running and libxenlight
+ * driver is potentially available. */
+ if (!xenUnifiedXendProbe())
+ return VIR_DRV_OPEN_DECLINED;
+#endif
/* Return an error if the path isn't '' or '/' */
if (conn->uri->path &&
@@ -395,13 +408,6 @@ xenUnifiedConnectOpen(virConnectPtr conn, virConnectAuthPtr auth, unsigned int f
}
}
-#ifdef WITH_LIBXL
- /* Decline xen:// URI if xend is not running and libxenlight
- * driver is potentially available. */
- if (!xenUnifiedXendProbe())
- return VIR_DRV_OPEN_DECLINED;
-#endif
-
/* We now know the URI is definitely for this driver, so beyond
* here, don't return DECLINED, always use ERROR */
--
1.8.3.1
11 years, 5 months
[libvirt] [PATCH] Set default partition in libvirtd instead of libvirt_lxc
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
By setting the default partition in libvirt_lxc it is not
visible when querying the live XML. Move setting of the
default partition into libvirtd virLXCProcessStart
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
src/lxc/lxc_cgroup.c | 14 --------------
src/lxc/lxc_process.c | 14 ++++++++++++++
2 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/src/lxc/lxc_cgroup.c b/src/lxc/lxc_cgroup.c
index af91b04..0b0ca02 100644
--- a/src/lxc/lxc_cgroup.c
+++ b/src/lxc/lxc_cgroup.c
@@ -433,20 +433,6 @@ virCgroupPtr virLXCCgroupCreate(virDomainDefPtr def)
{
virCgroupPtr cgroup = NULL;
- if (!def->resource) {
- virDomainResourceDefPtr res;
-
- if (VIR_ALLOC(res) < 0)
- goto cleanup;
-
- if (VIR_STRDUP(res->partition, "/machine") < 0) {
- VIR_FREE(res);
- goto cleanup;
- }
-
- def->resource = res;
- }
-
if (def->resource->partition[0] != '/') {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Resource partition '%s' must start with '/'"),
diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c
index 1a5686f..247e516 100644
--- a/src/lxc/lxc_process.c
+++ b/src/lxc/lxc_process.c
@@ -1007,6 +1007,20 @@ int virLXCProcessStart(virConnectPtr conn,
return -1;
}
+ if (!vm->def->resource) {
+ virDomainResourceDefPtr res;
+
+ if (VIR_ALLOC(res) < 0)
+ goto cleanup;
+
+ if (VIR_STRDUP(res->partition, "/machine") < 0) {
+ VIR_FREE(res);
+ goto cleanup;
+ }
+
+ vm->def->resource = res;
+ }
+
if (virAsprintf(&logfile, "%s/%s.log",
cfg->logDir, vm->def->name) < 0)
return -1;
--
1.8.1.4
11 years, 5 months
[libvirt] [PATCH v2 0/2] Split driver StateAutoStart from StateInitialization
by John Ferlan
This is an update to change the 'int' AutoStart function to 'void' as
was discussed in the initial review:
https://www.redhat.com/archives/libvir-list/2013-July/msg01674.html
John Ferlan (2):
Separate out StateAutoStart from StateInitialize
virStateDriver - Separate AutoStart from Initialize
src/driver.h | 4 ++++
src/libvirt.c | 14 +++++++++++++-
src/libxl/libxl_driver.c | 16 +++++++++++++---
src/lxc/lxc_driver.c | 16 ++++++++++++++--
src/network/bridge_driver.c | 18 +++++++++++++++++-
src/qemu/qemu_driver.c | 17 +++++++++++++++--
src/storage/storage_driver.c | 18 +++++++++++++++++-
src/uml/uml_driver.c | 17 +++++++++++++++--
8 files changed, 108 insertions(+), 12 deletions(-)
--
1.8.1.4
11 years, 5 months
[libvirt] [PATCH 0/7] Probe QEMU binary for host CPU and use it for computations
by Jiri Denemark
Since QEMU and kvm may filter some host CPU features or add efficiently
emulated features, asking QEMU binary for host CPU data provides
better results when we later use the data for building guest CPUs.
Jiri Denemark (7):
cpu: Add support for loading and storing CPU data
cpu: Export few x86-specific APIs
x86: Ignore CPUID functions greater than 10
qemu: Add monitor APIs to fetch CPUID data from QEMU
qemu: Make QMP probing process reusable
qemu: Probe QEMU binary for host CPU
qemu: Use host CPU from QEMU for computations
src/cpu/cpu.c | 41 ++++
src/cpu/cpu.h | 13 ++
src/cpu/cpu_x86.c | 161 +++++++++++---
src/cpu/cpu_x86.h | 10 +
src/cpu/cpu_x86_data.h | 1 +
src/libvirt_private.syms | 9 +
src/qemu/qemu_capabilities.c | 234 ++++++++++++++-------
src/qemu/qemu_capabilities.h | 2 +
src/qemu/qemu_command.c | 32 ++-
src/qemu/qemu_domain.c | 21 +-
src/qemu/qemu_monitor.c | 21 ++
src/qemu/qemu_monitor.h | 3 +
src/qemu/qemu_monitor_json.c | 162 ++++++++++++++
src/qemu/qemu_monitor_json.h | 6 +
tests/Makefile.am | 1 +
.../qemumonitorjson-getcpu-empty.data | 2 +
.../qemumonitorjson-getcpu-empty.json | 46 ++++
.../qemumonitorjson-getcpu-filtered.data | 4 +
.../qemumonitorjson-getcpu-filtered.json | 46 ++++
.../qemumonitorjson-getcpu-full.data | 4 +
.../qemumonitorjson-getcpu-full.json | 46 ++++
.../qemumonitorjson-getcpu-host.data | 5 +
.../qemumonitorjson-getcpu-host.json | 45 ++++
tests/qemumonitorjsontest.c | 74 +++++++
24 files changed, 881 insertions(+), 108 deletions(-)
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-getcpu-empty.data
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-getcpu-empty.json
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-getcpu-filtered.data
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-getcpu-filtered.json
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-getcpu-full.data
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-getcpu-full.json
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-getcpu-host.data
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-getcpu-host.json
--
1.8.3.2
11 years, 5 months
[libvirt] [PATCH 0/4] fix two issues about diskchain
by Guannan Ren
1, Report an backing missing error on guest boot if its disks have
broken backing file chain
2, List volume even if its diskchain is broken
Guannan Ren(4)
[PATCH 1/4] qemu: refactor qemuDomainCheckDiskPresence for only disk
[PATCH 2/4] qemu: report error if disk backing files doesn't exist
[PATCH 3/4] qemu: check presence of each disk in chain
[PATCH 4/4] storage: list volumes even if its diskchain is broken
src/qemu/qemu_domain.c | 108 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------
src/qemu/qemu_process.c | 7 -------
src/storage/storage_backend_fs.c | 4 +++-
src/util/virstoragefile.c | 23 +++++++++++++++--------
tests/virstoragetest.c | 16 ++++++++--------
5 files changed, 90 insertions(+), 68 deletions(-)
11 years, 5 months
[libvirt] [PATCH] build: avoid -lgcrypt with newer gnutls
by Eric Blake
https://bugzilla.redhat.com/show_bug.cgi?id=951637
Newer gnutls uses nettle, rather than gcrypt, which is a lot nicer
regarding initialization. Yet we were unconditionally initializing
gcrypt even when gnutls wouldn't be using it, and having two crypto
libraries linked into libvirt.so is pointless.
The ldd probe in configure borrows from our libnl-1 vs. libnl-3 code.
* configure.ac (WITH_GNUTLS): Probe whether to add -lgcrypt, and
define a witness WITH_GNUTLS_GCRYPT.
* src/libvirt.c (virTLSMutexInit, virTLSMutexDestroy)
(virTLSMutexLock, virTLSMutexUnlock, virTLSThreadImpl)
(virGlobalInit): Honor the witness.
* libvirt.spec.in (BuildRequires): Make gcrypt usage conditional,
no longer needed in Fedora 19.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
Tested with 'ldd src/.libs/libvirt.so | grep -E "(gcry|net|tls)"':
- on RHEL 6.4 and Fedora 18, pre- and post-patch remain unchanged
(use of just libgnutls/libgcrypt)
- on Fedora 19, pre-patch linked against libgnutls, libgcrypt, and
libnettle, post-patch linked against just libgnutls and libnettle
This should probably go in for 1.1.1, but it's not a build-breaker
so it needs review.
configure.ac | 27 +++++++++++++++++++++------
libvirt.spec.in | 2 ++
src/libvirt.c | 10 ++++++----
3 files changed, 29 insertions(+), 10 deletions(-)
diff --git a/configure.ac b/configure.ac
index cc9942a..de209e2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1098,13 +1098,28 @@ if test "x$with_gnutls" != "xno"; then
AC_MSG_ERROR([You must install the GnuTLS library in order to compile and run libvirt])
fi
else
- dnl Not all versions of gnutls include -lgcrypt, and so we add
- dnl it explicitly for the calls to gcry_control/check_version
- GNUTLS_LIBS="$GNUTLS_LIBS -lgcrypt"
- dnl We're not using gcrypt deprecated features so define
- dnl GCRYPT_NO_DEPRECATED to avoid deprecated warnings
- GNUTLS_CFLAGS="$GNUTLS_CFLAGS -DGCRYPT_NO_DEPRECATED"
+ dnl If gnutls linked against -lgcrypt, then we must initialize gcrypt
+ dnl prior to using gnutls. Newer versions of gnutls use -lnettle, in
+ dnl which case we don't want to drag in gcrypt ourselves.
+ gnutls_ldd=
+ for dir in /usr/lib64 /usr/lib /usr/lib/*-linux-gnu*; do
+ if test -f $dir/libgnutls.so; then
+ gnutls_ldd=`(ldd $dir/libgnutls.so) 2>&1`
+ break
+ fi
+ done
+ case $gnutls_ldd in
+ '' | *libgcrypt.so*)
+ GNUTLS_LIBS="$GNUTLS_LIBS -lgcrypt"
+ dnl We're not using gcrypt deprecated features so define
+ dnl GCRYPT_NO_DEPRECATED to avoid deprecated warnings
+ GNUTLS_CFLAGS="$GNUTLS_CFLAGS -DGCRYPT_NO_DEPRECATED"
+ AC_DEFINE_UNQUOTED([WITH_GNUTLS_GCRYPT], 1,
+ [whether GNUTLS uses gcrypt])
+ ;;
+ *) ;; # Assume no gcrypt usage
+ esac
dnl gnutls 3.x moved some declarations to a new header
AC_CHECK_HEADERS([gnutls/crypto.h], [], [], [[
diff --git a/libvirt.spec.in b/libvirt.spec.in
index e0e0004..4320281 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -422,7 +422,9 @@ BuildRequires: readline-devel
BuildRequires: ncurses-devel
BuildRequires: gettext
BuildRequires: libtasn1-devel
+%if (0%{?rhel} && 0%{?rhel} < 7) || (0%{?fedora} && 0%{?fedora} < 19)
BuildRequires: libgcrypt-devel
+%endif
BuildRequires: gnutls-devel
BuildRequires: libattr-devel
%if %{with_libvirtd}
diff --git a/src/libvirt.c b/src/libvirt.c
index 444c1c3..9775b97 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -55,7 +55,9 @@
#include "intprops.h"
#include "virconf.h"
#if WITH_GNUTLS
-# include <gcrypt.h>
+# if WITH_GNUTLS_GCRYPT
+# include <gcrypt.h>
+# endif
# include "rpc/virnettlscontext.h"
#endif
#include "vircommand.h"
@@ -270,7 +272,7 @@ winsock_init(void)
#endif
-#ifdef WITH_GNUTLS
+#ifdef WITH_GNUTLS_GCRYPT
static int virTLSMutexInit(void **priv)
{
virMutexPtr lock = NULL;
@@ -323,7 +325,7 @@ static struct gcry_thread_cbs virTLSThreadImpl = {
virTLSMutexUnlock,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
};
-#endif
+#endif /* WITH_GNUTLS_GCRYPT */
/* Helper macros to implement VIR_DOMAIN_DEBUG using just C99. This
* assumes you pass fewer than 15 arguments to VIR_DOMAIN_DEBUG, but
@@ -407,7 +409,7 @@ virGlobalInit(void)
virErrorInitialize() < 0)
goto error;
-#ifdef WITH_GNUTLS
+#ifdef WITH_GNUTLS_GCRYPT
/*
* This sequence of API calls it copied exactly from
* gnutls 2.12.23 source lib/gcrypt/init.c, with
--
1.8.3.1
11 years, 5 months
[libvirt] [PATCH 0/2] Split driver StateAutoStart from StateInitialization
by John Ferlan
The post push review/comments for the chap authentication determined that
trying to connect to qemu driver from within the storage auto start would
not be successful, see the following and followups
https://www.redhat.com/archives/libvir-list/2013-July/msg01409.html
These patches will split the virStateInitialize() into two phases - the
first being the bulk of the existing code and the second being just running
the auto start functionality for each of the drivers that needs/support it.
I realize it's probably too late for 1.1.1, but figured it'd be good to be
ready when the barn door opens again.
John Ferlan (2):
Separate out StateAutoStart from StateInitialize
virStateDriver - Separate AutoStart from Initialize
src/driver.h | 4 ++++
src/libvirt.c | 23 ++++++++++++++++++++++-
src/libxl/libxl_driver.c | 18 +++++++++++++++---
src/lxc/lxc_driver.c | 18 ++++++++++++++++--
src/network/bridge_driver.c | 20 +++++++++++++++++++-
src/qemu/qemu_driver.c | 18 ++++++++++++++++--
src/storage/storage_driver.c | 19 ++++++++++++++++++-
src/uml/uml_driver.c | 18 ++++++++++++++++--
8 files changed, 126 insertions(+), 12 deletions(-)
--
1.8.1.4
11 years, 5 months
[libvirt] [PATCH 0/4] Test logical volume cloning in storagevolxml2argvtest
by Ján Tomko
Ján Tomko (4):
Use separate macros for failure/success in vol-to-argv test
Move pool XML out of storagevolxml2argvdata
Move volume XMLs out of storagevolxml2argvdata
Add inputpool to storagevolxml2argvtest
.../storagevolxml2argvdata/logical-from-qcow2.argv | 2 +
tests/storagevolxml2argvdata/pool-dir.xml | 18 ---
.../storagevolxml2argvdata/qcow2-from-logical.argv | 2 +
tests/storagevolxml2argvdata/vol-file.xml | 20 ----
tests/storagevolxml2argvdata/vol-qcow2-1.1.xml | 32 ------
tests/storagevolxml2argvtest.c | 128 ++++++++++++++++-----
.../vol-qcow2-0.10-lazy.xml | 0
tests/storagevolxml2xmlin/vol-qcow2-1.1.xml | 2 +-
tests/storagevolxml2xmlin/vol-qcow2-lazy.xml | 2 +-
.../vol-qcow2-nobacking.xml | 0
tests/storagevolxml2xmlin/vol-qcow2.xml | 2 +-
.../vol-qcow2-0.10-lazy.xml} | 8 +-
tests/storagevolxml2xmlout/vol-qcow2-1.1.xml | 2 +-
tests/storagevolxml2xmlout/vol-qcow2-lazy.xml | 2 +-
.../vol-qcow2-nobacking.xml} | 16 +--
tests/storagevolxml2xmlout/vol-qcow2.xml | 2 +-
tests/storagevolxml2xmltest.c | 2 +
17 files changed, 120 insertions(+), 120 deletions(-)
create mode 100644 tests/storagevolxml2argvdata/logical-from-qcow2.argv
delete mode 100644 tests/storagevolxml2argvdata/pool-dir.xml
create mode 100644 tests/storagevolxml2argvdata/qcow2-from-logical.argv
delete mode 100644 tests/storagevolxml2argvdata/vol-file.xml
delete mode 100644 tests/storagevolxml2argvdata/vol-qcow2-1.1.xml
rename tests/{storagevolxml2argvdata => storagevolxml2xmlin}/vol-qcow2-0.10-lazy.xml (100%)
rename tests/{storagevolxml2argvdata => storagevolxml2xmlin}/vol-qcow2-nobacking.xml (100%)
rename tests/{storagevolxml2argvdata/vol-qcow2-lazy.xml => storagevolxml2xmlout/vol-qcow2-0.10-lazy.xml} (84%)
rename tests/{storagevolxml2argvdata/vol-qcow2.xml => storagevolxml2xmlout/vol-qcow2-nobacking.xml} (55%)
--
1.8.1.5
11 years, 5 months