Bug 1738626

Summary: Disable memfd in QEMU
Product: Red Hat Enterprise Linux Advanced Virtualization Reporter: Ademar Reis <areis>
Component: qemu-kvmAssignee: Marc-Andre Lureau <marcandre.lureau>
qemu-kvm sub component: General QA Contact: Yumei Huang <yuhuang>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: unspecified CC: chayang, ddepaula, dgilbert, dyuan, jinqi, jinzhao, juzhang, marcandre.lureau, mdeng, virt-maint, yuhuang
Version: 8.0   
Target Milestone: rc   
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: qemu-kvm-4.1.0-4.module+el8.1.0+4020+16089f93 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1740797 1813852 (view as bug list) Environment:
Last Closed: 2019-11-06 07:18:12 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1740797, 1813852    

Description Ademar Reis 2019-08-07 15:56:23 UTC
memfd is not needed by layered products right now, but it's currently enabled in our package. Let's disable it in QEMU so it doesn't get exposed unecessarily and untested.

This commit from libvirt gives us a good summary of what the feature is:
(but this BZ is about disabling it in QEMU, which is enough)

commit 24b74d187cab48a9dc9f409ea78900154c709579
Author: Marc-André Lureau <marcandre.lureau>
Date:   Thu Nov 15 15:55:53 2018 +0400

    qemu: add memfd source type
    
    Add a new memoryBacking source type "memfd", supported by QEMU (when
    the capability is available).
    
    A memfd is a specialized anonymous memory kind. As such, an anonymous
    source type could be automatically using a memfd. However, there are
    some complications when migrating from different memory backends in
    qemu (mainly due to the internal object naming at this point, but
    there could be more). For now, it is simpler and safer to simply
    introduce a new source type "memfd". Eventually, the "anonymous" type
    could learn to use memfd transparently in a separate change.
    
    The main benefits are that it doesn't need to create filesystem files,
    and it also enforces sealing, providing a bit more safety.

Comment 1 Danilo de Paula 2019-08-13 14:06:09 UTC
QA_ACK, please?

Comment 4 Yumei Huang 2019-08-20 05:20:19 UTC
Verify:
qemu-kvm-4.1.0-4.module+el8.1.0+4020+16089f93
kernel-4.18.0-131.el8.x86_64

Object memory-backend-memfd is not supported now.

# /usr/libexec/qemu-kvm -object memory-backend-memfd,id=mem0
qemu-kvm: -object memory-backend-memfd,id=mem0: invalid object type: memory-backend-memfd

Comment 6 errata-xmlrpc 2019-11-06 07:18:12 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:3723

Comment 7 Dr. David Alan Gilbert 2020-02-06 10:59:57 UTC
This is a bit unfortunate;  it's a lot easier to work with memfd when you're doing vhost-user and just want to specify share=on