Skip to content
Snippets Groups Projects
  1. Jul 06, 2021
  2. Jul 05, 2021
    • Thomas Huth's avatar
      qemu-options: Improve the documentation of the -display options · 95f439bd
      Thomas Huth authored
      
      The sdl and gtk display options support more parameters than currently
      documented. Also the "vnc" option got lost during a recent commit,
      add it again.
      
      Fixes: ddc71758 ("Add display suboptions to man pages")
      Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
      Message-Id: <20210630163231.467987-5-thuth@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      95f439bd
    • Thomas Huth's avatar
      ui: Mark the '-no-quit' option as deprecated · b6ddc6a2
      Thomas Huth authored
      
      It's just a wrapper around the -display ...,window-close=off parameter,
      and the name "no-quit" is rather confusing compared to "window-close"
      (since there are still other means to quit the emulator), so we should
      rather tell our users to use the "window-close" parameter instead.
      
      While we're at it, update the documentation to state that
      "-no-quit" is available for GTK, too, not only for SDL.
      
      Reviewed-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
      Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
      Message-Id: <20210630163231.467987-4-thuth@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      b6ddc6a2
    • Thomas Huth's avatar
      ui: Fix the "-display sdl,window_close=..." parameter · bb20b86d
      Thomas Huth authored
      
      According to the QAPI schema, there is a "-" and not a "_" between
      "window" and "close", and we're also talking about "window-close"
      in the long parameter description in qemu-options.hx, so we should
      make sure that we rather use the variant with the "-" by default
      instead of only allowing the one with the "_" here. The old way
      still stays enabled for compatibility, but we deprecate it, so that
      we can switch to a QAPIfied parameter one day more easily.
      
      Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
      Message-Id: <20210630163231.467987-3-thuth@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      bb20b86d
    • Thomas Huth's avatar
      softmmu/vl: Remove obsolete comment about the "frame" parameter · f6b560bb
      Thomas Huth authored
      
      The frame parameter has been removed along with the support for
      SDL 1.2.
      
      Fixes: 09bd7ba9 ("Remove deprecated -no-frame option")
      Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
      Message-Id: <20210630163231.467987-2-thuth@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      f6b560bb
    • Thomas Huth's avatar
      Makefile: Remove /usr/bin/env wrapper from the SHELL variable · bc054393
      Thomas Huth authored
      
      The wrapper should not be needed here (it's not the shebang line of
      a shell script), and it is causing trouble on Haiku where "env"
      resides in a different directory.
      
      Reported-by: default avatarRichard Zak <richard.j.zak@gmail.com>
      Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
      Reviewed-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Message-Id: <20210705082542.936856-1-thuth@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      bc054393
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/dgilbert-gitlab/tags/pull-migration-20210705a' into staging · 715167a3
      Peter Maydell authored
      
      Migration and virtiofs pull 2021-07-01 v2
      
      Dropped Peter Xu's migration-test fix to reenable
      most of the migration tests when uffd isn't available;
      we're seeing at least one seg in github CI (on qemu-system-i386)
      and Peter Maydell is reporting a hang on Openbsd.
      
      Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      
      # gpg: Signature made Mon 05 Jul 2021 11:01:35 BST
      # gpg:                using RSA key 45F5C71B4A0CB7FB977A9FA90516331EBC5BFDE7
      # gpg: Good signature from "Dr. David Alan Gilbert (RH2) <dgilbert@redhat.com>" [full]
      # Primary key fingerprint: 45F5 C71B 4A0C B7FB 977A  9FA9 0516 331E BC5B FDE7
      
      * remotes/dgilbert-gitlab/tags/pull-migration-20210705a:
        migration/rdma: Use error_report to suppress errno message
        tests/migration: fix "downtime_limit" type when "migrate-set-parameters"
        tests/migration: parse the thread-id key of CpuInfoFast
        virtiofsd: Add an option to enable/disable posix acls
        virtiofsd: Switch creds, drop FSETID for system.posix_acl_access xattr
        virtiofsd: Add capability to change/restore umask
        virtiofsd: Add umask to seccom allow list
        virtiofsd: Add support for extended setxattr
        virtiofsd: Fix xattr operations overwriting errno
        virtiofsd: Fix fuse setxattr() API change issue
        virtiofsd: Don't allow file creation with FUSE_OPEN
        docs: describe the security considerations with virtiofsd xattr mapping
        virtiofsd: use GDateTime for formatting timestamp for debug messages
        migration: failover: continue to wait card unplug on error
        migration: move wait-unplug loop to its own function
        migration: Allow reset of postcopy_recover_triggered when failed
        migration: Move yank outside qemu_start_incoming_migration()
        migration: fix the memory overwriting risk in add_to_iovec
        tests: migration-test: Add dirty ring test
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      715167a3
    • Li Zhijian's avatar
      migration/rdma: Use error_report to suppress errno message · e5f60791
      Li Zhijian authored
      
      Since the prior calls are successful, in this case a errno doesn't
      indicate a real error which would just make us confused.
      
      before:
      (qemu) migrate -d rdma:192.168.22.23:8888
      source_resolve_host RDMA Device opened: kernel name rxe_eth0 uverbs device name uverbs2, infiniband_verbs class device path /sys/class/infiniband_verbs/uverbs2, infiniband class device path /sys/class/infiniband/rxe_eth0, transport: (2) Ethernet
      rdma_get_cm_event != EVENT_ESTABLISHED after rdma_connect: No space left on device
      
      Signed-off-by: default avatarLi Zhijian <lizhijian@cn.fujitsu.com>
      Message-Id: <20210628071959.23455-1-lizhijian@cn.fujitsu.com>
      Reviewed-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      e5f60791
    • Hyman Huang's avatar
      tests/migration: fix "downtime_limit" type when "migrate-set-parameters" · fa264f42
      Hyman Huang authored
      
      migrate-set-parameters parse "downtime_limit" as integer type when
      execute "migrate-set-parameters" before migration, and, the unit
      dowtime_limit is milliseconds, fix this two so that test can go
      smoothly.
      
      Signed-off-by: default avatarHyman Huang(黄勇) <huangy81@chinatelecom.cn>
      Message-Id: <31d82df24cc0c468dbe4d2d86730158ebf248071.1622729934.git.huangy81@chinatelecom.cn>
      Reviewed-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
      Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      fa264f42
    • Hyman Huang's avatar
      tests/migration: parse the thread-id key of CpuInfoFast · c99fb3a5
      Hyman Huang authored
      
      thread_id in CpuInfoFast is deprecated, parse thread-id instead
      after execute qmp query-cpus-fast. fix this so that test can
      go smoothly.
      
      Signed-off-by: default avatarHyman Huang(黄勇) <huangy81@chinatelecom.cn>
      Message-Id: <584578c0a0dd781cee45f72ddf517f6e6a41c504.1622729934.git.huangy81@chinatelecom.cn>
      Reviewed-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
      Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      c99fb3a5
    • Vivek Goyal's avatar
      virtiofsd: Add an option to enable/disable posix acls · 65a820d2
      Vivek Goyal authored
      
      fuse has an option FUSE_POSIX_ACL which needs to be opted in by fuse
      server to enable posix acls. As of now we are not opting in for this,
      so posix acls are disabled on virtiofs by default.
      
      Add virtiofsd option "-o posix_acl/no_posix_acl" to let users enable/disable
      posix acl support. By default it is disabled as of now due to performance
      concerns with cache=none.
      
      Currently even if file server has not opted in for FUSE_POSIX_ACL, user can
      still query acl and set acl, and system.posix_acl_access and
      system.posix_acl_default xattrs show up listxattr response.
      
      Miklos said this is confusing. So he said lets block and filter
      system.posix_acl_access and system.posix_acl_default xattrs in
      getxattr/setxattr/listxattr if user has explicitly disabled
      posix acls using -o no_posix_acl.
      
      As of now continuing to keeping the existing behavior if user did not
      specify any option to disable acl support due to concerns about backward
      compatibility.
      
      Signed-off-by: default avatarVivek Goyal <vgoyal@redhat.com>
      Message-Id: <20210622150852.1507204-8-vgoyal@redhat.com>
      Reviewed-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      65a820d2
    • Vivek Goyal's avatar
      virtiofsd: Switch creds, drop FSETID for system.posix_acl_access xattr · f1aa1774
      Vivek Goyal authored
      
      When posix access acls are set on a file, it can lead to adjusting file
      permissions (mode) as well. If caller does not have CAP_FSETID and it
      also does not have membership of owner group, this will lead to clearing
      SGID bit in mode.
      
      Current fuse code is written in such a way that it expects file server
      to take care of chaning file mode (permission), if there is a need.
      Right now, host kernel does not clear SGID bit because virtiofsd is
      running as root and has CAP_FSETID. For host kernel to clear SGID,
      virtiofsd need to switch to gid of caller in guest and also drop
      CAP_FSETID (if caller did not have it to begin with).
      
      If SGID needs to be cleared, client will set the flag
      FUSE_SETXATTR_ACL_KILL_SGID in setxattr request. In that case server
      should kill sgid.
      
      Currently just switch to uid/gid of the caller and drop CAP_FSETID
      and that should do it.
      
      This should fix the xfstest generic/375 test case.
      
      We don't have to switch uid for this to work. That could be one optimization
      that pass a parameter to lo_change_cred() to only switch gid and not uid.
      
      Also this will not work whenever (if ever) we support idmapped mounts. In
      that case it is possible that uid/gid in request are 0/0 but still we
      need to clear SGID. So we will have to pick a non-root sgid and switch
      to that instead. That's an TODO item for future when idmapped mount
      support is introduced.
      
      This patch only adds the capability to switch creds and drop FSETID
      when acl xattr is set. This does not take affect yet. It can take
      affect when next patch adds the capability to enable posix_acl.
      
      Reported-by: default avatarLuis Henriques <lhenriques@suse.de>
      Signed-off-by: default avatarVivek Goyal <vgoyal@redhat.com>
      Message-Id: <20210622150852.1507204-7-vgoyal@redhat.com>
      Reviewed-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      f1aa1774
    • Vivek Goyal's avatar
      virtiofsd: Add capability to change/restore umask · 227e5d7f
      Vivek Goyal authored
      
      When parent directory has default acl and a file is created in that
      directory, then umask is ignored and final file permissions are
      determined using default acl instead. (man 2 umask).
      
      Currently, fuse applies the umask and sends modified mode in create
      request accordingly. fuse server can set FUSE_DONT_MASK and tell
      fuse client to not apply umask and fuse server will take care of
      it as needed.
      
      With posix acls enabled, requirement will be that we want umask
      to determine final file mode if parent directory does not have
      default acl.
      
      So if posix acls are enabled, opt in for FUSE_DONT_MASK. virtiofsd
      will set umask of the thread doing file creation. And host kernel
      should use that umask if parent directory does not have default
      acls, otherwise umask does not take affect.
      
      Miklos mentioned that we already call unshare(CLONE_FS) for
      every thread. That means umask has now become property of per
      thread and it should be ok to manipulate it in file creation path.
      
      This patch only adds capability to change umask and restore it. It
      does not enable it yet. Next few patches will add capability to enable it
      based on if user enabled posix_acl or not.
      
      This should fix fstest generic/099.
      
      Reported-by: default avatarLuis Henriques <lhenriques@suse.de>
      Signed-off-by: default avatarVivek Goyal <vgoyal@redhat.com>
      Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Message-Id: <20210622150852.1507204-6-vgoyal@redhat.com>
      Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      227e5d7f
    • Vivek Goyal's avatar
      virtiofsd: Add umask to seccom allow list · 6d0028b9
      Vivek Goyal authored
      
      Patches in this series  are going to make use of "umask" syscall.
      So allow it.
      
      Signed-off-by: default avatarVivek Goyal <vgoyal@redhat.com>
      Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Message-Id: <20210622150852.1507204-5-vgoyal@redhat.com>
      Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      6d0028b9
    • Vivek Goyal's avatar
      virtiofsd: Add support for extended setxattr · c46ef954
      Vivek Goyal authored
      
      Add the bits to enable support for setxattr_ext if fuse offers it. Do not
      enable it by default yet. Let passthrough_ll opt-in. Enabling it by deafult
      kind of automatically means that you are taking responsibility of clearing
      SGID if ACL is set.
      
      Signed-off-by: default avatarVivek Goyal <vgoyal@redhat.com>
      Message-Id: <20210622150852.1507204-4-vgoyal@redhat.com>
      Reviewed-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
        Fixed up double def in fuse_common.h
      c46ef954
    • Vivek Goyal's avatar
      virtiofsd: Fix xattr operations overwriting errno · 5290fb62
      Vivek Goyal authored
      
      getxattr/setxattr/removexattr/listxattr operations handle regualar
      and non-regular files differently. For the case of non-regular files
      we do fchdir(/proc/self/fd) and the xattr operation and then revert
      back to original working directory. After this we are saving errno
      and that's buggy because fchdir() will overwrite the errno.
      
      FCHDIR_NOFAIL(lo->proc_self_fd);
      ret = getxattr(procname, name, value, size);
      FCHDIR_NOFAIL(lo->root.fd);
      
      if (ret == -1)
          saverr = errno
      
      In above example, if getxattr() failed, we will still return 0 to caller
      as errno must have been written by FCHDIR_NOFAIL(lo->root.fd) call.
      Fix all such instances and capture "errno" early and save in "saverr"
      variable.
      
      Signed-off-by: default avatarVivek Goyal <vgoyal@redhat.com>
      Message-Id: <20210622150852.1507204-3-vgoyal@redhat.com>
      Reviewed-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Reviewed-by: default avatarGreg Kurz <groug@kaod.org>
      Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      5290fb62
Loading