[libvirt] [PATCH] maint: update to latest gnulib
by Eric Blake
Required for the copyright year bump to keep 'make syntax-check'
happy, and also pulls in several portability fixes.
* .gnulib: Update to latest.
* bootstrap: Resync from upstream.
* gnulib/local/m4/ssize_t.m4.diff: Regenerate.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
Pushing under the build-breaker rule.
.gnulib | 2 +-
bootstrap | 2 +-
gnulib/local/m4/ssize_t.m4.diff | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.gnulib b/.gnulib
index f39477d..6cc32c6 160000
--- a/.gnulib
+++ b/.gnulib
@@ -1 +1 @@
-Subproject commit f39477dba778e99392948dd3dd19ec0d46aee932
+Subproject commit 6cc32c63e80bc1a30c521b2f07f2b54909b59892
diff --git a/bootstrap b/bootstrap
index e72894c..294c0bc 100755
--- a/bootstrap
+++ b/bootstrap
@@ -4,7 +4,7 @@ scriptversion=2014-12-08.12; # UTC
# Bootstrap this package from checked-out sources.
-# Copyright (C) 2003-2015 Free Software Foundation, Inc.
+# Copyright (C) 2003-2016 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/gnulib/local/m4/ssize_t.m4.diff b/gnulib/local/m4/ssize_t.m4.diff
index 12cff12..c4863b9 100644
--- a/gnulib/local/m4/ssize_t.m4.diff
+++ b/gnulib/local/m4/ssize_t.m4.diff
@@ -5,7 +5,7 @@ index 209d64c..5ea72a1 100644
@@ -1,4 +1,4 @@
-# ssize_t.m4 serial 5 (gettext-0.18.2)
+# ssize_t.m4 serial 6 (gettext-0.18.2)
- dnl Copyright (C) 2001-2003, 2006, 2010-2015 Free Software Foundation, Inc.
+ dnl Copyright (C) 2001-2003, 2006, 2010-2016 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -17,7 +17,21 @@ AC_DEFUN([gt_TYPE_SSIZE_T],
--
2.4.3
9 years, 4 months
[libvirt] [PATCH] tests: Add newlines with VIR_TEST_REGENERATE_OUTPUT
by Cole Robinson
Since test files are formatted predictably nowadays, we can make
VIR_TEST_REGENERATE_OUTPUT handle most cases for us with a simple
replacement. test-wrap-argv.pl is still canon, but this bit makes
it easier to confirm test output changes during active development.
---
tests/testutils.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/tests/testutils.c b/tests/testutils.c
index 857e819..6487a62 100644
--- a/tests/testutils.c
+++ b/tests/testutils.c
@@ -598,6 +598,7 @@ virtTestCompareToFile(const char *strcontent,
int ret = -1;
char *filecontent = NULL;
char *fixedcontent = NULL;
+ char *regencontent = NULL;
bool regenerate = !!virTestGetFlag("VIR_TEST_REGENERATE_OUTPUT");
if (virtTestLoadFile(filename, &filecontent) < 0 && !regenerate)
@@ -613,7 +614,10 @@ virtTestCompareToFile(const char *strcontent,
if (STRNEQ_NULLABLE(fixedcontent ? fixedcontent : strcontent,
filecontent)) {
if (regenerate) {
- if (virFileWriteStr(filename, strcontent, 0666) < 0)
+ if (!(regencontent = virStringReplace(strcontent, " -", " \\\n-")))
+ goto failure;
+
+ if (virFileWriteStr(filename, regencontent, 0666) < 0)
goto failure;
goto out;
}
@@ -626,6 +630,7 @@ virtTestCompareToFile(const char *strcontent,
failure:
VIR_FREE(fixedcontent);
VIR_FREE(filecontent);
+ VIR_FREE(regencontent);
return ret;
}
--
2.5.0
9 years, 4 months
[libvirt] [PATCH] qemu: Fix return value of qemuDomainGetBlockJobInfo
by Michal Privoznik
While reviewing 1b43885d1784640 I've noticed a virReportError()
followed by a goto endjob; without setting the correct return
value. Problem is, if block job is so fast that it's bandwidth
does not fit into ulong, an error is reported. However, by that
time @ret is already set to 1 which means success. Since the
scenario can be hardly considered successful, we should return a
value meaning error.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_driver.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 304165c..1161aa0 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -16546,6 +16546,7 @@ qemuDomainGetBlockJobInfo(virDomainPtr dom,
virReportError(VIR_ERR_OVERFLOW,
_("bandwidth %llu cannot be represented in result"),
rawInfo.bandwidth);
+ ret = -1;
goto endjob;
}
--
2.4.10
9 years, 4 months
[libvirt] [PATCH] qemu: Fix all callers of qemuMonitorGetBlockJobInfo()
by Andrea Bolognani
Commit 1b43885 modified one of the callers of this function to take
into account the possible return value of 0 when the block job can't be
found.
This commit finishes the job by updating the remaining caller.
---
src/qemu/qemu_driver.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 304165c..c4573d9 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -16150,14 +16150,13 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver,
rc = qemuMonitorGetBlockJobInfo(priv->mon, disk->info.alias, &info);
if (qemuDomainObjExitMonitor(driver, vm) < 0)
goto cleanup;
- if (rc < 0)
+ if (rc <= 0)
goto cleanup;
- if (rc == 1 &&
- (info.ready == 1 ||
- (info.ready == -1 &&
- info.end == info.cur &&
- (info.type == VIR_DOMAIN_BLOCK_JOB_TYPE_COPY ||
- info.type == VIR_DOMAIN_BLOCK_JOB_TYPE_COMMIT))))
+ if (info.ready == 1 ||
+ (info.ready == -1 &&
+ info.end == info.cur &&
+ (info.type == VIR_DOMAIN_BLOCK_JOB_TYPE_COPY ||
+ info.type == VIR_DOMAIN_BLOCK_JOB_TYPE_COMMIT)))
disk->mirrorState = VIR_DOMAIN_DISK_MIRROR_STATE_READY;
}
--
2.5.0
9 years, 4 months
[libvirt] [PATCH] rbd: Return VIR_STORAGE_FILE_RAW as format for RBD volumes
by Wido den Hollander
This used to return 'unkown' and that was not correct.
A vol-dumpxml now returns:
<volume type='network'>
<name>image3</name>
<key>libvirt/image3</key>
<source>
</source>
<capacity unit='bytes'>10737418240</capacity>
<allocation unit='bytes'>10737418240</allocation>
<target>
<path>libvirt/image3</path>
<format type='raw'/>
</target>
</volume>
The RBD driver will now error out if a different format than RAW
is provided when creating a volume.
Signed-off-by: Wido den Hollander <wido(a)widodh.nl>
---
src/conf/storage_conf.c | 3 ++-
src/storage/storage_backend_rbd.c | 13 +++++++++++++
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c
index 9b8abea..7c81bab 100644
--- a/src/conf/storage_conf.c
+++ b/src/conf/storage_conf.c
@@ -220,7 +220,8 @@ static virStoragePoolTypeInfo poolTypeInfo[] = {
},
.volOptions = {
.defaultFormat = VIR_STORAGE_FILE_RAW,
- .formatToString = virStoragePoolFormatDiskTypeToString,
+ .formatFromString = virStorageVolumeFormatFromString,
+ .formatToString = virStorageFileFormatTypeToString,
}
},
{.poolType = VIR_STORAGE_POOL_SHEEPDOG,
diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backend_rbd.c
index cdbfdee..80684eb 100644
--- a/src/storage/storage_backend_rbd.c
+++ b/src/storage/storage_backend_rbd.c
@@ -306,6 +306,7 @@ static int volStorageBackendRBDRefreshVolInfo(virStorageVolDefPtr vol,
vol->target.capacity = info.size;
vol->target.allocation = info.obj_size * info.num_objs;
vol->type = VIR_STORAGE_VOL_NETWORK;
+ vol->target.format = VIR_STORAGE_FILE_RAW;
VIR_FREE(vol->target.path);
if (virAsprintf(&vol->target.path, "%s/%s",
@@ -557,6 +558,12 @@ virStorageBackendRBDCreateVol(virConnectPtr conn ATTRIBUTE_UNUSED,
{
vol->type = VIR_STORAGE_VOL_NETWORK;
+ if (vol->target.format != VIR_STORAGE_FILE_RAW) {
+ virReportError(VIR_ERR_NO_SUPPORT, "%s",
+ _("only RAW volumes are supported by this storage pool"));
+ return -VIR_ERR_NO_SUPPORT;
+ }
+
VIR_FREE(vol->target.path);
if (virAsprintf(&vol->target.path, "%s/%s",
pool->def->source.name,
@@ -603,6 +610,12 @@ virStorageBackendRBDBuildVol(virConnectPtr conn,
goto cleanup;
}
+ if (vol->target.format != VIR_STORAGE_FILE_RAW) {
+ virReportError(VIR_ERR_NO_SUPPORT, "%s",
+ _("only RAW volumes are supported by this storage pool"));
+ goto cleanup;
+ }
+
if (virStorageBackendRBDOpenRADOSConn(&ptr, conn, &pool->def->source) < 0)
goto cleanup;
--
1.9.1
9 years, 4 months
[libvirt] [PATCH 0/3] Various Valgrind fixes
by Michael Chapman
Valgrind reported a couple of memory leaks and jumps conditional on
uninitialized values.
Happy New Year!
Michael Chapman (3):
qemu: do not copy out non-existent block job info
qemu: do not leak NBD disk data in migration cookie
storage: do not leak storage pool XML filename
src/qemu/qemu_driver.c | 4 ++--
src/qemu/qemu_migration.c | 5 +++--
src/storage/storage_driver.c | 10 +++++-----
3 files changed, 10 insertions(+), 9 deletions(-)
--
2.4.3
9 years, 4 months
[libvirt] [libvirt-glib][PATCH] libvirt-glib-1.0.pc.in: Correctly mark variable
by Michal Privoznik
In the pkg-config file for libvirt-glib we have a typo:
Libs.private: @LIBVIRT_LIBS @GLIB2_LIBS@
Noticed the missing '@' after LIBVIRT_LIBS? Well, I just did.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
libvirt-glib-1.0.pc.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libvirt-glib-1.0.pc.in b/libvirt-glib-1.0.pc.in
index 1e8956d..d00be9f 100644
--- a/libvirt-glib-1.0.pc.in
+++ b/libvirt-glib-1.0.pc.in
@@ -8,5 +8,5 @@ Version: @VERSION@
Description: libvirt glib library
Requires: glib-2.0
Libs: -L${libdir} -lvirt-glib-1.0
-Libs.private: @LIBVIRT_LIBS @GLIB2_LIBS@
+Libs.private: @LIBVIRT_LIBS@ @GLIB2_LIBS@
Cflags: -I${includedir}/libvirt-glib-1.0 @LIBVIRT_CFLAGS@ @GLIB2_CFLAGS@
--
2.4.10
9 years, 4 months
[libvirt] Non-contiguous NUMA cell numbers
by Andrea Bolognani
Hi all,
libvirt currently doesn't allow you to configure a guest with something
like
<cpu>
<topology sockets='2' cores='5' threads='8'/>
<numa>
<cell id='0' cpus='0-39' memory='1048576' unit='KiB'/>
<cell id='16' cpus='40-79' memory='1048576' unit='KiB'/>
</numa>
</cpu>
with the following error:
XML error: Exactly one 'cell' element per guest NUMA cell allowed,
non-contiguous ranges or ranges not starting from 0 are not allowed
The error message is very specific about not allowing gaps in NUMA cell
numbering; however, on the very same host, I have
$ numactl --hard | head -1
available: 4 nodes (0-1,16-17)
so gaps in numbering are definitely possible, at least on ppc64.
Should we consider relaxing this requirement and allow
arbitrarily-numbered NUMA cells? Is there a specific reason why it was
forbidden in the first place?
Cheers.
--
Andrea Bolognani
Software Engineer - Virtualization Team
9 years, 4 months
[libvirt] [PATCH v8 0/5] Partial posting of updates to Add quorum to libvirt
by John Ferlan
I took a few cycles to reformat the initial 5 patches of the add quorum
support posted as a v7 here:
http://www.redhat.com/archives/libvir-list/2015-December/msg00119.html
These patches are easily separable from the rest of the series. Rather
than see things linger for months on end, trying to make small leaps.
Changes in the series are to reorder things slightly, follow some of the
review comments from previous series, and a few other things along the
way. I've looked at this way too long to - hopefully I haven't missed
anything. Most I forget... One I do remember is the virStorageSourceCopy
changes in patch 5 where I believe the "Get" and "Set" wanted to use the
'i' index rather than having the "Get" use the 'i' and the "Set" always
use '0'.
Matthias Gatto (5):
virstoragefile: Add helper to get storage source backingStore
virstoragefile: Add helper to set storage source backingStore
virstoragefile: Use helper to get storage source backing store
virstoragefile: Use helper to set storage source backing store
virstoragefile: Convert storage source backingStore into backingStores
src/conf/domain_conf.c | 25 +++++----
src/conf/storage_conf.c | 29 ++++++-----
src/libvirt_private.syms | 2 +
src/qemu/qemu_cgroup.c | 6 ++-
src/qemu/qemu_domain.c | 2 +-
src/qemu/qemu_driver.c | 35 ++++++++-----
src/qemu/qemu_monitor_json.c | 4 +-
src/security/security_dac.c | 3 +-
src/security/security_selinux.c | 5 +-
src/security/virt-aa-helper.c | 2 +-
src/storage/storage_backend.c | 34 +++++++-----
src/storage/storage_backend_fs.c | 46 +++++++++-------
src/storage/storage_backend_gluster.c | 11 ++--
src/storage/storage_backend_logical.c | 15 ++++--
src/storage/storage_driver.c | 3 +-
src/util/virstoragefile.c | 98 ++++++++++++++++++++++++++++++-----
src/util/virstoragefile.h | 10 +++-
tests/virstoragetest.c | 18 +++----
18 files changed, 243 insertions(+), 105 deletions(-)
--
2.5.0
9 years, 4 months
[libvirt] [PATCH] tests: Make test-wrap-argv.pl executable
by Michal Privoznik
While 'perl test-wrap-argv.pl' is not too long,
'./test-wrap-argv.pl' is shorter.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
tests/test-wrap-argv.pl | 0
1 file changed, 0 insertions(+), 0 deletions(-)
mode change 100644 => 100755 tests/test-wrap-argv.pl
diff --git a/tests/test-wrap-argv.pl b/tests/test-wrap-argv.pl
old mode 100644
new mode 100755
--
2.4.10
9 years, 4 months