[libvirt] [PATCH v2] qemu: fix vcpupin fail as no vcpu tid set
by Yi Wang
vcpupin will fail when maxvcpus is larger than current
vcpu:
virsh vcpupin win7 --vcpu 0 --cpulist 5-6
error: Requested operation is not valid: cpu affinity is not supported
win7 xml in the command above is like below:
...
<vcpu current="3" placement="static">8</vcpu>
...
The reason is vcpu[3] and vcpu[4] have zero tids and should not been
compared as valid situation in qemuDomainRefreshVcpuInfo().
This issue is introduced by commit 34f7743, which fix recording of vCPU
pids for MTTCG.
Signed-off-by: Yi Wang <wang.yi59(a)zte.com.cn>
---
v2: stop considering zero TIDs as duplicate. Thanks to Jano.
---
src/qemu/qemu_domain.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index ac01e86..c70d3f3 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -10708,7 +10708,7 @@ qemuDomainRefreshVcpuInfo(virQEMUDriverPtr driver,
}
for (j = 0; j < i; j++) {
- if (info[i].tid == info[j].tid) {
+ if (0 != info[i].tid && info[i].tid == info[j].tid) {
VIR_DEBUG("vCPU[%zu] PID %llu duplicates vCPU[%zu]",
i, (unsigned long long)info[i].tid, j);
validTIDs = false;
--
1.8.3.1
5 years, 9 months
[libvirt] [tck PATCH] Don't set a default value for ostype
by Daniel P. Berrangé
We must leave ostype undefined by default so that we can auto-detect the
right ostype based on reported capabilities. This fixes the ability to
run tests with the LXC driver previously broken in
commit c1af9677491d41c8d7a6cc741674e234796de6d0
Author: Daniel P. Berrange <berrange(a)redhat.com>
Date: Thu Mar 27 11:57:14 2014 +0000
Change 'Sys::Virt::TCK::generic_domain' to take named params
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
lib/Sys/Virt/TCK.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/Sys/Virt/TCK.pm b/lib/Sys/Virt/TCK.pm
index f715ee1..389d5cc 100644
--- a/lib/Sys/Virt/TCK.pm
+++ b/lib/Sys/Virt/TCK.pm
@@ -919,7 +919,7 @@ sub generic_domain {
my %params = @_;
my $name = exists $params{name} ? $params{name} : "tck";
- my $ostype = exists $params{ostype} ? $params{ostype} : "hvm";
+ my $ostype = exists $params{ostype} ? $params{ostype} : undef;
my $fullos = exists $params{fullos} ? $params{fullos} : 0;
my $netmode = exists $params{netmode} ? $params{netmode} : undef;
my $shareddisk = exists $params{shareddisk} ? $params{shareddisk} : 0;
--
2.20.1
5 years, 9 months
[libvirt] [PATCH 0/6] lxc: Clean up lxcNetworkWalkCallback() method.
by Julio Faracco
This series has a lots of cleanups to prepare lxc to handle network
settings for verion 3.0 or higher. The new version is considering
network indexes to define network interfaces. i.e.: "lxc.net.X.".
As we need modular structures to support both versions, this method
needs a cleanup before accepting new features for version 3.
Obs: this version does not include any new feature for LXC 3.0 network.
Julio Faracco (6):
lxc: Create a separate method to handle IPv{4,6} outside parser.
lxc: Create a new method called lxcNetworkParseDataEntry().
lxc: Converting full string entries in types only.
lxc: Refactoring lxcNetworkWalkCallback() to a simple method.
lxc: Create a method to initialize network data outisde.
lxc: Converting 'if,else' logic into a 'switch,case'.
src/lxc/lxc_native.c | 184 +++++++++++++++++++++++++++++--------------
src/lxc/lxc_native.h | 17 ++++
2 files changed, 141 insertions(+), 60 deletions(-)
--
2.19.1
5 years, 9 months
[libvirt] [PATCH] util: json: Nuke strings when freeing JSON objects
by Peter Krempa
We construct JSON objects e.g. for setting the VNC password but then
just VIR_FREE the strings cointained inside. If it was the password
string would be kept on the heap. Exchange some cpu cycles for a warm
feeling of security.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/util/virjson.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/util/virjson.c b/src/util/virjson.c
index d5d66f879f..db38fd0dc0 100644
--- a/src/util/virjson.c
+++ b/src/util/virjson.c
@@ -423,7 +423,7 @@ virJSONValueFree(virJSONValuePtr value)
VIR_FREE(value->data.array.values);
break;
case VIR_JSON_TYPE_STRING:
- VIR_FREE(value->data.string);
+ VIR_DISPOSE_STRING(value->data.string);
break;
case VIR_JSON_TYPE_NUMBER:
VIR_FREE(value->data.number);
--
2.20.1
5 years, 9 months
[libvirt] [PATCH 0/2] fix snapshot --redefine bugs (incremental backup saga)
by Eric Blake
I ran into these while trying to debug my additions of bulk
dumpxml/redefine for use with both snapshots and checkpoints.
It is a long-standing bug (a fact not made any nicer by our delay
in implementing revert to external snapshots, oh well), but one
that has escaped notice until now.
Eric Blake (2):
snapshot: Permit redefine of offline external snapshot
qemu: Fix snapshot redefine vs. domain state bug
src/conf/snapshot_conf.c | 11 ++--
src/qemu/qemu_driver.c | 117 ++++++++++++++++++++++++---------------
2 files changed, 76 insertions(+), 52 deletions(-)
--
2.20.1
5 years, 9 months
[libvirt] [PATCH] qemu: fix vcpupin fail as no vcpu tid set
by Wen Yang
From: Yi Wang <wang.yi59(a)zte.com.cn>
vcpupin will fail when maxvcpus is larger than current
vcpu:
virsh vcpupin win7 --vcpu 0 --cpulist 5-6
error: Requested operation is not valid: cpu affinity is not supported
win7 xml in the command above is like below:
...
<vcpu current="3" placement="static">8</vcpu>
...
This issue is caused by qemuDomainRefreshVcpuInfo(), which mistake to
make validTIDs false and not set vcpu tid because vcpu[3] and vcpu[4]
have duplicate zero tids.
This patch fix this.
Signed-off-by: Yi Wang <wang.yi59(a)zte.com.cn>
---
src/qemu/qemu_domain.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index ac01e86..6987550 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -10701,6 +10701,9 @@ qemuDomainRefreshVcpuInfo(virQEMUDriverPtr driver,
* impl which we can support.
*/
for (i = 0; i < maxvcpus && validTIDs; i++) {
+ if (vm->def->virtType != VIR_DOMAIN_VIRT_QEMU)
+ break;
+
if (info[i].tid == vm->pid) {
VIR_DEBUG("vCPU[%zu] PID %llu duplicates process",
i, (unsigned long long)info[i].tid);
--
1.8.3.1
5 years, 9 months
[libvirt] [PATCH 0/4] util: Few more VIR_AUTO... related cleanups
by Peter Krempa
Document that VIR_AUTOPTR should not be used with vectors ...
Peter Krempa (4):
util: alloc: Remove pointless clearing of variable in AUTOPTR_FUNCs
util: alloc: Introduce macro for self-freeing NULL-terminated lists
util: string: Use VIR_AUTOLISTPTR for 'virString'
util: alloc: Note that VIR_AUTOPTR/VIR_AUTOCLEAN must not be used with
vectors
src/lxc/lxc_process.c | 2 +-
src/qemu/qemu_conf.c | 8 +--
src/storage/storage_backend_sheepdog.c | 4 +-
src/storage/storage_backend_zfs.c | 10 ++--
src/util/viralloc.h | 70 +++++++++++++++++++++++++-
src/util/vircommand.c | 2 +-
src/util/virfirewall.c | 2 +-
src/util/virprocess.c | 2 +-
src/util/virstoragefile.c | 10 ++--
src/util/virstring.h | 2 +-
src/xenconfig/xen_common.c | 6 +--
11 files changed, 93 insertions(+), 25 deletions(-)
--
2.20.1
5 years, 9 months
[libvirt] [dockerfiles PATCH] refresh: Adapt to recent lcitool changes
by Andrea Bolognani
lcitool uses argparse subparsers and positional parameters now,
so we need to make sure we invoke it appropriately.
This is needed since libvirt-jenkins-ci commit bfb9d96664f0.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
Pushed as trivial.
refresh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/refresh b/refresh
index 922abcf..701d2af 100755
--- a/refresh
+++ b/refresh
@@ -14,7 +14,7 @@ cd "$ci_repo/guests/" >/dev/null 2>&1 || {
die "Usage: $me path/to/libvirt-jenkins-ci.git"
}
-for host in $(./lcitool -a hosts)
+for host in $(./lcitool hosts)
do
projects="libvirt"
dockerfile="$here/buildenv-${host#libvirt-}.Dockerfile"
@@ -24,7 +24,7 @@ do
libvirt-freebsd-*) continue ;;
esac
- ./lcitool -a dockerfile -h "$host" -p "$projects" >"$dockerfile" || {
+ ./lcitool dockerfile "$host" "$projects" >"$dockerfile" || {
die "$me: Failed to refresh Dockerfile for $host"
}
done
--
2.20.1
5 years, 9 months
[libvirt] [PATCH] virfile: added GPFS as shared fs
by Diego Michelotto
From: dmichelotto <diego.michelotto(a)cnaf.infn.it>
Added GPFS as shared file system recognized during live migration
security checks.
GPFS is 'IBM General Parallel File System' also called
'IBM Spectrum Scale'
BUG: https://bugzilla.redhat.com/show_bug.cgi?id=1679528
Signed-off-by: Diego Michelotto <diego.michelotto(a)cnaf.infn.it>
---
src/util/virfile.c | 9 ++++++++-
src/util/virfile.h | 1 +
tests/virfiledata/mounts3.txt | 1 +
tests/virfilemock.c | 5 +++++
tests/virfiletest.c | 1 +
5 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/src/util/virfile.c b/src/util/virfile.c
index 271bf5e796..615c287104 100644
--- a/src/util/virfile.c
+++ b/src/util/virfile.c
@@ -3468,6 +3468,9 @@ int virFilePrintf(FILE *fp, const char *msg, ...)
# ifndef CEPH_SUPER_MAGIC
# define CEPH_SUPER_MAGIC 0x00C36400
# endif
+# ifndef GPFS_SUPER_MAGIC
+# define GPFS_SUPER_MAGIC 0x47504653
+# endif
# define PROC_MOUNTS "/proc/mounts"
@@ -3613,6 +3616,9 @@ virFileIsSharedFSType(const char *path,
if ((fstypes & VIR_FILE_SHFS_CEPH) &&
(f_type == CEPH_SUPER_MAGIC))
return 1;
+ if ((fstypes & VIR_FILE_SHFS_GPFS) &&
+ (f_type == GPFS_SUPER_MAGIC))
+ return 1;
return 0;
}
@@ -3776,7 +3782,8 @@ int virFileIsSharedFS(const char *path)
VIR_FILE_SHFS_AFS |
VIR_FILE_SHFS_SMB |
VIR_FILE_SHFS_CIFS |
- VIR_FILE_SHFS_CEPH);
+ VIR_FILE_SHFS_CEPH |
+ VIR_FILE_SHFS_GPFS);
}
diff --git a/src/util/virfile.h b/src/util/virfile.h
index be612af770..0b946fe1ca 100644
--- a/src/util/virfile.h
+++ b/src/util/virfile.h
@@ -221,6 +221,7 @@ enum {
VIR_FILE_SHFS_SMB = (1 << 4),
VIR_FILE_SHFS_CIFS = (1 << 5),
VIR_FILE_SHFS_CEPH = (1 << 6),
+ VIR_FILE_SHFS_GPFS = (1 << 7),
};
int virFileIsSharedFSType(const char *path, int fstypes) ATTRIBUTE_NONNULL(1);
diff --git a/tests/virfiledata/mounts3.txt b/tests/virfiledata/mounts3.txt
index 68eded048c..4377e5d471 100644
--- a/tests/virfiledata/mounts3.txt
+++ b/tests/virfiledata/mounts3.txt
@@ -35,3 +35,4 @@ host:/gv0 /gluster fuse.glusterfs rw 0 0
root@host:/tmp/mkdir /gluster/sshfs fuse.sshfs rw 0 0
192.168.0.1:/ceph/data /ceph ceph rw,noatime,name=cephfs,secret=<hidden>,acl,wsize=16777216 0 0
192.168.0.1,192.168.0.2,192.168.0.3:/ceph/data2 /ceph/multi ceph rw,noatime,name=cephfs,secret=<hidden>,acl,wsize=16777216 0 0
+gpfs_data /gpfs/data gpfs rw,relatime 0 0
diff --git a/tests/virfilemock.c b/tests/virfilemock.c
index 499135d773..89e14c5b67 100644
--- a/tests/virfilemock.c
+++ b/tests/virfilemock.c
@@ -89,6 +89,9 @@ setmntent(const char *filename, const char *type)
#ifndef CEPH_SUPER_MAGIC
# define CEPH_SUPER_MAGIC 0x00c36400
#endif
+#ifndef GPFS_SUPER_MAGIC
+# define GPFS_SUPER_MAGIC 0x47504653
+#endif
static int
@@ -137,6 +140,8 @@ statfs_mock(const char *mtab,
ftype = FUSE_SUPER_MAGIC;
} else if (STRPREFIX(mb.mnt_type, "ceph")) {
ftype = CEPH_SUPER_MAGIC;
+ } else if (STRPREFIX(mb.mnt_type, "gpfs")) {
+ ftype = GPFS_SUPER_MAGIC;
} else {
/* Everything else is EXT4. We don't care really for other paths. */
ftype = EXT4_SUPER_MAGIC;
diff --git a/tests/virfiletest.c b/tests/virfiletest.c
index f90c611ac4..e2bd4953ed 100644
--- a/tests/virfiletest.c
+++ b/tests/virfiletest.c
@@ -457,6 +457,7 @@ mymain(void)
DO_TEST_FILE_IS_SHARED_FS_TYPE("mounts3.txt", "/some/symlink/file", true);
DO_TEST_FILE_IS_SHARED_FS_TYPE("mounts3.txt", "/ceph/file", true);
DO_TEST_FILE_IS_SHARED_FS_TYPE("mounts3.txt", "/ceph/multi/file", true);
+ DO_TEST_FILE_IS_SHARED_FS_TYPE("mounts3.txt", "/gpfs/data", true);
return ret != 0 ? EXIT_FAILURE : EXIT_SUCCESS;
}
--
2.20.1
5 years, 10 months