[PATCH] securityselinuxlabeltest: Add debug statements for testUserXattrEnabled return value
by Peter Krempa
I've noticed the test being skipped in my build scenario (tmpfs) and
the output doesn't make it clear why it's happening.
Add debug statements for the various return values of
testUserXattrEnabled.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
tests/securityselinuxlabeltest.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/tests/securityselinuxlabeltest.c b/tests/securityselinuxlabeltest.c
index b1a6735d33..f7dd3c866a 100644
--- a/tests/securityselinuxlabeltest.c
+++ b/tests/securityselinuxlabeltest.c
@@ -325,10 +325,15 @@ mymain(void)
int rc = testUserXattrEnabled();
g_autoptr(virQEMUCaps) qemuCaps = NULL;
- if (rc < 0)
+ if (rc < 0) {
+ VIR_TEST_VERBOSE("failed to determine xattr support");
return EXIT_FAILURE;
- if (!rc)
+ }
+
+ if (rc == 0) {
+ VIR_TEST_VERBOSE("xattr unsupported");
return EXIT_AM_SKIP;
+ }
if (!(mgr = virSecurityManagerNew("selinux", "QEMU",
VIR_SECURITY_MANAGER_DEFAULT_CONFINED |
--
2.31.1
3 years, 4 months
[PATCH] gitlab: let rawhide container builds fail
by Daniel P. Berrangé
The nature of Fedora rawhide means that it will inevitably have failures
periodically. Currently it is failing to even update packages due to
glibc switching to use of clone3 syscall, which is mistakenly blocked by
seccomp in container runtimes using EPERM instead of ENOSYS.
When we fail to build the rawhide containers, it is quite likely that we
still have the previous build available in the gitlab registry, so it is
reasonable to allow the container job to fail and try the build job
anyway.
Ideally we would ignore the container build failure if-and-only-if the
previous container was build with the same list of packages. We don't
record the original dependency package list though, so that's not
currently possible.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
.gitlab-ci.yml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 4757139fa9..344ecdf3ba 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -186,7 +186,7 @@ x64-fedora-34-container:
NAME: fedora-34
x64-fedora-rawhide-container:
- extends: .container_job
+ extends: .container_optional_job
variables:
NAME: fedora-rawhide
@@ -299,12 +299,12 @@ s390x-debian-sid-container:
NAME: debian-sid-cross-s390x
mingw32-fedora-rawhide-container:
- extends: .container_job
+ extends: .container_optional_job
variables:
NAME: fedora-rawhide-cross-mingw32
mingw64-fedora-rawhide-container:
- extends: .container_job
+ extends: .container_optional_job
variables:
NAME: fedora-rawhide-cross-mingw64
--
2.31.1
3 years, 4 months
[libvirt PATCH] docs: Fix two spelling mistakes
by Tim Wiederhake
Signed-off-by: Tim Wiederhake <twiederh(a)redhat.com>
---
docs/kbase/qemu-core-dump.rst | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/kbase/qemu-core-dump.rst b/docs/kbase/qemu-core-dump.rst
index 44fd40fc52..5c3781cf90 100644
--- a/docs/kbase/qemu-core-dump.rst
+++ b/docs/kbase/qemu-core-dump.rst
@@ -11,7 +11,7 @@ QEMU driver configuration
There is a global setting in the QEMU driver configuration file that controls
whether core dumps are permitted, and their maximum size. Enabling core dumps
-is simply a matter of setting the maximum size to a non-zero value by editting
+is simply a matter of setting the maximum size to a non-zero value by editing
the ``/etc/libvirt/qemu.conf`` file:
::
@@ -65,7 +65,7 @@ machine basis in the XML configuration:
<memory dumpCore="on">...</memory>
-Note, it is still neccessary to at least set ``max_core`` to a non-zero
+Note, it is still necessary to at least set ``max_core`` to a non-zero
value in the global configuration file.
Some management applications may not offer the ability to customimze the
--
2.31.1
3 years, 4 months
[PATCH] qemu_vhost_user: don't raise error for unknown features
by Cole Robinson
Similar to what was done for qemu_firmware.c in 61d95a1073, don't
report an error for unknown vhost-user features, just log it and
correctly continue on
Signed-off-by: Cole Robinson <crobinso(a)redhat.com>
---
src/qemu/qemu_vhost_user.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/qemu/qemu_vhost_user.c b/src/qemu/qemu_vhost_user.c
index bc8e7ad898..75cc718c09 100644
--- a/src/qemu/qemu_vhost_user.c
+++ b/src/qemu/qemu_vhost_user.c
@@ -280,6 +280,7 @@ qemuVhostUserGPUFillCapabilities(qemuVhostUser *vu,
qemuVhostUserGPU *gpu = &vu->capabilities.gpu;
virJSONValue *featuresJSON;
size_t nfeatures;
+ size_t nparsed = 0;
size_t i;
g_autoptr(qemuVhostUserGPUFeature) features = NULL;
@@ -299,17 +300,16 @@ qemuVhostUserGPUFillCapabilities(qemuVhostUser *vu,
int tmp;
if ((tmp = qemuVhostUserGPUFeatureTypeFromString(tmpStr)) <= 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("unknown feature %s"),
- tmpStr);
+ VIR_DEBUG("ignoring unknown QEMU vhost-user feature '%s'", tmpStr);
continue;
}
- features[i] = tmp;
+ features[nparsed] = tmp;
+ nparsed++;
}
gpu->features = g_steal_pointer(&features);
- gpu->nfeatures = nfeatures;
+ gpu->nfeatures = nparsed;
return 0;
}
--
2.31.1
3 years, 4 months
[PATCH] qemu: process: Ignore 'RESET' event during startup
by Peter Krempa
In cases when we are adding a <transient/> disk with sharing backend
(and thus hotplugging it) we need to re-initialize ACPI tables so that
the VM boots from the correct device.
This has a side-effect of emitting the RESET event and handling it which
in case when the 'on_reset' policy is set to 'destroy' can even kill the
VM.
Fix this by ignoring RESET events during startup of the VM.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_process.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 521fda57da..d6ed4a3943 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -429,12 +429,20 @@ qemuProcessHandleReset(qemuMonitor *mon G_GNUC_UNUSED,
void *opaque)
{
virQEMUDriver *driver = opaque;
- virObjectEvent *event;
+ virObjectEvent *event = NULL;
qemuDomainObjPrivate *priv;
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
virObjectLock(vm);
+ /* ignore reset events on VM startup. Libvirt in certain instances does a
+ * reset during startup so that the ACPI tables are re-generated */
+ if (vm->state.state == VIR_DOMAIN_PAUSED &&
+ vm->state.reason == VIR_DOMAIN_PAUSED_STARTING_UP) {
+ VIR_DEBUG("ignoring reset event during startup");
+ goto cleanup;
+ }
+
event = virDomainEventRebootNewFromObj(vm);
priv = vm->privateData;
if (priv->agent)
--
2.31.1
3 years, 4 months
[PATCH 0/2] Another round of capng_apply() fixes
by Michal Privoznik
See 2/2 for explanation.
Michal Prívozník (2):
virSetUIDGIDWithCaps: Check for capng_apply() retval properly
virSetUIDGIDWithCaps: Set bounding capabilities only with CAP_SETPCAP
src/util/virutil.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--
2.31.1
3 years, 4 months
[libvirt PATCH v2] src: workaround warning triggered in glib 2.69
by Daniel P. Berrangé
Libvirt is using the G_GNUC_FALLTHROUGH macro provided by glib since
version 2.60. Since we need to support older glib, we also have some
compatibility code to define it if missing.
We set the GLIB_VERSION_MAX_ALLOWED macro to ensure we get warnings
when we use an API that dates from a glib version newer than our
minimum benchmark. Historically this didn't get enforced for (most)
macros, but GLib 2.69 has addressed that gap.
This causes our usage of G_GNUC_FALLTHROUGH to trigger warnings.
GLib is right to warn, because it does not know that we have added
our own fallback for older versions.
The only way to squelch this warning though, is to fully undefine
the GLib provided G_GNUC_FALLTHROUGH and use our own in its place.
We'll be able to remove all this compat burden when we finally
update the min glib version to be >= 2.60
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/internal.h | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/internal.h b/src/internal.h
index 0a03dfc46f..e1250a59fe 100644
--- a/src/internal.h
+++ b/src/internal.h
@@ -147,8 +147,17 @@
*
* silence the compiler warning when falling through a switch case
*
- * TODO: Remove after upgrading to GLib >= 2.60
+ * Note: GLib 2.69.0 introduced version checks on the
+ * macro usage. Thus an app setting GLIB_VERSION_MAX_ALLOWED
+ * to less than 2.60 will trigger a warning using G_GNUC_FALLTHROUGH
+ * Normally the warning is a good thing, but we want to use our
+ * fallback impl, so we have to temporarily cull the GLib macro.
+ *
+ * All this should be removed once updating to min GLib >= 2.60
*/
+#if GLIB_CHECK_VERSION(2, 69, 0)
+# undef G_GNUC_FALLTHROUGH
+#endif
#ifndef G_GNUC_FALLTHROUGH
# if __GNUC_PREREQ (7, 0)
# define G_GNUC_FALLTHROUGH __attribute__((fallthrough))
--
2.31.1
3 years, 4 months
[PATCH] storage: create logical volume with --yes option
by Kristina Hanicova
If lvcreate found an existing signature when trying to create a
new logical volume (E.g. left after some deleted volume), the
action failed due to inability to answer interactive question to
wiping it (lvcreate assumed 'no' was the answer). With added
option --yes to the command line, the answer to any interactive
question is assumed to be yes. Therefore, lvcreate wipes the
signature and the new volume is created successfully.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1940413
Signed-off-by: Kristina Hanicova <khanicov(a)redhat.com>
---
src/storage/storage_backend_logical.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/storage/storage_backend_logical.c b/src/storage/storage_backend_logical.c
index ed8e47d880..02ede74aeb 100644
--- a/src/storage/storage_backend_logical.c
+++ b/src/storage/storage_backend_logical.c
@@ -863,6 +863,8 @@ virStorageBackendLogicalLVCreate(virStorageVolDef *vol,
else
virCommandAddArg(cmd, def->source.name);
+ virCommandAddArg(cmd, "--yes");
+
return virCommandRun(cmd, NULL);
}
--
2.31.1
3 years, 4 months
[PATCH] conf: Add grabToggle to evdev input
by Justin Gatzen
Add support for customizable grabToggle key combinations with
<input type='evdev'>.
Signed-off-by: Justin Gatzen <justin.gatzen(a)gmail.com>
---
docs/formatdomain.rst | 12 +++++++-----
docs/schemas/domaincommon.rng | 12 ++++++++++++
src/conf/domain_conf.c | 19 +++++++++++++++++++
src/conf/domain_conf.h | 14 ++++++++++++++
src/libvirt_private.syms | 2 ++
src/qemu/qemu_command.c | 5 +++++
.../input-linux.x86_64-latest.args | 2 +-
tests/qemuxml2argvdata/input-linux.xml | 2 +-
8 files changed, 61 insertions(+), 7 deletions(-)
diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
index b621591515..61ccd8895a 100644
--- a/docs/formatdomain.rst
+++ b/docs/formatdomain.rst
@@ -5747,7 +5747,7 @@ to provide a graphics tablet for absolute cursor movement.
<source evdev='/dev/input/event1'/>
</input>
<input type='evdev'>
- <source dev='/dev/input/event1234' grab='all' repeat='on'/>
+ <source dev='/dev/input/event1234' grab='all' repeat='on' grabToggle='ctrl-ctrl'/>
</input>
</devices>
...
@@ -5768,10 +5768,12 @@ On S390, ``address`` can be used to provide a CCW address for an input device (
sub-element ``source`` must have an ``evdev`` (for ``passthrough``) or ``dev``
(for ``evdev``) attribute containing the absolute path to the event device
passed through to guests.
-For type ``evdev``, ``source`` can have two optional attributes ``grab`` with
-value 'all' which when enabled grabs all input devices instead of just one and
-``repeat`` with value 'on'/'off' to enable/disable auto-repeat events (
-:since:`Since 7.4.0`).
+For type ``evdev``, ``source`` has three optional attributes ``grab`` with
+value 'all' which when enabled grabs all input devices instead of just one,
+``repeat`` with value 'on'/'off' to enable/disable auto-repeat events and
+``grabToggle`` (:since:`since 7.6.0`) with values ``ctrl-ctrl``, ``alt-alt``,
+``shift-shift``, ``meta-meta``, ``scrolllock`` or ``ctrl-scrolllock`` to
+change the grab key combination.
``input`` type ``evdev`` is currently supported only on linux devices.
(KVM only) :since:`Since 5.2.0` , the ``input`` element accepts a
``model`` attribute which has the values 'virtio', 'virtio-transitional' and
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 538581360d..14c5d4ee68 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -5484,6 +5484,18 @@
<value>all</value>
</attribute>
</optional>
+ <optional>
+ <attribute name="grabToggle">
+ <choice>
+ <value>ctrl-ctrl</value>
+ <value>alt-alt</value>
+ <value>shift-shift</value>
+ <value>meta-meta</value>
+ <value>scrolllock</value>
+ <value>ctrl-scrolllock</value>
+ </choice>
+ </attribute>
+ </optional>
<optional>
<attribute name="repeat">
<ref name="virOnOff"/>
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index e05ea9ba88..44d55ede5b 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -891,6 +891,17 @@ VIR_ENUM_IMPL(virDomainInputSourceGrab,
"all",
);
+VIR_ENUM_IMPL(virDomainInputSourceGrabToggle,
+ VIR_DOMAIN_INPUT_SOURCE_GRAB_TOGGLE_LAST,
+ "default",
+ "ctrl-ctrl",
+ "alt-alt",
+ "shift-shift",
+ "meta-meta",
+ "scrolllock",
+ "ctrl-scrolllock",
+);
+
VIR_ENUM_IMPL(virDomainGraphics,
VIR_DOMAIN_GRAPHICS_TYPE_LAST,
"sdl",
@@ -12011,6 +12022,11 @@ virDomainInputDefParseXML(virDomainXMLOption *xmlopt,
VIR_XML_PROP_NONZERO, &def->source.grab) < 0)
goto error;
+ if (virXMLPropEnum(source, "grabToggle",
+ virDomainInputSourceGrabToggleTypeFromString,
+ VIR_XML_PROP_NONZERO, &def->source.grabToggle) < 0)
+ goto error;
+
if (virXMLPropTristateSwitch(source, "repeat",
VIR_XML_PROP_NONE, &def->source.repeat) < 0)
goto error;
@@ -25998,6 +26014,7 @@ virDomainInputDefFormat(virBuffer *buf,
const char *type = virDomainInputTypeToString(def->type);
const char *bus = virDomainInputBusTypeToString(def->bus);
const char *grab = virDomainInputSourceGrabTypeToString(def->source.grab);
+ const char *grabToggle = virDomainInputSourceGrabToggleTypeToString(def->source.grabToggle);
const char *repeat = virTristateSwitchTypeToString(def->source.repeat);
g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf);
@@ -26049,6 +26066,8 @@ virDomainInputDefFormat(virBuffer *buf,
if (def->source.grab)
virBufferAsprintf(&sourceAttrBuf, " grab='%s'", grab);
+ if (def->source.grabToggle)
+ virBufferAsprintf(&sourceAttrBuf, " grabToggle='%s'", grabToggle);
if (def->source.repeat)
virBufferAsprintf(&sourceAttrBuf, " repeat='%s'", repeat);
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 5c22f252d0..ca21082624 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1420,6 +1420,18 @@ typedef enum {
VIR_DOMAIN_INPUT_SOURCE_GRAB_LAST
} virDomainInputSourceGrab;
+typedef enum {
+ VIR_DOMAIN_INPUT_SOURCE_GRAB_TOGGLE_DEFAULT,
+ VIR_DOMAIN_INPUT_SOURCE_GRAB_TOGGLE_CTRL_CTRL,
+ VIR_DOMAIN_INPUT_SOURCE_GRAB_TOGGLE_ALT_ALT,
+ VIR_DOMAIN_INPUT_SOURCE_GRAB_TOGGLE_SHIFT_SHIFT,
+ VIR_DOMAIN_INPUT_SOURCE_GRAB_TOGGLE_META_META,
+ VIR_DOMAIN_INPUT_SOURCE_GRAB_TOGGLE_SCROLLLOCK,
+ VIR_DOMAIN_INPUT_SOURCE_GRAB_TOGGLE_CTRL_SCROLLLOCK,
+
+ VIR_DOMAIN_INPUT_SOURCE_GRAB_TOGGLE_LAST
+} virDomainInputSourceGrabToggle;
+
struct _virDomainInputDef {
int type;
int bus;
@@ -1427,6 +1439,7 @@ struct _virDomainInputDef {
struct {
char *evdev;
virDomainInputSourceGrab grab;
+ virDomainInputSourceGrabToggle grabToggle;
virTristateSwitch repeat;
} source;
virDomainDeviceInfo info;
@@ -3871,6 +3884,7 @@ VIR_ENUM_DECL(virDomainInput);
VIR_ENUM_DECL(virDomainInputBus);
VIR_ENUM_DECL(virDomainInputModel);
VIR_ENUM_DECL(virDomainInputSourceGrab);
+VIR_ENUM_DECL(virDomainInputSourceGrabToggle);
VIR_ENUM_DECL(virDomainGraphics);
VIR_ENUM_DECL(virDomainGraphicsListen);
VIR_ENUM_DECL(virDomainGraphicsAuthConnected);
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 4bc2974e7f..6bbf551f48 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -476,6 +476,8 @@ virDomainInputBusTypeToString;
virDomainInputDefFind;
virDomainInputDefFree;
virDomainInputDefGetPath;
+virDomainInputSourceGrabToggleTypeFromString;
+virDomainInputSourceGrabToggleTypeToString;
virDomainInputSourceGrabTypeFromString;
virDomainInputSourceGrabTypeToString;
virDomainInputTypeToString;
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 3c3ecd63e3..156af4caee 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -3947,6 +3947,11 @@ qemuBuildObjectInputDevStr(virDomainInputDef *dev,
if (dev->source.grab == VIR_DOMAIN_INPUT_SOURCE_GRAB_ALL)
virJSONValueObjectAdd(props, "b:grab_all", true, NULL);
+ if (dev->source.grabToggle != VIR_DOMAIN_INPUT_SOURCE_GRAB_TOGGLE_DEFAULT)
+ virJSONValueObjectAdd(props, "s:grab-toggle",
+ virDomainInputSourceGrabToggleTypeToString(dev->source.grabToggle),
+ NULL);
+
if (qemuBuildObjectCommandlineFromJSON(&buf, props, qemuCaps) < 0)
return NULL;
diff --git a/tests/qemuxml2argvdata/input-linux.x86_64-latest.args b/tests/qemuxml2argvdata/input-linux.x86_64-latest.args
index 688cf02873..3c7e65a7f0 100644
--- a/tests/qemuxml2argvdata/input-linux.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/input-linux.x86_64-latest.args
@@ -27,7 +27,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-no-acpi \
-boot strict=on \
-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
--object '{"qom-type":"input-linux","id":"input0","evdev":"/dev/input/event1234","repeat":true,"grab_all":true}' \
+-object '{"qom-type":"input-linux","id":"input0","evdev":"/dev/input/event1234","repeat":true,"grab_all":true,"grab-toggle":"alt-alt"}' \
-audiodev id=audio1,driver=none \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
diff --git a/tests/qemuxml2argvdata/input-linux.xml b/tests/qemuxml2argvdata/input-linux.xml
index c0702676c1..389ba789a6 100644
--- a/tests/qemuxml2argvdata/input-linux.xml
+++ b/tests/qemuxml2argvdata/input-linux.xml
@@ -22,7 +22,7 @@
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
</controller>
<input type='evdev'>
- <source dev='/dev/input/event1234' grab='all' repeat='on'/>
+ <source dev='/dev/input/event1234' grab='all' grabToggle='alt-alt' repeat='on'/>
</input>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
--
2.32.0
3 years, 4 months
[PATCH 0/7] Various fixes
by Peter Krempa
Fixes for stuff I've noticed when reviewing Tim's hash table cleanups.
This obviously applies on top of his series.
Peter Krempa (7):
virHashNew: Ensure return value is used
hypervCreateEmbeddedParam: Don't count elements needlessly
qemuBlockNodeNameGetBackingChain: Shuffle around variable
initialization
virDomainDefValidateAliases: Refactor to avoid cleanup section
virNetworkObjNew: Remove impossible error handling
qemu: domain: Move qemuDomainObjPrivateAlloc after
qemuDomainObjPrivateFree
qemuDomainObjPrivateAlloc: Fix unlikely memory leak
src/conf/domain_validate.c | 15 ++++------
src/conf/virnetworkobj.c | 13 +++------
src/hyperv/hyperv_wmi.c | 5 ----
src/qemu/qemu_block.c | 8 ++----
src/qemu/qemu_domain.c | 57 ++++++++++++++++++--------------------
src/util/virhash.h | 2 +-
6 files changed, 39 insertions(+), 61 deletions(-)
--
2.31.1
3 years, 4 months