[libvirt] [PATCH] virsh: fixing segfault by pool autocompleter function.
by Julio Faracco
The commands which requires a pool to perform any action for a volume is
throwing a segfault when you pass the volume name before a pool name or
without the argument '--pool'.
An example that works:
virsh # vol-list loops-pool
Name Path
-------------------------------------------------------------------
loop0 /mnt/loop0
virsh # vol-info --pool loops-pool lo<TAB>
An example that does not work:
virsh # vol-list loops-pool
Name Path
-------------------------------------------------------------------
loop0 /mnt/loop0
virsh # vol-info lo<TAB>
Segmentation Fault
The example 'vol-info' can be executed as 'vol-info loop0 --pool
loops-pool'. So, this commit fixes this problem when the arguments are
inverted and avoids the segfault.
Signed-off-by: Julio Faracco <jcfaracco(a)gmail.com>
---
tools/virsh-pool.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tools/virsh-pool.c b/tools/virsh-pool.c
index 56b6cfc73..24a4d1ee7 100644
--- a/tools/virsh-pool.c
+++ b/tools/virsh-pool.c
@@ -143,6 +143,9 @@ virshCommandOptPoolBy(vshControl *ctl, const vshCmd *cmd, const char *optname,
if (vshCommandOptStringReq(ctl, cmd, optname, &n) < 0)
return NULL;
+ if (!n)
+ return NULL;
+
vshDebug(ctl, VSH_ERR_INFO, "%s: found option <%s>: %s\n",
cmd->def->name, optname, n);
--
2.14.1
6 years, 9 months
[libvirt] [PATCH] qemu: fix memory leak of @vporttype during migration.
by Zhangzijian
12 bytes in 1 blocks are definitely lost in loss record 188 of 1,145
at 0x4C2B6CD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x5D2CD77: xmlStrndup (in /lib/x86_64-linux-gnu/libxml2.so.2.7.8)
by 0x514E137: virXMLPropString (virxml.c:506)
by 0x234F51: qemuMigrationCookieNetworkXMLParse qemu_migration.c:1001)
by 0x235FF8: qemuMigrationCookieXMLParse (qemu_migration.c:1333)
by 0x236214: qemuMigrationCookieXMLParseStr (qemu_migration.c:1372)
by 0x2365D2: qemuMigrationEatCookie (qemu_migration.c:1456)
by 0x243DBA: qemuMigrationFinish (qemu_migration.c:6381)
by 0x204032: qemuDomainMigrateFinish3 (qemu_driver.c:13228)
by 0x521CCBB: virDomainMigrateFinish3 (libvirt-domain.c:4788)
by 0x1936DE: remoteDispatchDomainMigrateFinish3 (remote.c:4580)
by 0x16DBB1: remoteDispatchDomainMigrateFinish3Helper(remote_dispatch.h:7582)
Signed-off-by: ZhangZijian <zhang.zijian(a)h3c.com>
---
src/qemu/qemu_migration_cookie.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/qemu/qemu_migration_cookie.c b/src/qemu/qemu_migration_cookie.c
index 945530c..5a1e299 100644
--- a/src/qemu/qemu_migration_cookie.c
+++ b/src/qemu/qemu_migration_cookie.c
@@ -900,6 +900,7 @@ qemuMigrationCookieNetworkXMLParse(xmlXPathContextPtr ctxt)
goto error;
}
optr->net[i].vporttype = virNetDevVPortTypeFromString(vporttype);
+ VIR_FREE(vporttype);
}
VIR_FREE(interfaces);
--
2.9.5
6 years, 9 months
Re: [libvirt] [PATCH v5 0/7] vfio: add display support
by Alex Williamson
[CC +libvirt]
On Tue, 27 Feb 2018 09:52:02 +0100
Gerd Hoffmann <kraxel(a)redhat.com> wrote:
> This series adds support for a vgpu display to the qemu vfio code.
>
> v5:
> - rebase to latest master
> - drop DeviceState->hotpluggable patch, use separate vfio-pci-display
> device instead so we can use DeviceClass->hotpluggable.
I can't imagine that management layers are going to be happy with this
approach, it's one thing to have certain USB controllers where the
version intimately tied to the machine chipset is not hotpluggable,
while standalone versions are, but having a fork of an entirely
standalone device for this purpose sounds very invasive. What does the
XML look like that would make libvirt select this option? I'm still
thinking that a separate display device, which vfio-pci can bind to as
a device option, not affecting the hotplug-ability of the vfio-pci
device itself is the correct, but clearly difficult, approach to this.
I can't agree to a separate device unless libvirt is willing to sign up
for enabling it.
Furthermore, if we take the separate device approach, shouldn't it be
something like vfio-pci-nohotplug, where display is an option only for
this version of the DeviceClass? Thanks,
Alex
> - add vfio dma-buf patch. Right now this can be tested with '-display
> egl-headless' only. gtk and spice support is almost ready for merge
> and should follow soon.
>
> cheers,
> Gerd
>
> Gerd Hoffmann (7):
> linux-headers: update to 4.16-rc1
> standard-headers: add drm/drm_fourcc.h
> ui/pixman: add qemu_drm_format_to_pixman()
> vfio/common: cleanup in vfio_region_finalize
> vfio/display: core & wireup
> vfio/display: adding region support
> vfio/display: adding dmabuf support
>
> hw/vfio/pci.h | 4 +
> include/hw/vfio/vfio-common.h | 22 ++
> include/standard-headers/drm/drm_fourcc.h | 411 +++++++++++++++++++++
> include/standard-headers/linux/input-event-codes.h | 1 +
> include/standard-headers/linux/input.h | 11 +
> include/standard-headers/linux/pci_regs.h | 30 +-
> include/standard-headers/linux/virtio_net.h | 13 +
> include/ui/qemu-pixman.h | 5 +
> linux-headers/asm-powerpc/kvm.h | 2 +
> linux-headers/asm-powerpc/unistd.h | 3 +
> linux-headers/asm-s390/unistd.h | 401 +-------------------
> linux-headers/asm-s390/unistd_32.h | 364 ++++++++++++++++++
> linux-headers/asm-s390/unistd_64.h | 331 +++++++++++++++++
> linux-headers/asm-x86/kvm_para.h | 4 +
> linux-headers/linux/kvm.h | 90 +++++
> linux-headers/linux/psci.h | 3 +
> linux-headers/linux/vfio.h | 72 ++++
> hw/vfio/common.c | 7 +
> hw/vfio/display.c | 286 ++++++++++++++
> hw/vfio/pci.c | 30 ++
> ui/qemu-pixman.c | 22 ++
> hw/vfio/Makefile.objs | 2 +-
> scripts/update-linux-headers.sh | 7 +
> 23 files changed, 1710 insertions(+), 411 deletions(-)
> create mode 100644 include/standard-headers/drm/drm_fourcc.h
> create mode 100644 linux-headers/asm-s390/unistd_32.h
> create mode 100644 linux-headers/asm-s390/unistd_64.h
> create mode 100644 hw/vfio/display.c
>
6 years, 9 months
[libvirt] [PATCH 0/4] Misc travis improvements
by Daniel P. Berrangé
Various improvements to travis coverage. The first patch was posted
separately yesterday too.
Daniel P. Berrangé (4):
travis: add a scenario for running make distcheck
travis: make all builds use VPATH
travis: test upstart script handling on precise distro scenario
travis: run 'make install' during build tests
.travis.yml | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
--
2.14.3
6 years, 9 months
[libvirt] [PATCH v4 00/11] qemu: Validate PCI controller options
by Andrea Bolognani
Applies cleanly on top of e1ab81b339c4d631b704290c26caa0af6882527c.
Changes from [v3]:
* don't introduce new test cases that won't be able to provide
full test coverage anyway, as suggested by laine.
Changes from [v2]:
* replace the old implementation bit by bit using a clever trick
suggested by pkrempa;
* don't move QEMU capability validation;
* add a default: label to all switch statements as recommended
by danpb.
Changes from [v1]:
* error out instead of silently accept invalid options;
* shave quite a lot of yaks.
[v3] https://www.redhat.com/archives/libvir-list/2018-February/msg00996.html
[v2] https://www.redhat.com/archives/libvir-list/2018-February/msg00813.html
[v1] https://www.redhat.com/archives/libvir-list/2018-February/msg00244.html
Andrea Bolognani (11):
qemu: Create new qemuDomainDeviceDefValidateControllerPCI()
qemu: Validate PCI controller options (modelName)
qemu: Validate PCI controller options (index)
qemu: Validate PCI controller options (targetIndex)
qemu: Validate PCI controller options (pcihole64)
qemu: Validate PCI controller options (busNr)
qemu: Validate PCI controller options (numaNode)
qemu: Validate PCI controller options (chassisNr)
qemu: Validate PCI controller options (chassis and port)
qemu: Validate PCI controllers (QEMU capabilities)
qemu: Remove old qemuDomainDeviceDefValidateControllerPCI()
src/qemu/qemu_domain.c | 594 ++++++++++++++++++-------
tests/qemuxml2argvdata/pcie-expander-bus.xml | 3 -
tests/qemuxml2xmloutdata/pcie-expander-bus.xml | 4 +-
3 files changed, 440 insertions(+), 161 deletions(-)
--
2.14.3
6 years, 9 months
[libvirt] [PATCH] po: refresh translations from zanata
by Daniel P. Berrangé
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
Pushed under the "no one wants to review translations, we just
blindly trust the Fedora translators" rule ;-)
BTW, these translation refreshes are insanely huge each time I
do it, and I can't help thinking it is largely a waste of time
storing it all in GIT.... I naively wondered if we could just
have 'make dist' pull down the translations from zanata when
needed, but it would massively slow down 'make dist'. Another
idea would be to just grab latest translations when making a
formal release and provide a separate tar.xz file for them
on the download site.
po/af.po | 12979 ++++++++++++++++++++++++++------------------------
po/am.po | 12979 ++++++++++++++++++++++++++------------------------
po/anp.po | 12979 ++++++++++++++++++++++++++------------------------
po/ar.po | 13018 ++++++++++++++++++++++++++------------------------
po/as.po | 13660 +++++++++++++++++++++++++++-------------------------
po/ast.po | 12979 ++++++++++++++++++++++++++------------------------
po/bal.po | 12979 ++++++++++++++++++++++++++------------------------
po/be.po | 12979 ++++++++++++++++++++++++++------------------------
po/bg.po | 13021 ++++++++++++++++++++++++++------------------------
po/bn.po | 13018 ++++++++++++++++++++++++++------------------------
po/bn_IN.po | 13071 ++++++++++++++++++++++++++------------------------
po/bo.po | 12979 ++++++++++++++++++++++++++------------------------
po/br.po | 12979 ++++++++++++++++++++++++++------------------------
po/brx.po | 12979 ++++++++++++++++++++++++++------------------------
po/bs.po | 13018 ++++++++++++++++++++++++++------------------------
po/ca.po | 13094 ++++++++++++++++++++++++++------------------------
po/cs.po | 13026 ++++++++++++++++++++++++++------------------------
po/cy.po | 13020 ++++++++++++++++++++++++++------------------------
po/da.po | 13021 ++++++++++++++++++++++++++------------------------
po/de.po | 13547 +++++++++++++++++++++++++++-------------------------
po/de_CH.po | 12979 ++++++++++++++++++++++++++------------------------
po/el.po | 13040 ++++++++++++++++++++++++++------------------------
po/en_GB.po | 13629 +++++++++++++++++++++++++++-------------------------
po/eo.po | 12979 ++++++++++++++++++++++++++------------------------
po/es.po | 13115 ++++++++++++++++++++++++++------------------------
po/et.po | 13018 ++++++++++++++++++++++++++------------------------
po/eu.po | 13018 ++++++++++++++++++++++++++------------------------
po/fa.po | 12979 ++++++++++++++++++++++++++------------------------
po/fi.po | 13023 ++++++++++++++++++++++++++------------------------
po/fr.po | 13067 ++++++++++++++++++++++++++------------------------
po/gl.po | 13022 ++++++++++++++++++++++++++------------------------
po/gu.po | 13620 +++++++++++++++++++++++++++-------------------------
po/he.po | 13018 ++++++++++++++++++++++++++------------------------
po/hi.po | 13102 ++++++++++++++++++++++++++------------------------
po/hr.po | 12979 ++++++++++++++++++++++++++------------------------
po/hu.po | 13021 ++++++++++++++++++++++++++------------------------
po/ia.po | 12979 ++++++++++++++++++++++++++------------------------
po/id.po | 13014 ++++++++++++++++++++++++++------------------------
po/ilo.po | 12979 ++++++++++++++++++++++++++------------------------
po/is.po | 13018 ++++++++++++++++++++++++++------------------------
po/it.po | 13045 ++++++++++++++++++++++++++------------------------
po/ja.po | 13676 +++++++++++++++++++++++++++-------------------------
po/ka.po | 13018 ++++++++++++++++++++++++++------------------------
po/kk.po | 12979 ++++++++++++++++++++++++++------------------------
po/km.po | 12979 ++++++++++++++++++++++++++------------------------
po/kn.po | 13656 +++++++++++++++++++++++++++-------------------------
po/ko.po | 13083 ++++++++++++++++++++++++++------------------------
po/kw.po | 12979 ++++++++++++++++++++++++++------------------------
po/kw(a)kkcor.po | 12979 ++++++++++++++++++++++++++------------------------
po/kw(a)uccor.po | 12979 ++++++++++++++++++++++++++------------------------
po/kw_GB.po | 12979 ++++++++++++++++++++++++++------------------------
po/ky.po | 12979 ++++++++++++++++++++++++++------------------------
po/libvirt.pot | 12981 ++++++++++++++++++++++++++------------------------
po/lt.po | 13018 ++++++++++++++++++++++++++------------------------
po/lv.po | 13018 ++++++++++++++++++++++++++------------------------
po/mai.po | 12979 ++++++++++++++++++++++++++------------------------
po/mk.po | 13021 ++++++++++++++++++++++++++------------------------
po/ml.po | 13652 +++++++++++++++++++++++++++-------------------------
po/mn.po | 12979 ++++++++++++++++++++++++++------------------------
po/mr.po | 13622 +++++++++++++++++++++++++++-------------------------
po/ms.po | 13004 ++++++++++++++++++++++++++------------------------
po/nb.po | 13011 ++++++++++++++++++++++++++------------------------
po/nds.po | 12979 ++++++++++++++++++++++++++------------------------
po/ne.po | 12979 ++++++++++++++++++++++++++------------------------
po/nl.po | 13052 ++++++++++++++++++++++++++------------------------
po/nn.po | 13018 ++++++++++++++++++++++++++------------------------
po/nso.po | 13018 ++++++++++++++++++++++++++------------------------
po/or.po | 13650 +++++++++++++++++++++++++++-------------------------
po/pa.po | 13646 +++++++++++++++++++++++++++-------------------------
po/pl.po | 13050 ++++++++++++++++++++++++++------------------------
po/pt.po | 13008 ++++++++++++++++++++++++++------------------------
po/pt_BR.po | 13549 +++++++++++++++++++++++++++-------------------------
po/ro.po | 13018 ++++++++++++++++++++++++++------------------------
po/ru.po | 13652 +++++++++++++++++++++++++++-------------------------
po/si.po | 13018 ++++++++++++++++++++++++++------------------------
po/sk.po | 13018 ++++++++++++++++++++++++++------------------------
po/sl.po | 13018 ++++++++++++++++++++++++++------------------------
po/sq.po | 12981 ++++++++++++++++++++++++++------------------------
po/sr.po | 13051 ++++++++++++++++++++++++++------------------------
po/sr(a)latin.po | 13051 ++++++++++++++++++++++++++------------------------
po/sv.po | 13701 +++++++++++++++++++++++++++-------------------------
po/ta.po | 13606 +++++++++++++++++++++++++++-------------------------
po/te.po | 13100 ++++++++++++++++++++++++++------------------------
po/tg.po | 12979 ++++++++++++++++++++++++++------------------------
po/th.po | 13018 ++++++++++++++++++++++++++------------------------
po/tr.po | 13018 ++++++++++++++++++++++++++------------------------
po/tw.po | 12979 ++++++++++++++++++++++++++------------------------
po/uk.po | 14243 +++++++++++++++++++++++++++++--------------------------
po/ur.po | 13018 ++++++++++++++++++++++++++------------------------
po/vi.po | 13055 ++++++++++++++++++++++++++------------------------
po/wba.po | 12979 ++++++++++++++++++++++++++------------------------
po/yo.po | 12979 ++++++++++++++++++++++++++------------------------
po/zh_CN.po | 13674 +++++++++++++++++++++++++++-------------------------
po/zh_HK.po | 12979 ++++++++++++++++++++++++++------------------------
po/zh_TW.po | 13029 ++++++++++++++++++++++++++------------------------
po/zu.po | 13018 ++++++++++++++++++++++++++------------------------
96 files changed, 658398 insertions(+), 601273 deletions(-)
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
6 years, 9 months
[libvirt] [PATCH] storage: fix sheepdog driver / test linking to avoid duplicating source
by Daniel P. Berrangé
The libvirt_storage_backend_sheepdog_priv.la library depends on symbols
provided in the libvirt_driver_storage_impl.la library. As such the
latter must be listed 2nd when passed to the linker to avoid symbol
resolution problems. This mistake is being masked by the sheepdog
driver linking in a second copy of the storage driver code. Remove
this duplicate linkage of backend source and fix the test link order.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/Makefile.am | 3 +--
tests/Makefile.am | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index d3a01dbbe7..8d72f2f1e5 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1359,8 +1359,7 @@ libvirt_storage_backend_sheepdog_la_CFLAGS = \
$(AM_CFLAGS)
libvirt_storage_backend_sheepdog_priv_la_SOURCES = \
- $(STORAGE_DRIVER_SHEEPDOG_SOURCES) \
- $(STORAGE_DRIVER_BACKEND_SOURCES)
+ $(STORAGE_DRIVER_SHEEPDOG_SOURCES)
libvirt_storage_backend_sheepdog_priv_la_CFLAGS = \
-I$(srcdir)/conf \
$(AM_CFLAGS)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 09647a959d..d794df3e5c 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -842,8 +842,8 @@ storagebackendsheepdogtest_SOURCES = \
storagebackendsheepdogtest.c \
testutils.c testutils.h
storagebackendsheepdogtest_LDADD = \
- ../src/libvirt_driver_storage_impl.la \
../src/libvirt_storage_backend_sheepdog_priv.la \
+ ../src/libvirt_driver_storage_impl.la \
$(LDADDS)
else ! WITH_STORAGE_SHEEPDOG
EXTRA_DIST += storagebackendsheepdogtest.c
--
2.14.3
6 years, 9 months
[libvirt] [PATCH] make: fix uninstall of subdirectory data
by Daniel P. Berrangé
A typo in the uninstall-data-extra rule expansion meant we just called
the install rule again, instead of the uninstall rule. While fixing
this, just inline the dependancy, since the intermediate
install-data-extra rule adds no value.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/Makefile.am | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index 46724673d2..d3a01dbbe7 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -99,9 +99,6 @@ include xenapi/Makefile.inc.am
include vz/Makefile.inc.am
include lxc/Makefile.inc.am
-install-data-extra: $(INSTALL_DATA_DIRS:%=install-data-%)
-uninstall-data-extra: $(INSTALL_DATA_DIRS:%=install-data-%)
-
THREAD_LIBS = $(LIB_PTHREAD) $(LTLIBMULTITHREAD)
@@ -2863,7 +2860,7 @@ endif WITH_NSS
install-data-local: install-init install-systemd install-upstart \
install-sysctl install-polkit install-sasl \
- install-logrotate install-data-extra
+ install-logrotate $(INSTALL_DATA_DIRS:%=install-data-%)
if WITH_LIBVIRTD
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt"
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd"
@@ -2899,7 +2896,7 @@ endif WITH_NETWORK
uninstall-local:: uninstall-init uninstall-systemd uninstall-upstart \
uninstall-sysctl uninstall-polkit uninstall-sasl \
- uninstall-logrotate uninstall-data-extra
+ uninstall-logrotate $(INSTALL_DATA_DIRS:%=uninstall-data-%)
if WITH_LIBVIRTD
rmdir "$(DESTDIR)$(localstatedir)/log/libvirt" ||:
rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files" ||:
--
2.14.3
6 years, 9 months
[libvirt] [PATCH v4 0/8] Add setting CPU features (CPUID) with libxenlight driver.
by Marek Marczykowski-Górecki
Add support for CPUID setting based on <cpu> element. Since libxl format
support only adjusting specific bits over host CPU, only
mode='host-passthrough' is supported - other values are rejected (including
default 'custom'). This will break some configurations working before (bare
<cpu> element with for example NUMA configuration), but libxl driver never
supported full 'custom' mode - it was silently ignored, which might lead to
some unexpected effects.
Since mode='host-passthrough' is now necessary to specify CPU options, do not
enable nested HVM feature by mere presence of this element, require also
enabling it in libxl.conf. Nested HVM is still in "preview" state, so better be
explicit here.
v2 of this patch series:
https://www.redhat.com/archives/libvir-list/2017-July/msg00050.html
v3 of this patch series:
https://www.redhat.com/archives/libvir-list/2017-December/msg00314.html
Marek Marczykowski-Górecki (8):
libxl: fix libxlDriverConfigDispose for partially constructed object
libxl: pass driver config to libxlMakeDomBuildInfo
libxl: error out on not supported CPU mode, instead of silently ignoring
libxl: do not enable nested HVM unless global nested_hvm option enabled
libxl: add support for CPUID features policy
tests: check CPU features handling in libxl driver
xenconfig: add CPUID handling to domXML <-> xl.cfg conversion
tests: add test case for CPUID in xenconfig driver
src/libxl/libxl.conf | 6 +-
src/libxl/libxl_conf.c | 63 +-
src/libxl/libxl_conf.h | 4 +-
src/libxl/libxl_domain.c | 2 +-
src/xenconfig/xen_xl.c | 237 ++++++++-
src/xenconfig/xen_xl.h | 2 +-
tests/libxlxml2domconfigdata/fullvirt-cpuid.json | 64 ++-
tests/libxlxml2domconfigdata/fullvirt-cpuid.xml | 37 +-
tests/libxlxml2domconfigtest.c | 24 +-
tests/virmocklibxl.c | 25 +-
tests/xlconfigdata/test-fullvirt-cpuid.cfg | 25 +-
tests/xlconfigdata/test-fullvirt-cpuid.xml | 35 +-
tests/xlconfigdata/test-fullvirt-vnuma-autocomplete.cfg | 1 +-
tests/xlconfigdata/test-fullvirt-vnuma-autocomplete.xml | 2 +-
tests/xlconfigdata/test-fullvirt-vnuma-nodistances.cfg | 1 +-
tests/xlconfigdata/test-fullvirt-vnuma-nodistances.xml | 2 +-
tests/xlconfigdata/test-fullvirt-vnuma-partialdist.cfg | 1 +-
tests/xlconfigdata/test-fullvirt-vnuma-partialdist.xml | 2 +-
tests/xlconfigdata/test-fullvirt-vnuma.cfg | 1 +-
tests/xlconfigdata/test-fullvirt-vnuma.xml | 2 +-
tests/xlconfigtest.c | 1 +-
21 files changed, 491 insertions(+), 46 deletions(-)
create mode 100644 tests/libxlxml2domconfigdata/fullvirt-cpuid.json
create mode 100644 tests/libxlxml2domconfigdata/fullvirt-cpuid.xml
create mode 100644 tests/xlconfigdata/test-fullvirt-cpuid.cfg
create mode 100644 tests/xlconfigdata/test-fullvirt-cpuid.xml
base-commit: 6ce3acc129bfdbe7fd02bcb8bbe8af6d13903684
--
git-series 0.9.1
6 years, 9 months
[libvirt] [PATCH libvirt] qemu: log the crash information for S390
by Bjoern Walk
Since QEMU 2.12 guest crash information for S390 is available in the
QEMU monitor, e.g.:
{
"timestamp": {
"seconds": 1518004739,
"microseconds": 552563
},
"event": "GUEST_PANICKED",
"data": {
"action": "pause",
"info": {
"core": 0,
"psw-addr": 1102832,
"reason": "disabled-wait",
"psw-mask": 562956395872256,
"type": "s390"
}
}
}
Let's log this information into the domain log file, e.g.:
2018-02-08 13:11:26.075+0000: panic s390: core='0' psw-mask='0x0002000180000000' psw-addr='0x000000000010f146' reason='disabled-wait'
Reviewed-by: Boris Fiuczynski <fiuczy(a)linux.vnet.ibm.com>
Signed-off-by: Bjoern Walk <bwalk(a)linux.vnet.ibm.com>
---
src/qemu/qemu_monitor.c | 19 ++++++++++++++++++-
src/qemu/qemu_monitor.h | 12 ++++++++++++
src/qemu/qemu_monitor_json.c | 40 ++++++++++++++++++++++++++++++++++++++++
3 files changed, 70 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index 9b5ad72c..8c394583 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -4363,7 +4363,14 @@ qemuMonitorGuestPanicEventInfoFormatMsg(qemuMonitorEventPanicInfoPtr info)
info->data.hyperv.arg3, info->data.hyperv.arg4,
info->data.hyperv.arg5));
break;
-
+ case QEMU_MONITOR_EVENT_PANIC_INFO_TYPE_S390:
+ ignore_value(virAsprintf(&ret, "s390: core='%d' psw-mask='0x%016llx' "
+ "psw-addr='0x%016llx' reason='%s'",
+ info->data.s390.core,
+ info->data.s390.psw_mask,
+ info->data.s390.psw_addr,
+ info->data.s390.reason));
+ break;
case QEMU_MONITOR_EVENT_PANIC_INFO_TYPE_NONE:
case QEMU_MONITOR_EVENT_PANIC_INFO_TYPE_LAST:
break;
@@ -4379,6 +4386,16 @@ qemuMonitorEventPanicInfoFree(qemuMonitorEventPanicInfoPtr info)
if (!info)
return;
+ switch (info->type) {
+ case QEMU_MONITOR_EVENT_PANIC_INFO_TYPE_S390:
+ VIR_FREE(info->data.s390.reason);
+ break;
+ case QEMU_MONITOR_EVENT_PANIC_INFO_TYPE_NONE:
+ case QEMU_MONITOR_EVENT_PANIC_INFO_TYPE_HYPERV:
+ case QEMU_MONITOR_EVENT_PANIC_INFO_TYPE_LAST:
+ break;
+ }
+
VIR_FREE(info);
}
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index ea0c01ae..4b3a5e21 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -73,6 +73,7 @@ struct _qemuMonitorMessage {
typedef enum {
QEMU_MONITOR_EVENT_PANIC_INFO_TYPE_NONE = 0,
QEMU_MONITOR_EVENT_PANIC_INFO_TYPE_HYPERV,
+ QEMU_MONITOR_EVENT_PANIC_INFO_TYPE_S390,
QEMU_MONITOR_EVENT_PANIC_INFO_TYPE_LAST
} qemuMonitorEventPanicInfoType;
@@ -88,12 +89,23 @@ struct _qemuMonitorEventPanicInfoHyperv {
unsigned long long arg5;
};
+typedef struct _qemuMonitorEventPanicInfoS390 qemuMonitorEventPanicInfoS390;
+typedef qemuMonitorEventPanicInfoS390 *qemuMonitorEventPanicInfoS390Ptr;
+struct _qemuMonitorEventPanicInfoS390 {
+ /* S390 specific guest panic information */
+ int core;
+ unsigned long long psw_mask;
+ unsigned long long psw_addr;
+ char *reason;
+};
+
typedef struct _qemuMonitorEventPanicInfo qemuMonitorEventPanicInfo;
typedef qemuMonitorEventPanicInfo *qemuMonitorEventPanicInfoPtr;
struct _qemuMonitorEventPanicInfo {
qemuMonitorEventPanicInfoType type;
union {
qemuMonitorEventPanicInfoHyperv hyperv;
+ qemuMonitorEventPanicInfoS390 s390;
} data;
};
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 242b92ea..5c1f6836 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -576,6 +576,44 @@ qemuMonitorJSONGuestPanicExtractInfoHyperv(virJSONValuePtr data)
return NULL;
}
+static qemuMonitorEventPanicInfoPtr
+qemuMonitorJSONGuestPanicExtractInfoS390(virJSONValuePtr data)
+{
+ qemuMonitorEventPanicInfoPtr ret;
+ int core;
+ unsigned long long psw_mask, psw_addr;
+ const char *reason = NULL;
+
+ if (VIR_ALLOC(ret) < 0)
+ return NULL;
+
+ ret->type = QEMU_MONITOR_EVENT_PANIC_INFO_TYPE_S390;
+
+ if (virJSONValueObjectGetNumberInt(data, "core", &core) < 0 ||
+ virJSONValueObjectGetNumberUlong(data, "psw-mask", &psw_mask) < 0 ||
+ virJSONValueObjectGetNumberUlong(data, "psw-addr", &psw_addr) < 0) {
+ goto error;
+ }
+
+ ret->data.s390.core = core;
+ ret->data.s390.psw_mask = psw_mask;
+ ret->data.s390.psw_addr = psw_addr;
+
+ reason = virJSONValueObjectGetString(data, "reason");
+ if (!reason)
+ goto error;
+
+ if (VIR_STRDUP(ret->data.s390.reason, reason) < 0)
+ goto no_memory;
+
+ return ret;
+
+ error:
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("malformed s390 panic data"));
+ no_memory:
+ qemuMonitorEventPanicInfoFree(ret);
+ return NULL;
+}
static qemuMonitorEventPanicInfoPtr
qemuMonitorJSONGuestPanicExtractInfo(virJSONValuePtr data)
@@ -584,6 +622,8 @@ qemuMonitorJSONGuestPanicExtractInfo(virJSONValuePtr data)
if (STREQ_NULLABLE(type, "hyper-v"))
return qemuMonitorJSONGuestPanicExtractInfoHyperv(data);
+ else if (STREQ_NULLABLE(type, "s390"))
+ return qemuMonitorJSONGuestPanicExtractInfoS390(data);
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unknown panic info type '%s'"), NULLSTR(type));
--
2.13.4
6 years, 9 months