[libvirt] [PATCH 0/2] Fix probing for no-overwrite on fs storage
by John Ferlan
Details in the patches, especially #2.
I'm not 100% certain the blkid_probe_filter_superblocks_type is really
necessary, but left it there with a fixed list of probe'd types rather
than removing and finding some corner issue later.
John Ferlan (2):
fs: Remove virStoragePoolProbeResult and FILESYSTEM_PROBE_ values
fs: Fix probing on no-overwrite of target device
src/storage/storage_backend_fs.c | 42 +++++++++++++++++++---------------------
src/storage/storage_backend_fs.h | 5 -----
2 files changed, 20 insertions(+), 27 deletions(-)
--
2.7.4
7 years, 12 months
[libvirt] [PATCH v4 0/2] List only online cpus for vcpupin/emulatorpin when vcpu placement static
by Nitesh Konkar
Currently when the vcpu placement is static and
cpuset is not specified, CPU Affinity shows 0..
CPUMAX. This patchset will result in display of
only online CPU's under CPU Affinity on linux.
Fixes the following Bug:
virsh dumpxml Fedora
<domain type='kvm' id='4'>
<name>Fedora</name>
<uuid>aecf3e5e-6f9a-42a3-9d6a-223a75569a66</uuid>
<maxMemory slots='32' unit='KiB'>3145728</maxMemory>
<memory unit='KiB'>524288</memory>
<currentMemory unit='KiB'>524288</currentMemory>
<vcpu placement='static' current='8'>160</vcpu>
<resource>
<partition>/machine</partition>
</resource>
.....................
.......................
.........................
<memballoon model='virtio'>
<alias name='balloon0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
</memballoon>
</devices>
<seclabel type='dynamic' model='dac' relabel='yes'>
<label>+0:+0</label>
<imagelabel>+0:+0</imagelabel>
</seclabel>
</domain>
lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 8
On-line CPU(s) list: 0-2,4-7
Off-line CPU(s) list: 3
Thread(s) per core: 1
Core(s) per socket: 7
Socket(s): 1
..........
..........
NUMA node0 CPU(s): 0-2,4-7
NUMA node1 CPU(s):
cat /sys/devices/system/cpu/online
0-2,4-7
Before Patch
virsh vcpupin Fedora
VCPU: CPU Affinity
----------------------------------
0: 0-7
1: 0-7
...
...
158: 0-7
159: 0-7
virsh emulatorpin Fedora
emulator: CPU Affinity
----------------------------------
*: 0-7
After Patch
virsh vcpupin Fedora
VCPU: CPU Affinity
----------------------------------
0: 0-2,4-7
1: 0-2,4-7
...
...
158: 0-2,4-7
159: 0-2,4-7
virsh emulatorpin Fedora
emulator: CPU Affinity
----------------------------------
*: 0-2,4-7
Nitesh Konkar (2):
conf: List only online cpus for virsh vcpupin
conf: List only online cpus for virsh emulatorpin
src/conf/domain_conf.c | 6 ++++++
src/qemu/qemu_driver.c | 5 +++++
2 files changed, 11 insertions(+)
--
2.1.0
7 years, 12 months
[libvirt] [PATCH] util: fix domain object leaks on closecallbacks
by Wang King
From: wangjing <king.wang(a)huawei.com>
The virCloseCallbacksSet method increase object reference for
VM, and decrease object reference in virCloseCallbacksUnset.
But VM UUID will be deleted from closecallbacks list in
virCloseCallbacksRun when connection disconnected, and then
object reference cannot be decreased by virCloseCallbacksUnset
in callback functions.
Signed-off-by: Wang King <king.wang(a)huawei.com>
---
src/util/virclosecallbacks.c | 29 +++++++++++++++++------------
1 file changed, 17 insertions(+), 12 deletions(-)
diff --git a/src/util/virclosecallbacks.c b/src/util/virclosecallbacks.c
index 891a92b..26d5075 100644
--- a/src/util/virclosecallbacks.c
+++ b/src/util/virclosecallbacks.c
@@ -300,7 +300,9 @@ virCloseCallbacksGetForConn(virCloseCallbacksPtr closeCallbacks,
data.list = list;
data.oom = false;
+ virObjectLock(closeCallbacks);
virHashForEach(closeCallbacks->list, virCloseCallbacksGetOne, &data);
+ virObjectUnlock(closeCallbacks);
if (data.oom) {
VIR_FREE(list->entries);
@@ -329,22 +331,15 @@ virCloseCallbacksRun(virCloseCallbacksPtr closeCallbacks,
* them all from the hash. At that point we can release
* the lock and run the callbacks safely. */
- virObjectLock(closeCallbacks);
list = virCloseCallbacksGetForConn(closeCallbacks, conn);
if (!list)
return;
for (i = 0; i < list->nentries; i++) {
- char uuidstr[VIR_UUID_STRING_BUFLEN];
- virUUIDFormat(list->entries[i].uuid, uuidstr);
- virHashRemoveEntry(closeCallbacks->list, uuidstr);
- }
- virObjectUnlock(closeCallbacks);
-
- for (i = 0; i < list->nentries; i++) {
virDomainObjPtr vm;
+ virDomainObjPtr dom;
- if (!(vm = virDomainObjListFindByUUID(domains,
+ if (!(vm = virDomainObjListFindByUUIDRef(domains,
list->entries[i].uuid))) {
char uuidstr[VIR_UUID_STRING_BUFLEN];
virUUIDFormat(list->entries[i].uuid, uuidstr);
@@ -352,10 +347,20 @@ virCloseCallbacksRun(virCloseCallbacksPtr closeCallbacks,
continue;
}
- vm = list->entries[i].callback(vm, conn, opaque);
- if (vm)
- virObjectUnlock(vm);
+ dom = list->entries[i].callback(vm, conn, opaque);
+ if (dom)
+ virObjectUnlock(dom);
+ virObjectUnref(vm);
}
+
+ virObjectLock(closeCallbacks);
+ for (i = 0; i < list->nentries; i++) {
+ char uuidstr[VIR_UUID_STRING_BUFLEN];
+ virUUIDFormat(list->entries[i].uuid, uuidstr);
+ virHashRemoveEntry(closeCallbacks->list, uuidstr);
+ }
+ virObjectUnlock(closeCallbacks);
+
VIR_FREE(list->entries);
VIR_FREE(list);
}
--
2.8.3
8 years
[libvirt] [PATCH v3 0/2] vbox: address thread-safety issues
by Dawid Zamirski
This patch series solves vbox driver thread-safety issues where
libvird process would segfault when there was more than one concurrent
vbox connection. The reason for the segfault was because the original
implementation called pfnComInitialize/Unintialize on each
virConnectOpen/Close calls which were setting pointers to ISession and
IVirtualBox instances that were held by the global g_pVBoxGlobalData.
This caused new connection to overwrite the pointer created by the
prior connection.
Changes since v2 to address feedback in [1]:
* call uninitialize when vboxSdkInitialize or vboxExtractVersion fails.
* make sure to set the global vbox_driver pointer to NULL after
virObjectUnref releases last reference, to avoid segfaults when
VBOX_RELEASE is called in unintialize call.
* tested all possible failure paths to make sure libvirtd does not
crash, that is, vboxSdkInitialize has 4 code paths that can possibly
return -1 and made sure all of them are safely handled.
* fixed "unintilalize" typos in code comments and commit messages.
In other words, the change boils down to:
if (vboxSdkInitialize() < 0 || vboxExtractVersion() < 0) {
gVBoxAPI.UPFN.Uninitialize(vbox_driver); // call uninit on failure
/* make sure to clear the pointer when last reference was released */
if (!virObjectUnref(vbox_driver))
vbox_driver = NULL; // make sure this is NULL
virMutexUnlock(&vbox_driver_lock);
return NULL;
}
[1] https://www.redhat.com/archives/libvir-list/2016-November/msg01132.html
Dawid Zamirski (2):
vbox: change how vbox API is initialized.
vbox: get rid of g_pVBoxGlobalData
src/vbox/vbox_common.c | 565 +++++++++++++++++++++++-------------------
src/vbox/vbox_common.h | 2 +-
src/vbox/vbox_driver.c | 1 +
src/vbox/vbox_network.c | 24 +-
src/vbox/vbox_storage.c | 20 +-
src/vbox/vbox_tmpl.c | 434 ++++++++++++++++----------------
src/vbox/vbox_uniformed_api.h | 110 ++++----
7 files changed, 616 insertions(+), 540 deletions(-)
--
2.9.3
8 years
[libvirt] [PATCH 0/3] Couple of small fixes and improvements
by Marc Hartmayer
Fixed trailing '/' for path, removed an obsolete comment, and removed
a useless warning.
Bjoern Walk (1):
virutil: fix trailing '/' for path prefixes
Marc Hartmayer (2):
virfile: Only generate a warning if there is something to report
qemu: Removed an outdated comment in qemuDomainSaveImageStartVM()
src/qemu/qemu_driver.c | 1 -
src/util/virfile.c | 2 +-
src/util/virutil.c | 4 ++--
3 files changed, 3 insertions(+), 4 deletions(-)
--
2.5.5
8 years
[libvirt] [PATCH 0/2] Fix typos in util and virsh manpage
by Nitesh Konkar
Nitesh Konkar (2):
util: Fix Typos
virsh: Fix manpage typo
src/util/vircgroup.c | 4 ++--
src/util/vircrypto.c | 2 +-
src/util/virdbus.c | 2 +-
src/util/virhostcpu.c | 2 +-
src/util/virhostdev.c | 2 +-
src/util/virrotatingfile.c | 2 +-
src/util/virstoragefile.c | 2 +-
src/util/virstring.c | 2 +-
src/util/virtypedparam.c | 2 +-
src/util/virxml.c | 2 +-
tools/virsh.pod | 2 +-
11 files changed, 12 insertions(+), 12 deletions(-)
--
2.1.0
8 years
[libvirt] [PATCH v2 0/2] vbox: address thread-safety issues
by Dawid Zamirski
This patch series solves vbox driver thread-safety issues where
libvird process would segfault when there was more than one concurrent
vbox connection. The reason for the segfault was because the original
implementation called pfnComInitialize/Unintialize on each
virConnectOpen/Close calls which were setting pointers to ISession and
IVirtualBox instances that were held by the global g_pVBoxGlobalData.
This caused new connection to overwrite the pointer created by the
prior connection.
Changes since v1 [1]:
* use just vboxDriver object instead of vboxGlobalData and vboxPrivate
structs. The vboxDriver takes advantage of libvirt object reference
counting and more closely resembles the pattern of "global" drivers
used by other drivers such as vz or xen. This also takes care of the
original concern mentioned in v1 where allocation of the struct was
not guarded by a mutex.
* use pfnClientInialize/Unintialize vbox API for newer vbox versions
instead of the old pfnComInitialize/Unintialze which are marked as
deprecated by upstream vbox.
While this series adresses the issues I've been targetting, i.e. avoid
libvird sefault with concurrent vbox connections, the libvirt vbox
driver still incorrectly calls vbox's init/unint APIs as those must be
called from the same thread according to vbox source code and docs.
Furthermore, if one is running vbox 'debug' build, it will refuse to
intialize as it's not called from the main thread due to asserts [2].
Those asserts are compiled away on 'release' builds so it appears to
work, but may cause some unwanted side effects. Unfortunately, I don't
think it's possible to have libvirt driver call those APIs from the
same thread as libvirt is a client-server architecture and each libvir
API call from the connection starts a new thread, so I guess this is
not doeable right now :-/
[1] https://www.redhat.com/archives/libvir-list/2016-September/msg01306.html
[2] https://github.com/mdaniel/virtualbox-org-svn-vbox-trunk/blob/master/src/...
Dawid Zamirski (2):
vbox: change how vbox API is initialized.
vbox: get rid of g_pVBoxGlobalData
src/vbox/vbox_common.c | 561 +++++++++++++++++++++++-------------------
src/vbox/vbox_common.h | 2 +-
src/vbox/vbox_driver.c | 1 +
src/vbox/vbox_network.c | 24 +-
src/vbox/vbox_storage.c | 20 +-
src/vbox/vbox_tmpl.c | 434 ++++++++++++++++----------------
src/vbox/vbox_uniformed_api.h | 110 ++++-----
7 files changed, 612 insertions(+), 540 deletions(-)
--
2.9.3
8 years
[libvirt] [PATCH 0/6] Add deadline scheduler
by Martin Polednik
The policy SCHED_DEADLINE is available since kernel 3.14 (and most likely
backported to older RT_PREEMPT kernels). It is safer to use than fifo or round
robin policies due to only limiting part of cpu time for the RT process,
leading to lack of lockups of the host.
The series adds new vcpusched/iothreadsched called 'deadline' that activates
SCHED_DEADLINE for given process. As the scheduler is linux specific, extra
implementation was required - it is not possible to use sched_setscheduler,
sched_setattr syscall must be used.
Martin Polednik (6):
conf: add entries for deadline scheduler
util: allow virProcessSetScheduler to set SCHED_DEADLINE
virDomainFormatSchedDef: factor out subset code
conf: add deadline scheduler
schema: add deadline scheduler
docs: mention deadline scheduler in vcpusched
docs/formatdomain.html.in | 15 ++--
docs/schemas/domaincommon.rng | 16 +++++
src/conf/domain_conf.c | 154 +++++++++++++++++++++++++++++++++++-------
src/conf/domain_conf.h | 3 +
src/qemu/qemu_process.c | 3 +-
src/util/virprocess.c | 82 +++++++++++++++++++++-
src/util/virprocess.h | 29 +++++++-
7 files changed, 268 insertions(+), 34 deletions(-)
--
2.8.1
8 years
[libvirt] [PATCH 0/2] qemu: Update CGroups on some devices hotplug
by Michal Privoznik
We are already doing that for some devices (e.g. disks,
hostdevs), but completely forgot about some others (chardevs and
RNGs). So far the hotplug worked by pure chance as /dev/random
and /dev/urandom are enabled in the device CGroups by default.
Michal Privoznik (2):
qemu: Update cgroup on RNG hotplug
qemu: Update cgroup on chardev hotplug
src/qemu/qemu_cgroup.c | 108 +++++++++++++++++++++++++++++++++++++++++-------
src/qemu/qemu_cgroup.h | 8 ++++
src/qemu/qemu_hotplug.c | 37 ++++++++++++++---
3 files changed, 131 insertions(+), 22 deletions(-)
--
2.8.4
8 years
[libvirt] [PATCH] NEWS: Close <li> tag properly
by Andrea Bolognani
Not closing the <li> tag on a separate line causes the plain
text version of the file to have no empty line between entries.
---
Pushed as trivial.
docs/news.html.in | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/docs/news.html.in b/docs/news.html.in
index b422f13..5f5c099 100644
--- a/docs/news.html.in
+++ b/docs/news.html.in
@@ -32,7 +32,8 @@
<li><strong>Improvements</strong>
<ul>
<li>virsh: Add support for passing an alternative persistent XML
- to migrate command</li>
+ to migrate command
+ </li>
<li>vhostuser: Allow hotplug of multiqueue devices
</li>
<li>NEWS: Switch to an improved format<br/>
--
2.7.4
8 years