libvirt/src/qemu
Michal Privoznik 46b03819ae qemu_namespace: Fix a corner case in qemuDomainGetPreservedMounts()
When setting up namespace for QEMU we look at mount points under
/dev (like /dev/pts, /dev/mqueue/, etc.) because we want to
preserve those (which is done by moving them to a temp location,
unshare(), and then moving them back). We have a convenience
helper - qemuDomainGetPreservedMounts() - that processes the
mount table and (optionally) moves the other filesystems too.
This helper is also used when attempting to create a path in NS,
because the path, while starting with "/dev/" prefix, may
actually lead to one of those filesystems that we preserved.

And here comes the corner case: while we require the parent mount
table to be in shared mode (equivalent of `mount --make-rshared /'),
these mount events propagate iff the target path exist inside the
slave mount table (= QEMU's private namespace). And since we
create only a subset of /dev nodes, well, that assumption is not
always the case.

For instance, assume that a domain is already running, no
hugepages were configured for it nor any hugetlbfs is mounted.
Now, when a hugetlbfs is mounted into '/dev/hugepages', this is
propagated into the QEMU's namespace, but since the target dir
does not exist in the private /dev, the FS is not mounted in the
namespace.

Fortunately, this difference between namespaces is visible when
comparing /proc/mounts and /proc/$PID/mounts (where PID is the
QEMU's PID). Therefore, if possible we should look at the latter.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2022-09-23 16:32:51 +02:00
..
libvirt_qemu_probes.d
libvirtd_qemu.aug
meson.build qemu: Use real defaults for user and group in qemu.conf 2022-04-01 15:32:48 +02:00
postcopy-migration.sysctl qemu: Ignore missing vm.unprivileged_userfaultfd sysctl 2022-02-09 13:03:33 +01:00
qemu_agent.c virjson: Change virJSONValueObjectHasKey() signature 2022-08-01 10:24:34 +02:00
qemu_agent.h util: refactor virDomainDeviceCCWAddress into virccw.h 2022-05-23 16:31:40 +02:00
qemu_alias.c qemu: alias: Remove check for QEMU_CAPS_BLOCKDEV 2022-08-11 15:14:18 +02:00
qemu_alias.h qemu: alias: Remove check for QEMU_CAPS_BLOCKDEV 2022-08-11 15:14:18 +02:00
qemu_backup.c qemu & conf: move BeginAsyncJob & EndAsyncJob into src/conf 2022-09-07 12:15:06 +02:00
qemu_backup.h qemu: remove unused driver and all its propagations 2022-08-10 16:50:07 +02:00
qemu_block.c qemu: block: Remove support for legacy disk hotplug/unplug 2022-08-11 15:23:08 +02:00
qemu_block.h qemu: block: Remove support for legacy disk hotplug/unplug 2022-08-11 15:23:08 +02:00
qemu_blockjob.c qemu: Remove 'driveAlias' argument of qemuBlockStorageSourceDetachPrepare 2022-08-11 15:22:56 +02:00
qemu_blockjob.h qemu: remove unused driver and all its propagations 2022-08-10 16:50:07 +02:00
qemu_capabilities.c qemu: capabilities: Retire QEMU_CAPS_NBD_SERVER 2022-09-09 16:10:47 +02:00
qemu_capabilities.h qemu: capabilities: Retire QEMU_CAPS_NBD_SERVER 2022-09-09 16:10:47 +02:00
qemu_capspriv.h lib: Use G_NO_INLINE instead of G_GNUC_NO_INLINE 2022-07-18 17:23:15 +02:00
qemu_cgroup.c qemu_cgroup: Don't ignore ENOENT in qemuCgroupAllowDevicesPaths() 2022-08-01 10:36:42 +02:00
qemu_cgroup.h qemu: Remove unused includes 2022-06-16 06:43:57 +02:00
qemu_checkpoint.c qemu: use virDomainObjEndJob() 2022-09-07 12:14:07 +02:00
qemu_checkpoint.h qemu: Remove unused includes 2022-06-16 06:43:57 +02:00
qemu_command.c qemu: assume QEMU_CAPS_NEC_USB_XHCI_PORTS 2022-09-07 12:05:40 +02:00
qemu_command.h qemu: command: Remove unused qemuGetDriveSourceString 2022-08-11 15:23:57 +02:00
qemu_conf.c virdomainjob: make drivers use job object in the domain object 2022-09-07 12:13:13 +02:00
qemu_conf.h qemu: Remove unused includes 2022-06-16 06:43:57 +02:00
qemu_dbus.c qemu: Remove unused includes 2022-06-16 06:43:57 +02:00
qemu_dbus.h
qemu_domain_address.c qemu: Remove extra logic around QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY 2022-09-01 13:11:10 +02:00
qemu_domain_address.h qemu: Remove unused includes 2022-06-16 06:43:57 +02:00
qemu_domain.c qemu_domain: Ignore all but SCSI hostdevs in qemuDomainDeviceHostdevDefPostParseRestoreBackendAlias() 2022-09-23 15:28:34 +02:00
qemu_domain.h virdomainjob: make drivers use job object in the domain object 2022-09-07 12:13:13 +02:00
qemu_domainjob.c qemu & conf: move BeginNestedJob & BeginJobNowait into src/conf 2022-09-07 12:15:28 +02:00
qemu_domainjob.h qemu & conf: move BeginNestedJob & BeginJobNowait into src/conf 2022-09-07 12:15:28 +02:00
qemu_driver.c virStateInitialize: Propagate whether running in monolithic daemon mode to stateful driver init 2022-09-13 10:50:02 +02:00
qemu_driver.h
qemu_extdevice.c qemu: Remove unused includes 2022-06-16 06:43:57 +02:00
qemu_extdevice.h qemu: Revert "qemuExtDevicesStart: pass logManager" 2021-10-12 14:12:11 +02:00
qemu_fd.c qemu: fd: Fix monitor usage of qemuFDPassDirectGetPath 2022-06-06 09:42:58 +02:00
qemu_fd.h qemuFDPassTransferCommand: Remove return value 2022-05-17 19:31:08 +02:00
qemu_firmware.c qemu: support use of stateless EFI firmware 2022-07-26 15:41:44 +01:00
qemu_firmware.h
qemu_hostdev.c qemu: Remove unused includes 2022-06-16 06:43:57 +02:00
qemu_hostdev.h qemu: Remove unused includes 2022-06-16 06:43:57 +02:00
qemu_hotplug.c Rename iterface type='dummy' to type='null' 2022-08-25 13:27:04 +02:00
qemu_hotplug.h qemu: remove unused driver and all its propagations 2022-08-10 16:50:07 +02:00
qemu_interface.c Rename iterface type='dummy' to type='null' 2022-08-25 13:27:04 +02:00
qemu_interface.h lib: Use G_NO_INLINE instead of G_GNUC_NO_INLINE 2022-07-18 17:23:15 +02:00
qemu_interop_config.c qemu: Remove unused includes 2022-06-16 06:43:57 +02:00
qemu_interop_config.h
qemu_migration_cookie.c virdomainjob: make drivers use job object in the domain object 2022-09-07 12:13:13 +02:00
qemu_migration_cookie.h virdomainjob: make drivers use job object in the domain object 2022-09-07 12:13:13 +02:00
qemu_migration_params.c virdomainjob: make drivers use job object in the domain object 2022-09-07 12:13:13 +02:00
qemu_migration_params.h qemu: remove unused driver and all its propagations 2022-08-10 16:50:07 +02:00
qemu_migration_paramspriv.h qemu_migration: Apply max-postcopy-bandwidth on post-copy resume 2022-07-01 11:28:34 +02:00
qemu_migration.c qemu: migration: Remove QEMU_MONITOR_MIGRATE_BACKGROUND 2022-09-09 16:10:47 +02:00
qemu_migration.h qemu: Make qemuMigrationSrcCancel optionally synchronous 2022-09-06 18:28:10 +02:00
qemu_monitor_json.c qemu: migration: Remove QEMU_MONITOR_MIGRATE_BACKGROUND 2022-09-09 16:10:47 +02:00
qemu_monitor_json.h qemu_monitor: add qemuMonitorQueryStats 2022-08-18 15:09:49 +02:00
qemu_monitor_priv.h lib: Use G_NO_INLINE instead of G_GNUC_NO_INLINE 2022-07-18 17:23:15 +02:00
qemu_monitor_text.c qemu: monitor: Remove unused qemuMonitorAddDrive/qemuMonitorDriveDel 2022-08-11 15:23:21 +02:00
qemu_monitor_text.h qemu: monitor: Remove unused qemuMonitorAddDrive/qemuMonitorDriveDel 2022-08-11 15:23:21 +02:00
qemu_monitor.c qemu_monitor: add qemuMonitorQueryStats 2022-08-18 15:09:49 +02:00
qemu_monitor.h qemu: monitor: Renumber QEMU_MONITOR_MIGRATE_RESUME 2022-09-09 16:10:47 +02:00
qemu_namespace.c qemu_namespace: Fix a corner case in qemuDomainGetPreservedMounts() 2022-09-23 16:32:51 +02:00
qemu_namespace.h qemu: Remove unused includes 2022-06-16 06:43:57 +02:00
qemu_process.c qemu_process: Don't require a hugetlbfs mount for memfd 2022-09-12 12:04:55 +02:00
qemu_process.h qemu: remove unused driver and all its propagations 2022-08-10 16:50:07 +02:00
qemu_processpriv.h qemu: Do not pass unused opaque pointer to monitor callbacks 2022-05-24 16:26:04 +02:00
qemu_qapi.c qemu: Remove unused includes 2022-06-16 06:43:57 +02:00
qemu_qapi.h
qemu_saveimage.c qemu: Remove unused includes 2022-06-16 06:43:57 +02:00
qemu_saveimage.h qemu: Remove unused includes 2022-06-16 06:43:57 +02:00
qemu_security.c qemu_security: Drop qemuSecurityStartVhostUserGPU() 2022-05-09 16:17:00 +02:00
qemu_security.h qemu: Remove unused includes 2022-06-16 06:43:57 +02:00
qemu_shim.c qemu: Remove unused includes 2022-06-16 06:43:57 +02:00
qemu_slirp.c lib: Don't check for retval for virCommandNew*() 2022-08-23 16:14:05 +02:00
qemu_slirp.h qemu: slirp: Remove unused 'qemuSlirpGetFD' 2022-05-16 09:15:46 +02:00
qemu_snapshot.c qemu & conf: move BeginAsyncJob & EndAsyncJob into src/conf 2022-09-07 12:15:06 +02:00
qemu_snapshot.h qemu: Remove unused includes 2022-06-16 06:43:57 +02:00
qemu_tpm.c qemu: Do not keep swtpm pidfile around after stopping 2022-08-24 23:31:12 +02:00
qemu_tpm.h qemu_tpm: Make APIs work over a single virDomainTPMDef 2022-05-24 16:15:29 +02:00
qemu_validate.c qemu: remove qemuValidateDomainVirtioOptions 2022-09-07 12:05:40 +02:00
qemu_validate.h qemu: Remove unused includes 2022-06-16 06:43:57 +02:00
qemu_vhost_user_gpu.c lib: Don't check for retval for virCommandNew*() 2022-08-23 16:14:05 +02:00
qemu_vhost_user_gpu.h qemu: Remove unused includes 2022-06-16 06:43:57 +02:00
qemu_vhost_user.c qemu: Remove unused includes 2022-06-16 06:43:57 +02:00
qemu_vhost_user.h qemu: Remove unused includes 2022-06-16 06:43:57 +02:00
qemu_virtiofs.c lib: Don't check for retval for virCommandNew*() 2022-08-23 16:14:05 +02:00
qemu_virtiofs.h qemu: virtiofs: open a separate connection to virtlogd 2021-10-12 14:12:11 +02:00
qemu.conf.in qemu: Use real defaults for user and group in qemu.conf 2022-04-01 15:32:48 +02:00
test_libvirtd_qemu.aug.in qemu: Use real defaults for user and group in qemu.conf 2022-04-01 15:32:48 +02:00
virtqemud.init.in
virtqemud.service.in systemd: Use correct man page name in modular daemon service files 2022-02-01 13:20:11 +01:00