[libvirt] [PATCH v2] util: eventpoll: Survive EBADF on macOS
by Roman Bolshakov
Fixes:
https://www.redhat.com/archives/libvir-list/2017-January/msg00978.html
QEMU is probed through monitor fd to check capabilities during libvirtd init.
The monitor fd is closed after probing by virQEMUCapsInitQMPCommandFree
that calls virQEMUCapsInitQMPCommandAbort that calls qemuMonitorClose,
the latter one notifies the event loop via an interrupt handle in
qemuMonitorUnregister and after then closes monitor fd.
There could be a case when interrupt is sent after eventLoop is unlocked
but before virEventPollRunOnce blocks in poll, shortly before file
descriptor is closed by qemuMonitorClose. Then poll receives closed monitor
fd in fdset and returns EBADF.
EBADF is not mentioned as a valid errno on macOS poll man-page but such
behaviour can appear release-to-release, according to cpython:
https://github.com/python/cpython/blob/master/Modules/selectmodule.c#L1161
The change also fixes the issue in qemucapabilitiestest. It returns
Bad file descriptor message 25 times without the fix.
Signed-off-by: Roman Bolshakov <r.bolshakov(a)yadro.com>
---
Changes since v1:
* Don't go through dispatch code on EBADF
src/util/vireventpoll.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/util/vireventpoll.c b/src/util/vireventpoll.c
index 13d278df13..7d0ffd4113 100644
--- a/src/util/vireventpoll.c
+++ b/src/util/vireventpoll.c
@@ -643,6 +643,12 @@ int virEventPollRunOnce(void)
EVENT_DEBUG("Poll got error event %d", errno);
if (errno == EINTR || errno == EAGAIN)
goto retry;
+#ifdef __APPLE__
+ if (errno == EBADF) {
+ virMutexLock(&eventLoop.lock);
+ goto stop;
+ }
+#endif
virReportSystemError(errno, "%s",
_("Unable to poll on file handles"));
return -1;
@@ -660,6 +666,7 @@ int virEventPollRunOnce(void)
virEventPollCleanupTimeouts();
virEventPollCleanupHandles();
+ stop:
eventLoop.running = 0;
virMutexUnlock(&eventLoop.lock);
return 0;
--
2.17.0
6 years, 3 months
[libvirt] [PATCH v2 0/8] cpu: modularize the CPU map data file
by Daniel P. Berrangé
Currently we have a cpu_map.xml file that contains all the features and
CPU models for all architectures in one place. I frequently find myself
wondering about the differences between CPU models, but it is hard to
compare them as the list of features is huge.
With this patch series we end up with a large set of small files, one
per named CPU model, along with one for the feature and vendor
definitions
cpu_map/index.xml
cpu_map/ppc64_POWER6.xml
cpu_map/ppc64_POWER7.xml
cpu_map/ppc64_POWER8.xml
cpu_map/ppc64_POWER9.xml
cpu_map/ppc64_POWERPC_e5500.xml
cpu_map/ppc64_POWERPC_e6500.xml
cpu_map/ppc64_vendors.xml
cpu_map/x86_486.xml
cpu_map/x86_athlon.xml
cpu_map/x86_Broadwell-IBRS.xml
cpu_map/x86_Broadwell-noTSX-IBRS.xml
cpu_map/x86_Broadwell-noTSX.xml
cpu_map/x86_Broadwell.xml
cpu_map/x86_Conroe.xml
cpu_map/x86_core2duo.xml
cpu_map/x86_coreduo.xml
cpu_map/x86_cpu64-rhel5.xml
cpu_map/x86_cpu64-rhel6.xml
cpu_map/x86_EPYC-IBRS.xml
cpu_map/x86_EPYC.xml
cpu_map/x86_features.xml
cpu_map/x86_Haswell-IBRS.xml
cpu_map/x86_Haswell-noTSX-IBRS.xml
cpu_map/x86_Haswell-noTSX.xml
cpu_map/x86_Haswell.xml
cpu_map/x86_IvyBridge-IBRS.xml
cpu_map/x86_IvyBridge.xml
cpu_map/x86_kvm32.xml
cpu_map/x86_kvm64.xml
cpu_map/x86_n270.xml
cpu_map/x86_Nehalem-IBRS.xml
cpu_map/x86_Nehalem.xml
cpu_map/x86_Opteron_G1.xml
cpu_map/x86_Opteron_G2.xml
cpu_map/x86_Opteron_G3.xml
cpu_map/x86_Opteron_G4.xml
cpu_map/x86_Opteron_G5.xml
cpu_map/x86_Penryn.xml
cpu_map/x86_pentium2.xml
cpu_map/x86_pentium3.xml
cpu_map/x86_pentiumpro.xml
cpu_map/x86_pentium.xml
cpu_map/x86_phenom.xml
cpu_map/x86_qemu32.xml
cpu_map/x86_qemu64.xml
cpu_map/x86_SandyBridge-IBRS.xml
cpu_map/x86_SandyBridge.xml
cpu_map/x86_Skylake-Client-IBRS.xml
cpu_map/x86_Skylake-Client.xml
cpu_map/x86_Skylake-Server-IBRS.xml
cpu_map/x86_Skylake-Server.xml
cpu_map/x86_vendors.xml
cpu_map/x86_Westmere-IBRS.xml
cpu_map/x86_Westmere.xml
The main cpu_map/index.xml file is now just a list of <include filename="XXX"/>
statements to pull in the individual files
Now we can easily see the differences in each model:
$ diff cpu_map/x86_Broadwell.xml cpu_map/x86_Skylake-Client.xml
2,3c2,3
< <model name='Broadwell'>
< <signature family='6' model='61'/>
---
> <model name='Skylake-Client'>
> <signature family='6' model='94'/>
5a6
> <feature name='abm'/>
8a10
> <feature name='arat'/>
18a21
> <feature name='f16c'/>
30a34
> <feature name='mpx'/>
42a47
> <feature name='rdrand'/>
56a62
> <feature name='vme'/>
57a64
> <feature name='xgetbv1'/>
58a66,67
> <feature name='xsavec'/>
> <feature name='xsaveopt'/>
Changed in v2:
- Moved all XML files into a new src/cpu_map/ directory
- Simplify the goto labels for error code paths.
- Code style fixes
Daniel P. Berrangé (8):
cpu: allow include files for CPU definition
cpu: fix cleanup when signature parsing fails
cpu: push more parsing logic into common code
cpu: simplify failure cleanup paths
cpu: move the CPU map data files into a src/cpu_map directory
cpu: split PPC64 map data into separate files
cpu: split x86 map data into separate files
xml: report the filename (if any) when parsing files
libvirt.spec.in | 2 +-
mingw-libvirt.spec.in | 4 +-
src/Makefile.am | 7 +-
src/cpu/cpu_map.c | 161 +-
src/cpu/cpu_map.h | 22 +-
src/cpu/cpu_map.xml | 2382 ----------------------
src/cpu/cpu_ppc64.c | 142 +-
src/cpu/cpu_x86.c | 255 +--
src/cpu_map/Makefile.inc.am | 61 +
src/cpu_map/index.xml | 75 +
src/cpu_map/ppc64_POWER6.xml | 6 +
src/cpu_map/ppc64_POWER7.xml | 7 +
src/cpu_map/ppc64_POWER8.xml | 8 +
src/cpu_map/ppc64_POWER9.xml | 6 +
src/cpu_map/ppc64_POWERPC_e5500.xml | 6 +
src/cpu_map/ppc64_POWERPC_e6500.xml | 6 +
src/cpu_map/ppc64_vendors.xml | 4 +
src/cpu_map/x86_486.xml | 7 +
src/cpu_map/x86_Broadwell-IBRS.xml | 61 +
src/cpu_map/x86_Broadwell-noTSX-IBRS.xml | 59 +
src/cpu_map/x86_Broadwell-noTSX.xml | 58 +
src/cpu_map/x86_Broadwell.xml | 60 +
src/cpu_map/x86_Conroe.xml | 33 +
src/cpu_map/x86_EPYC-IBRS.xml | 73 +
src/cpu_map/x86_EPYC.xml | 72 +
src/cpu_map/x86_Haswell-IBRS.xml | 57 +
src/cpu_map/x86_Haswell-noTSX-IBRS.xml | 55 +
src/cpu_map/x86_Haswell-noTSX.xml | 54 +
src/cpu_map/x86_Haswell.xml | 56 +
src/cpu_map/x86_IvyBridge-IBRS.xml | 51 +
src/cpu_map/x86_IvyBridge.xml | 50 +
src/cpu_map/x86_Nehalem-IBRS.xml | 38 +
src/cpu_map/x86_Nehalem.xml | 37 +
src/cpu_map/x86_Opteron_G1.xml | 31 +
src/cpu_map/x86_Opteron_G2.xml | 35 +
src/cpu_map/x86_Opteron_G3.xml | 40 +
src/cpu_map/x86_Opteron_G4.xml | 50 +
src/cpu_map/x86_Opteron_G5.xml | 53 +
src/cpu_map/x86_Penryn.xml | 35 +
src/cpu_map/x86_SandyBridge-IBRS.xml | 45 +
src/cpu_map/x86_SandyBridge.xml | 44 +
src/cpu_map/x86_Skylake-Client-IBRS.xml | 70 +
src/cpu_map/x86_Skylake-Client.xml | 69 +
src/cpu_map/x86_Skylake-Server-IBRS.xml | 77 +
src/cpu_map/x86_Skylake-Server.xml | 76 +
src/cpu_map/x86_Westmere-IBRS.xml | 39 +
src/cpu_map/x86_Westmere.xml | 38 +
src/cpu_map/x86_athlon.xml | 28 +
src/cpu_map/x86_core2duo.xml | 33 +
src/cpu_map/x86_coreduo.xml | 29 +
src/cpu_map/x86_cpu64-rhel5.xml | 29 +
src/cpu_map/x86_cpu64-rhel6.xml | 31 +
src/cpu_map/x86_features.xml | 440 ++++
src/cpu_map/x86_kvm32.xml | 26 +
src/cpu_map/x86_kvm64.xml | 30 +
src/cpu_map/x86_n270.xml | 30 +
src/cpu_map/x86_pentium.xml | 13 +
src/cpu_map/x86_pentium2.xml | 22 +
src/cpu_map/x86_pentium3.xml | 23 +
src/cpu_map/x86_pentiumpro.xml | 21 +
src/cpu_map/x86_phenom.xml | 36 +
src/cpu_map/x86_qemu32.xml | 22 +
src/cpu_map/x86_qemu64.xml | 40 +
src/cpu_map/x86_vendors.xml | 4 +
src/util/virxml.c | 3 +-
65 files changed, 2819 insertions(+), 2718 deletions(-)
delete mode 100644 src/cpu/cpu_map.xml
create mode 100644 src/cpu_map/Makefile.inc.am
create mode 100644 src/cpu_map/index.xml
create mode 100644 src/cpu_map/ppc64_POWER6.xml
create mode 100644 src/cpu_map/ppc64_POWER7.xml
create mode 100644 src/cpu_map/ppc64_POWER8.xml
create mode 100644 src/cpu_map/ppc64_POWER9.xml
create mode 100644 src/cpu_map/ppc64_POWERPC_e5500.xml
create mode 100644 src/cpu_map/ppc64_POWERPC_e6500.xml
create mode 100644 src/cpu_map/ppc64_vendors.xml
create mode 100644 src/cpu_map/x86_486.xml
create mode 100644 src/cpu_map/x86_Broadwell-IBRS.xml
create mode 100644 src/cpu_map/x86_Broadwell-noTSX-IBRS.xml
create mode 100644 src/cpu_map/x86_Broadwell-noTSX.xml
create mode 100644 src/cpu_map/x86_Broadwell.xml
create mode 100644 src/cpu_map/x86_Conroe.xml
create mode 100644 src/cpu_map/x86_EPYC-IBRS.xml
create mode 100644 src/cpu_map/x86_EPYC.xml
create mode 100644 src/cpu_map/x86_Haswell-IBRS.xml
create mode 100644 src/cpu_map/x86_Haswell-noTSX-IBRS.xml
create mode 100644 src/cpu_map/x86_Haswell-noTSX.xml
create mode 100644 src/cpu_map/x86_Haswell.xml
create mode 100644 src/cpu_map/x86_IvyBridge-IBRS.xml
create mode 100644 src/cpu_map/x86_IvyBridge.xml
create mode 100644 src/cpu_map/x86_Nehalem-IBRS.xml
create mode 100644 src/cpu_map/x86_Nehalem.xml
create mode 100644 src/cpu_map/x86_Opteron_G1.xml
create mode 100644 src/cpu_map/x86_Opteron_G2.xml
create mode 100644 src/cpu_map/x86_Opteron_G3.xml
create mode 100644 src/cpu_map/x86_Opteron_G4.xml
create mode 100644 src/cpu_map/x86_Opteron_G5.xml
create mode 100644 src/cpu_map/x86_Penryn.xml
create mode 100644 src/cpu_map/x86_SandyBridge-IBRS.xml
create mode 100644 src/cpu_map/x86_SandyBridge.xml
create mode 100644 src/cpu_map/x86_Skylake-Client-IBRS.xml
create mode 100644 src/cpu_map/x86_Skylake-Client.xml
create mode 100644 src/cpu_map/x86_Skylake-Server-IBRS.xml
create mode 100644 src/cpu_map/x86_Skylake-Server.xml
create mode 100644 src/cpu_map/x86_Westmere-IBRS.xml
create mode 100644 src/cpu_map/x86_Westmere.xml
create mode 100644 src/cpu_map/x86_athlon.xml
create mode 100644 src/cpu_map/x86_core2duo.xml
create mode 100644 src/cpu_map/x86_coreduo.xml
create mode 100644 src/cpu_map/x86_cpu64-rhel5.xml
create mode 100644 src/cpu_map/x86_cpu64-rhel6.xml
create mode 100644 src/cpu_map/x86_features.xml
create mode 100644 src/cpu_map/x86_kvm32.xml
create mode 100644 src/cpu_map/x86_kvm64.xml
create mode 100644 src/cpu_map/x86_n270.xml
create mode 100644 src/cpu_map/x86_pentium.xml
create mode 100644 src/cpu_map/x86_pentium2.xml
create mode 100644 src/cpu_map/x86_pentium3.xml
create mode 100644 src/cpu_map/x86_pentiumpro.xml
create mode 100644 src/cpu_map/x86_phenom.xml
create mode 100644 src/cpu_map/x86_qemu32.xml
create mode 100644 src/cpu_map/x86_qemu64.xml
create mode 100644 src/cpu_map/x86_vendors.xml
--
2.17.1
6 years, 3 months
[libvirt] [PULL 0/3] Ui2 20180824 patches
by Gerd Hoffmann
The following changes since commit 5ccac548faf041ff5229a8e8342e3be14a34c8af:
Merge remote-tracking branch 'remotes/cody/tags/block-pull-request' into staging (2018-08-23 17:35:48 +0100)
are available in the git repository at:
git://git.kraxel.org/qemu tags/ui2-20180824-pull-request
for you to fetch changes up to eb01505ea6c8330273d189acc053cc60d00bfa1a:
ui: remove support for SDL1.2 in favour of SDL2 (2018-08-24 09:31:39 +0200)
----------------------------------------------------------------
ui: remove deprecated UI frontends
----------------------------------------------------------------
Daniel P. Berrangé (3):
ui: remove support for GTK2 in favour of GTK3
ui: increase min required GTK3 version to 3.14.0
ui: remove support for SDL1.2 in favour of SDL2
configure | 111 +-----
include/ui/gtk.h | 9 -
ui/sdl_zoom.h | 25 --
ui/sdl_zoom_template.h | 219 -----------
ui/gtk-egl.c | 10 +-
ui/gtk.c | 202 +---------
ui/sdl.c | 1027 ------------------------------------------------
ui/sdl_zoom.c | 93 -----
qemu-deprecated.texi | 16 -
ui/Makefile.objs | 5 -
10 files changed, 33 insertions(+), 1684 deletions(-)
delete mode 100644 ui/sdl_zoom.h
delete mode 100644 ui/sdl_zoom_template.h
delete mode 100644 ui/sdl.c
delete mode 100644 ui/sdl_zoom.c
--
2.9.3
6 years, 3 months
Re: [libvirt] [PATCH] vl.c: make sure maxcpus matches topology to prevent migration failure
by Eduardo Habkost
On Fri, Aug 24, 2018 at 01:26:54PM +0200, Igor Mammedov wrote:
> On Fri, 24 Aug 2018 08:11:48 -0300
> Eduardo Habkost <ehabkost(a)redhat.com> wrote:
>
> > On Fri, Aug 24, 2018 at 11:13:50AM +0200, Igor Mammedov wrote:
> > > On Thu, 23 Aug 2018 18:32:41 +0200
> > > Paolo Bonzini <pbonzini(a)redhat.com> wrote:
> > >
> > > > On 23/08/2018 16:51, Igor Mammedov wrote:
> > > > > Topology (threads*cores*sockets) must match maxcpus to be valid,
> > > > > otherwise we could start QEMU with invalid topology that throws
> > > > > a error on migration destination side, that should not be reachable:
> > > > > Source:
> > > > > -smp 8,maxcpus=64,cores=1,threads=8,sockets=1
> > > > > // hotplug cpus upto maxcpus
> > > > > Destination:
> > > > > -smp 64,maxcpus=64,cores=1,threads=8,sockets=1
> > > > > qemu: cpu topology: sockets (1) * cores (1) * threads (8) < smp_cpus (64)
> > > This destination CLI aren't exactly correct as well since
> > > it should've been exactly the same -smp as on source + a bunch of -device cpufoo...
> > > so we can always say go fix your CLI so it won't trigger error.
> > >
> > > > The destination should have sockets=8, shouldn't it?
> > > either that or cores=8 or cores=4,sockets=2 ...
> > >
> > > > It seems to me that, at startup, you should have cpus = s*t*c and cpus
> > > > <= maxcpus. Currently we check cpus <= s*t*c <= maxcpus, which doesn't
> > > > make much sense.
> > > I think that s*t*c should describe topology of whole machine
> > > including not yet plugged vcpus. "cpus = s*t*c" probably won't work
> > > for partially filled package case:
> > > -smp 1,cores=1,threads=8,sockets=1
> > > cores/threads should reflect full package configuration
> > > for guest to see an expected topology.
> >
> > Oh, now I remember: that's the reason we don't enforce
> > s*t*c == smp_cpus nor s*t*c == max_cpus.
> >
> > Both "-smp 4,maxcpus=8,cores=2,threads=2,sockets=1" and
> > "-smp 4,maxcpus=8,cores=2,threads=2,sockets=2"
> > worked since maxcpus was introduced, making the semantics of
> > "sockets" unclear and hard to change without breaking existing
> > configs.
> Should we go with deprication thingy then,
> so we could make it clear in the future?
Yes, but I'm not sure which option we should adopt
(s*t*c == smp_cpus or s*t*c == max_cpus).
Does anybody know what's the semantics expected by libvirt today?
--
Eduardo
6 years, 3 months
[libvirt] [PATCH v2 0/7] Introduce metadata locking
by Michal Privoznik
v2 of:
https://www.redhat.com/archives/libvir-list/2018-August/msg00482.html
diff to v1:
- 1/6 from original patch set is replaced with different approach.
As Dan suggested, virLockSpace accepts range to lock through its API
and has new flag that tells it to wait for the lock to be acquired.
Michal Prívozník (7):
virlockspace: Allow caller to specify start and length offset in
virLockSpaceAcquireResource
virlockspace: Introduce VIR_LOCK_SPACE_ACQUIRE_WAIT
lock_driver.h: Introduce metadata flag
lockd_driver_lockd: Implement metadata flag
lock_driver_sanlock: Handle metadata flag gracefully
domain_lock: Implement metadata locking
qemu_security: Lock metadata while relabelling
src/libvirt_private.syms | 8 +
src/locking/domain_lock.c | 304 ++++++++++++++++++++++++++++++++++---
src/locking/domain_lock.h | 28 ++++
src/locking/lock_daemon_dispatch.c | 13 +-
src/locking/lock_driver.h | 2 +
src/locking/lock_driver_lockd.c | 31 ++--
src/locking/lock_driver_lockd.h | 1 +
src/locking/lock_driver_sanlock.c | 25 ++-
src/qemu/qemu_security.c | 107 +++++++++++++
src/util/virlockspace.c | 25 ++-
src/util/virlockspace.h | 5 +
tests/virlockspacetest.c | 29 +++-
12 files changed, 525 insertions(+), 53 deletions(-)
--
2.16.4
6 years, 3 months
[libvirt] [PATCH v2 00/10] qemu: Get rid of QEMU_CAPS_ADD_FD (and improve block-commit probing)
by Peter Krempa
Diff to v1:
- stopped probing for active block-commit support when we can use QMP
schema
- qemuxml2argvmock's implementation of virCommandPassFD now passes
through specific file descriptors and ignores the rest.
Peter Krempa (10):
qemu: qapi: Simplify value handling in virQEMUQAPISchemaTraverse
qemu: qapi: Split up virQEMUQAPISchemaObjectGetType
qemu: qapi: Allow selecting specifically optional schema entries in
virQEMUQAPISchemaTraverse
qemu: capabilities: Detect active block commit via QMP schema probing
if possible
FIXUP: regenerate ordering in replies files
tests: qemuxml2argvmock: Allow 'safe' file descriptors in mocked
virCommandPassFD
qemu: command: Extract opening of TPM backend FDs for mocking purposes
tests: qemuxml2argv: modernize TPM passthrough tests
qemu: capabilities: Always assume QEMU_CAPS_ADD_FD
FIXUP: regenerate ordering in replies files
src/qemu/qemu_capabilities.c | 25 +--
src/qemu/qemu_capabilities.h | 2 +-
src/qemu/qemu_command.c | 69 ++++---
src/qemu/qemu_command.h | 7 +
src/qemu/qemu_qapi.c | 84 ++++++--
.../qemucapabilitiesdata/caps_1.5.3.x86_64.replies | 169 +++++++---------
tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml | 3 +-
.../qemucapabilitiesdata/caps_1.6.0.x86_64.replies | 169 +++++++---------
tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml | 3 +-
.../qemucapabilitiesdata/caps_1.7.0.x86_64.replies | 169 +++++++---------
tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml | 3 +-
.../qemucapabilitiesdata/caps_2.1.1.x86_64.replies | 169 +++++++---------
tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml | 3 +-
.../caps_2.10.0.aarch64.replies | 181 +++++++----------
tests/qemucapabilitiesdata/caps_2.10.0.aarch64.xml | 3 +-
.../qemucapabilitiesdata/caps_2.10.0.ppc64.replies | 181 +++++++----------
tests/qemucapabilitiesdata/caps_2.10.0.ppc64.xml | 3 +-
.../qemucapabilitiesdata/caps_2.10.0.s390x.replies | 181 +++++++----------
tests/qemucapabilitiesdata/caps_2.10.0.s390x.xml | 3 +-
.../caps_2.10.0.x86_64.replies | 213 +++++++++----------
tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml | 3 +-
.../qemucapabilitiesdata/caps_2.11.0.s390x.replies | 185 +++++++----------
tests/qemucapabilitiesdata/caps_2.11.0.s390x.xml | 3 +-
.../caps_2.11.0.x86_64.replies | 213 +++++++++----------
tests/qemucapabilitiesdata/caps_2.11.0.x86_64.xml | 3 +-
.../caps_2.12.0.aarch64.replies | 189 +++++++----------
tests/qemucapabilitiesdata/caps_2.12.0.aarch64.xml | 3 +-
.../qemucapabilitiesdata/caps_2.12.0.ppc64.replies | 189 +++++++----------
tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml | 3 +-
.../qemucapabilitiesdata/caps_2.12.0.s390x.replies | 193 ++++++++----------
tests/qemucapabilitiesdata/caps_2.12.0.s390x.xml | 3 +-
.../caps_2.12.0.x86_64.replies | 225 +++++++++------------
tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml | 3 +-
.../qemucapabilitiesdata/caps_2.4.0.x86_64.replies | 181 ++++++++---------
tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml | 3 +-
.../qemucapabilitiesdata/caps_2.5.0.x86_64.replies | 197 ++++++++----------
tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml | 3 +-
.../caps_2.6.0.aarch64.replies | 181 +++++++----------
tests/qemucapabilitiesdata/caps_2.6.0.aarch64.xml | 3 +-
.../qemucapabilitiesdata/caps_2.6.0.ppc64.replies | 181 +++++++----------
tests/qemucapabilitiesdata/caps_2.6.0.ppc64.xml | 3 +-
.../qemucapabilitiesdata/caps_2.6.0.x86_64.replies | 197 ++++++++----------
tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml | 3 +-
.../qemucapabilitiesdata/caps_2.7.0.s390x.replies | 173 +++++++---------
tests/qemucapabilitiesdata/caps_2.7.0.s390x.xml | 3 +-
.../qemucapabilitiesdata/caps_2.7.0.x86_64.replies | 197 ++++++++----------
tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml | 3 +-
.../qemucapabilitiesdata/caps_2.8.0.s390x.replies | 181 +++++++----------
tests/qemucapabilitiesdata/caps_2.8.0.s390x.xml | 3 +-
.../qemucapabilitiesdata/caps_2.8.0.x86_64.replies | 197 ++++++++----------
tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml | 3 +-
.../qemucapabilitiesdata/caps_2.9.0.ppc64.replies | 181 +++++++----------
tests/qemucapabilitiesdata/caps_2.9.0.ppc64.xml | 3 +-
.../qemucapabilitiesdata/caps_2.9.0.s390x.replies | 181 +++++++----------
tests/qemucapabilitiesdata/caps_2.9.0.s390x.xml | 3 +-
.../qemucapabilitiesdata/caps_2.9.0.x86_64.replies | 213 +++++++++----------
tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml | 3 +-
.../qemucapabilitiesdata/caps_3.0.0.ppc64.replies | 189 +++++++----------
tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml | 3 +-
.../qemucapabilitiesdata/caps_3.0.0.x86_64.replies | 225 +++++++++------------
tests/qemucapabilitiesdata/caps_3.0.0.x86_64.xml | 3 +-
tests/qemuxml2argvdata/tpm-passthrough-crb.args | 5 +-
tests/qemuxml2argvdata/tpm-passthrough.args | 5 +-
tests/qemuxml2argvmock.c | 38 +++-
64 files changed, 2415 insertions(+), 3204 deletions(-)
--
2.16.2
6 years, 3 months
[libvirt] [PATCH 0/2] Allow usage of unpriv_sgio for SCSI generic hostdev
by John Ferlan
In what is perhaps a couple lifetimes ago at this point, patches
were posted and "mostly" all eventually accepted upstream to support
unpriv_sgio on SCSI generic hostdev devices. Since the needed parts
of the functionality from the kernel perspective were not yet present
upstream, a couple of the patches were not accepted. See:
https://www.redhat.com/archives/libvir-list/2015-July/msg00204.html
and in particular patches 9 and 10. Since that time it seems things
have changed and this essentially reposts those two patches with
some minor adjustments in logic in order to "restore" the support.
There are lots of interesting tidbits in unreadable by the general
public bz's, so I won't include links here.
John Ferlan (2):
qemu: Add ability to set sgio values for hostdev
qemu: Add check for unpriv sgio for SCSI generic host device
src/qemu/qemu_conf.c | 34 ++++++++++++++++++++++++----------
1 file changed, 24 insertions(+), 10 deletions(-)
--
2.17.1
6 years, 3 months
[libvirt] [PATCH v2] process: Ignore nwfilter binding instantiation issues during reconnect
by John Ferlan
https://bugzilla.redhat.com/show_bug.cgi?id=1607202
It's essentially stated in the nwfilterBindingDelete that we
will allow the admin to shoot themselves in the foot by deleting
the nwfilter binding which then allows them to undefine the
nwfilter that is in use for the running guest...
However, by allowing this we cause a problem for libvirtd
restart reconnect processing which would then try to recreate
the missing binding attempting to use the deleted filter
resulting in an error and thus shutting the guest down.
So rather than keep adding virDomainConfNWFilterInstantiate
flags to "ignore" specific error conditions and since (so far)
this is the only path that cared about checking if the filter
already exists and ignoring, let's just ignore all errors and
make the qemuProcessFiltersInstantiate be a void which will
attempt to check all networks for bindings and reload all filters
that exist. Using the VIR_INFO in order to at least "log" the
avoided issue.
This also means virDomainConfNWFilterInstantiate no longer
needs to handle/check the ignoreExists possbility.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
v1: https://www.redhat.com/archives/libvir-list/2018-August/msg01407.html
Changes - removed the ignoreExists and just change the logic for
reconnect processing to essentially ignore all errors. If it's felt
the VIR_INFO would be too chatty (especially since it'll be generated
for every already defined filter binding), I can remove it. Another
option would be to keep the ignoreExists logic and only generate that
VIR_INFO for "other" messages. In that case, I'd probably want to change
it to a VIR_WARN. Still figured I'd post the remove it all option first
for consideration with this caveat so that "option" can be considered
as well.
src/conf/domain_nwfilter.c | 15 +++------------
src/conf/domain_nwfilter.h | 3 +--
src/lxc/lxc_process.c | 2 +-
src/qemu/qemu_hotplug.c | 4 ++--
src/qemu/qemu_interface.c | 4 ++--
src/qemu/qemu_process.c | 23 +++++++++++++++--------
src/uml/uml_conf.c | 2 +-
7 files changed, 25 insertions(+), 28 deletions(-)
diff --git a/src/conf/domain_nwfilter.c b/src/conf/domain_nwfilter.c
index f39c8a1f9b..51c9063ca7 100644
--- a/src/conf/domain_nwfilter.c
+++ b/src/conf/domain_nwfilter.c
@@ -84,8 +84,7 @@ virNWFilterBindingDefForNet(const char *vmname,
int
virDomainConfNWFilterInstantiate(const char *vmname,
const unsigned char *vmuuid,
- virDomainNetDefPtr net,
- bool ignoreExists)
+ virDomainNetDefPtr net)
{
virConnectPtr conn = virGetConnectNWFilter();
virNWFilterBindingDefPtr def = NULL;
@@ -93,20 +92,12 @@ virDomainConfNWFilterInstantiate(const char *vmname,
char *xml = NULL;
int ret = -1;
- VIR_DEBUG("vmname=%s portdev=%s filter=%s ignoreExists=%d",
- vmname, NULLSTR(net->ifname), NULLSTR(net->filter), ignoreExists);
+ VIR_DEBUG("vmname=%s portdev=%s filter=%s",
+ vmname, NULLSTR(net->ifname), NULLSTR(net->filter));
if (!conn)
goto cleanup;
- if (ignoreExists) {
- binding = virNWFilterBindingLookupByPortDev(conn, net->ifname);
- if (binding) {
- ret = 0;
- goto cleanup;
- }
- }
-
if (!(def = virNWFilterBindingDefForNet(vmname, vmuuid, net)))
goto cleanup;
diff --git a/src/conf/domain_nwfilter.h b/src/conf/domain_nwfilter.h
index 6bda228fc8..d2ebeff853 100644
--- a/src/conf/domain_nwfilter.h
+++ b/src/conf/domain_nwfilter.h
@@ -25,8 +25,7 @@
int virDomainConfNWFilterInstantiate(const char *vmname,
const unsigned char *vmuuid,
- virDomainNetDefPtr net,
- bool ignoreExists);
+ virDomainNetDefPtr net);
void virDomainConfNWFilterTeardown(virDomainNetDefPtr net);
void virDomainConfVMNWFilterTeardown(virDomainObjPtr vm);
diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c
index 33c806630b..86f7463e53 100644
--- a/src/lxc/lxc_process.c
+++ b/src/lxc/lxc_process.c
@@ -303,7 +303,7 @@ virLXCProcessSetupInterfaceTap(virDomainDefPtr vm,
}
if (net->filter &&
- virDomainConfNWFilterInstantiate(vm->name, vm->uuid, net, false) < 0)
+ virDomainConfNWFilterInstantiate(vm->name, vm->uuid, net) < 0)
goto cleanup;
ret = containerVeth;
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 0b84a503bb..38c74bd9b1 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -3435,7 +3435,7 @@ qemuDomainChangeNetFilter(virDomainObjPtr vm,
if (newdev->filter &&
virDomainConfNWFilterInstantiate(vm->def->name,
- vm->def->uuid, newdev, false) < 0) {
+ vm->def->uuid, newdev) < 0) {
virErrorPtr errobj;
virReportError(VIR_ERR_OPERATION_FAILED,
@@ -3444,7 +3444,7 @@ qemuDomainChangeNetFilter(virDomainObjPtr vm,
olddev->ifname);
virErrorPreserveLast(&errobj);
ignore_value(virDomainConfNWFilterInstantiate(vm->def->name,
- vm->def->uuid, olddev, false));
+ vm->def->uuid, olddev));
virErrorRestore(&errobj);
return -1;
}
diff --git a/src/qemu/qemu_interface.c b/src/qemu/qemu_interface.c
index a3f13093f5..5d54a85c53 100644
--- a/src/qemu/qemu_interface.c
+++ b/src/qemu/qemu_interface.c
@@ -467,7 +467,7 @@ qemuInterfaceEthernetConnect(virDomainDefPtr def,
goto cleanup;
if (net->filter &&
- virDomainConfNWFilterInstantiate(def->name, def->uuid, net, false) < 0) {
+ virDomainConfNWFilterInstantiate(def->name, def->uuid, net) < 0) {
goto cleanup;
}
@@ -586,7 +586,7 @@ qemuInterfaceBridgeConnect(virDomainDefPtr def,
goto cleanup;
if (net->filter &&
- virDomainConfNWFilterInstantiate(def->name, def->uuid, net, false) < 0) {
+ virDomainConfNWFilterInstantiate(def->name, def->uuid, net) < 0) {
goto cleanup;
}
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index ab749389ee..48d9bab128 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -3160,22 +3160,30 @@ qemuProcessNotifyNets(virDomainDefPtr def)
}
}
-static int
-qemuProcessFiltersInstantiate(virDomainDefPtr def, bool ignoreExists)
+
+/* Attempt to instantiate the filters. Ignore failures because it's
+ * (primarily) possible that a filter binding either already exists
+ * or someone deleted it and the associated filter while the guest
+ * was running and we don't want that action to cause failure to
+ * keep the guest running during the reconnection processing. */
+static void
+qemuProcessFiltersInstantiate(virDomainDefPtr def)
{
size_t i;
for (i = 0; i < def->nnets; i++) {
virDomainNetDefPtr net = def->nets[i];
if ((net->filter) && (net->ifname)) {
- if (virDomainConfNWFilterInstantiate(def->name, def->uuid, net, ignoreExists) < 0)
- return 1;
+ if (virDomainConfNWFilterInstantiate(def->name, def->uuid, net) < 0) {
+ VIR_INFO("filter '%s' instantiation for '%s' failed '%s'",
+ net->filter, net->ifname, virGetLastErrorMessage());
+ virResetLastError();
+ }
}
}
-
- return 0;
}
+
static int
qemuProcessUpdateState(virQEMUDriverPtr driver, virDomainObjPtr vm)
{
@@ -7892,8 +7900,7 @@ qemuProcessReconnect(void *opaque)
qemuProcessNotifyNets(obj->def);
- if (qemuProcessFiltersInstantiate(obj->def, true))
- goto error;
+ qemuProcessFiltersInstantiate(obj->def);
if (qemuProcessRefreshDisks(driver, obj, QEMU_ASYNC_JOB_NONE) < 0)
goto error;
diff --git a/src/uml/uml_conf.c b/src/uml/uml_conf.c
index f116e619ef..9c548f0e80 100644
--- a/src/uml/uml_conf.c
+++ b/src/uml/uml_conf.c
@@ -137,7 +137,7 @@ umlConnectTapDevice(virDomainDefPtr vm,
}
if (net->filter) {
- if (virDomainConfNWFilterInstantiate(vm->name, vm->uuid, net, false) < 0) {
+ if (virDomainConfNWFilterInstantiate(vm->name, vm->uuid, net) < 0) {
if (template_ifname)
VIR_FREE(net->ifname);
goto error;
--
2.17.1
6 years, 3 months
[libvirt] [PATCH v3] qemu: qemuDomainChangeNet: validity checks should be done before XML autocompletion
by Katerina Koukiou
This patch ensures that changes in attributes of interfaces will be emit
errors accept if they are missing from the XML.
Previously we were falsely reporting successful updates, because some
changed attributes got overwritten before the validity checks.
https://bugzilla.redhat.com/show_bug.cgi?id=1599513
Signed-off-by: Katerina Koukiou <kkoukiou(a)redhat.com>
---
Changes from v2:
* Added check for type element in info struct.
* Moved the addr checks at start the the section with info checks.
src/qemu/qemu_hotplug.c | 34 ++++++++++++++++++++++++++--------
1 file changed, 26 insertions(+), 8 deletions(-)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 0b84a503bb..f9805627b7 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -3598,16 +3598,22 @@ qemuDomainChangeNet(virQEMUDriverPtr driver,
goto cleanup;
}
- /* info: if newdev->info is empty, fill it in from olddev,
- * otherwise verify that it matches - nothing is allowed to
- * change. (There is no helper function to do this, so
- * individually check the few feidls of virDomainDeviceInfo that
- * are relevant in this case).
+ /* info: Nothing is allowed to change. First fill the missing newdev->info
+ * from olddev and then check for changes.
*/
+
+ /* if addr type is missing overwrite if from olddev */
+ if (newdev->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE)
+ newdev->info.type = olddev->info.type;
+ if (olddev->info.type != newdev->info.type) {
+ virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
+ _("cannot modify network device type"));
+ }
+
+ /* if pci addr is missing or is invalid we overwrite it from olddev */
if (!virDomainDeviceAddressIsValid(&newdev->info,
- VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) &&
- virDomainDeviceInfoCopy(&newdev->info, &olddev->info) < 0) {
- goto cleanup;
+ VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI)) {
+ newdev->info.addr.pci = olddev->info.addr.pci;
}
if (!virPCIDeviceAddressEqual(&olddev->info.addr.pci,
&newdev->info.addr.pci)) {
@@ -3622,21 +3628,33 @@ qemuDomainChangeNet(virQEMUDriverPtr driver,
/* device alias is checked already in virDomainDefCompatibleDevice */
+ if (newdev->info.rombar == VIR_TRISTATE_BOOL_ABSENT)
+ newdev->info.rombar = olddev->info.rombar;
if (olddev->info.rombar != newdev->info.rombar) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("cannot modify network device rom bar setting"));
goto cleanup;
}
+
+ if (!newdev->info.romfile &&
+ VIR_STRDUP(newdev->info.romfile, olddev->info.romfile) < 0)
+ goto cleanup;
if (STRNEQ_NULLABLE(olddev->info.romfile, newdev->info.romfile)) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("cannot modify network rom file"));
goto cleanup;
}
+
+ if (newdev->info.bootIndex == 0)
+ newdev->info.bootIndex = olddev->info.bootIndex;
if (olddev->info.bootIndex != newdev->info.bootIndex) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("cannot modify network device boot index setting"));
goto cleanup;
}
+
+ if (newdev->info.romenabled == VIR_TRISTATE_BOOL_ABSENT)
+ newdev->info.romenabled = olddev->info.romenabled;
if (olddev->info.romenabled != newdev->info.romenabled) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("cannot modify network device rom enabled setting"));
--
2.17.1
6 years, 3 months
[libvirt] [jenkins-ci PATCH v3 00/12] lcitool: Add 'build' action
by Andrea Bolognani
Changes from [v2]:
* rebase on top of master (dbc2de85f775) and integrate recent
changes to build rules on the Jenkins side;
* drop a commit that had already been merged in the meantime.
Changes from [v1]:
* rebase on top of master (985ab833be9b) and integrate recent
changes to build rules on the Jenkins side;
* build on more targets.
[v2] https://www.redhat.com/archives/libvir-list/2018-August/msg01109.html
[v1] https://www.redhat.com/archives/libvir-list/2018-August/msg00393.html
Andrea Bolognani (12):
jobs: Rename git-url -> git_url
jobs: Remove archive_format from defaults
jobs: Move some parameters from jobs to defaults
jobs: Declare empty values consistently
guests: Add build jobs
guests: Add build projects
guests: Add build playbook
lcitool: Make playbook execution generic
lcitool: Add 'build' action
lcitool: Support building arbitrary branches
guests: Support building on more targets
lcitool: Document build action
guests/README.markdown | 19 +++
guests/lcitool | 109 ++++++++++--------
.../build/jobs/autotools-build-job.yml | 15 +++
.../build/jobs/autotools-check-job.yml | 16 +++
.../build/jobs/autotools-rpm-job.yml | 15 +++
.../build/jobs/autotools-syntax-check-job.yml | 12 ++
guests/playbooks/build/jobs/defaults.yml | 42 +++++++
.../build/jobs/generic-build-job.yml | 11 ++
.../build/jobs/generic-check-job.yml | 11 ++
.../playbooks/build/jobs/generic-rpm-job.yml | 11 ++
.../build/jobs/generic-syntax-check-job.yml | 11 ++
guests/playbooks/build/jobs/go-build-job.yml | 11 ++
guests/playbooks/build/jobs/go-check-job.yml | 11 ++
.../build/jobs/perl-modulebuild-build-job.yml | 13 +++
.../build/jobs/perl-modulebuild-check-job.yml | 11 ++
.../build/jobs/perl-modulebuild-rpm-job.yml | 14 +++
guests/playbooks/build/jobs/prepare.yml | 19 +++
.../build/jobs/python-distutils-build-job.yml | 13 +++
.../build/jobs/python-distutils-check-job.yml | 11 ++
.../build/jobs/python-distutils-rpm-job.yml | 14 +++
guests/playbooks/build/main.yml | 16 +++
guests/playbooks/build/projects/libosinfo.yml | 36 ++++++
.../playbooks/build/projects/libvirt-cim.yml | 10 ++
.../playbooks/build/projects/libvirt-dbus.yml | 52 +++++++++
.../playbooks/build/projects/libvirt-glib.yml | 38 ++++++
.../build/projects/libvirt-go-xml.yml | 13 +++
.../playbooks/build/projects/libvirt-go.yml | 13 +++
.../playbooks/build/projects/libvirt-perl.yml | 19 +++
.../build/projects/libvirt-python.yml | 13 +++
.../build/projects/libvirt-sandbox.yml | 30 +++++
.../playbooks/build/projects/libvirt-tck.yml | 27 +++++
guests/playbooks/build/projects/libvirt.yml | 57 +++++++++
.../build/projects/osinfo-db-tools.yml | 36 ++++++
guests/playbooks/build/projects/osinfo-db.yml | 23 ++++
.../playbooks/build/projects/virt-manager.yml | 42 +++++++
.../playbooks/build/projects/virt-viewer.yml | 40 +++++++
jobs/autotools.yaml | 3 +-
jobs/defaults.yaml | 8 +-
jobs/generic.yaml | 3 +-
jobs/go.yaml | 3 +-
jobs/perl-modulebuild.yaml | 3 +-
jobs/python-distutils.yaml | 3 +-
projects/libosinfo.yaml | 3 +-
projects/libvirt-cim.yaml | 3 +-
projects/libvirt-dbus.yaml | 8 +-
projects/libvirt-glib.yaml | 3 +-
projects/libvirt-go-xml.yaml | 3 +-
projects/libvirt-go.yaml | 3 +-
projects/libvirt-perl.yaml | 3 +-
projects/libvirt-python.yaml | 3 +-
projects/libvirt-sandbox.yaml | 3 +-
projects/libvirt-tck.yaml | 3 +-
projects/libvirt.yaml | 2 +-
projects/osinfo-db-tools.yaml | 3 +-
projects/osinfo-db.yaml | 2 +-
projects/virt-manager.yaml | 7 +-
projects/virt-viewer.yaml | 3 +-
57 files changed, 852 insertions(+), 77 deletions(-)
create mode 100644 guests/playbooks/build/jobs/autotools-build-job.yml
create mode 100644 guests/playbooks/build/jobs/autotools-check-job.yml
create mode 100644 guests/playbooks/build/jobs/autotools-rpm-job.yml
create mode 100644 guests/playbooks/build/jobs/autotools-syntax-check-job.yml
create mode 100644 guests/playbooks/build/jobs/defaults.yml
create mode 100644 guests/playbooks/build/jobs/generic-build-job.yml
create mode 100644 guests/playbooks/build/jobs/generic-check-job.yml
create mode 100644 guests/playbooks/build/jobs/generic-rpm-job.yml
create mode 100644 guests/playbooks/build/jobs/generic-syntax-check-job.yml
create mode 100644 guests/playbooks/build/jobs/go-build-job.yml
create mode 100644 guests/playbooks/build/jobs/go-check-job.yml
create mode 100644 guests/playbooks/build/jobs/perl-modulebuild-build-job.yml
create mode 100644 guests/playbooks/build/jobs/perl-modulebuild-check-job.yml
create mode 100644 guests/playbooks/build/jobs/perl-modulebuild-rpm-job.yml
create mode 100644 guests/playbooks/build/jobs/prepare.yml
create mode 100644 guests/playbooks/build/jobs/python-distutils-build-job.yml
create mode 100644 guests/playbooks/build/jobs/python-distutils-check-job.yml
create mode 100644 guests/playbooks/build/jobs/python-distutils-rpm-job.yml
create mode 100644 guests/playbooks/build/main.yml
create mode 100644 guests/playbooks/build/projects/libosinfo.yml
create mode 100644 guests/playbooks/build/projects/libvirt-cim.yml
create mode 100644 guests/playbooks/build/projects/libvirt-dbus.yml
create mode 100644 guests/playbooks/build/projects/libvirt-glib.yml
create mode 100644 guests/playbooks/build/projects/libvirt-go-xml.yml
create mode 100644 guests/playbooks/build/projects/libvirt-go.yml
create mode 100644 guests/playbooks/build/projects/libvirt-perl.yml
create mode 100644 guests/playbooks/build/projects/libvirt-python.yml
create mode 100644 guests/playbooks/build/projects/libvirt-sandbox.yml
create mode 100644 guests/playbooks/build/projects/libvirt-tck.yml
create mode 100644 guests/playbooks/build/projects/libvirt.yml
create mode 100644 guests/playbooks/build/projects/osinfo-db-tools.yml
create mode 100644 guests/playbooks/build/projects/osinfo-db.yml
create mode 100644 guests/playbooks/build/projects/virt-manager.yml
create mode 100644 guests/playbooks/build/projects/virt-viewer.yml
--
2.17.1
6 years, 3 months