Skip to content
Snippets Groups Projects
  1. Sep 10, 2021
  2. Sep 07, 2021
  3. Sep 06, 2021
    • Michael Tokarev's avatar
      qemu-sockets: fix unix socket path copy (again) · 118d527f
      Michael Tokarev authored
      Commit 4cfd970e added an
      assert which ensures the path within an address of a unix
      socket returned from the kernel is at least one byte and
      does not exceed sun_path buffer. Both of this constraints
      are wrong:
      
      A unix socket can be unnamed, in this case the path is
      completely empty (not even \0)
      
      And some implementations (notable linux) can add extra
      trailing byte (\0) _after_ the sun_path buffer if we
      passed buffer larger than it (and we do).
      
      So remove the assertion (since it causes real-life breakage)
      but at the same time fix the usage of sun_path. Namely,
      we should not access sun_path[0] if kernel did not return
      it at all (this is the case for unnamed sockets),
      and use the returned salen when copyig actual path as an
      upper constraint for the amount of bytes to copy - this
      will ensure we wont exceed the information provided by
      the kernel, regardless whenever there is a trailing \0
      or not. This also helps with unnamed sockets.
      
      Note the case of abstract socket, the sun_path is actually
      a blob and can contain \0 characters, - it should not be
      passed to g_strndup and the like, it should be accessed by
      memcpy-like functions.
      
      Fixes: 4cfd970e
      Fixes: http://bugs.debian.org/993145
      
      
      Signed-off-by: default avatarMichael Tokarev <mjt@tls.msk.ru>
      Reviewed-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
      Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      CC: qemu-stable@nongnu.org
      118d527f
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/thuth-gitlab/tags/pull-request-2021-09-06' into staging · 935efca6
      Peter Maydell authored
      
      * Add definitions of terms for CI/testing
      * Fix g_setenv problem discovered by Coverity
      * Gitlab CI improvements
      * Build system improvements (configure script + meson.build)
      * Removal of the show-fixed-bugs.sh script
      * Clean up of the sdl and curses options
      
      # gpg: Signature made Mon 06 Sep 2021 10:51:49 BST
      # gpg:                using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5
      # gpg:                issuer "thuth@redhat.com"
      # gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full]
      # gpg:                 aka "Thomas Huth <thuth@redhat.com>" [full]
      # gpg:                 aka "Thomas Huth <huth@tuxfamily.org>" [full]
      # gpg:                 aka "Thomas Huth <th.huth@posteo.de>" [unknown]
      # Primary key fingerprint: 27B8 8847 EEE0 2501 18F3  EAB9 2ED9 D774 FE70 2DB5
      
      * remotes/thuth-gitlab/tags/pull-request-2021-09-06:
        softmmu/vl: Deprecate the -sdl and -curses option
        softmmu/vl: Deprecate the old grab options
        softmmu/vl: Add a "grab-mod" parameter to the -display sdl option
        scripts: Remove the "show-fixed-bugs.sh" file
        configure / meson: Move the GBM handling to meson.build
        meson.build: Don't use internal libfdt if the user requested the system libfdt
        meson.build: Fix the check for a usable libfdt
        gitlab-ci: Don't try to use the system libfdt in the debian job
        libqtest: check for g_setenv() failure
        docs: add definitions of terms for CI/testing
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      935efca6
    • Thomas Huth's avatar
      softmmu/vl: Deprecate the -sdl and -curses option · 6695e4c0
      Thomas Huth authored
      
      It's not that much complicated to type "-display sdl" or "-display curses",
      so we should not clutter our main option name space with such simple
      wrapper options and rather present the users with a concise interface
      instead. Thus let's deprecate the "-sdl" and "-curses" wrapper options now.
      
      Message-Id: <20210825092023.81396-4-thuth@redhat.com>
      Reviewed-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      Acked-by: default avatarPeter Krempa <pkrempa@redhat.com>
      Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
      6695e4c0
    • Thomas Huth's avatar
      softmmu/vl: Deprecate the old grab options · d46156fd
      Thomas Huth authored
      
      The alt_grab and ctrl_grab parameter of the -display sdl option prevent
      the QAPIfication of the "sdl" part of the -display option, so we should
      eventually remove them. And since this feature is also rather niche anyway,
      we should not clutter the top-level option list with these, so let's
      also deprecate the "-alt-grab" and the "-ctrl-grab" options while we're
      at it.
      
      Once the deprecation period of "alt_grab" and "ctrl_grab" is over, we
      then can finally switch the -display sdl option to use QAPI internally,
      too.
      
      Message-Id: <20210825092023.81396-3-thuth@redhat.com>
      Reviewed-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      Acked-by: default avatarPeter Krempa <pkrempa@redhat.com>
      Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
      d46156fd
    • Thomas Huth's avatar
      softmmu/vl: Add a "grab-mod" parameter to the -display sdl option · 8e8e844b
      Thomas Huth authored
      
      The -display sdl option is not using QAPI internally yet, and uses hand-
      crafted parsing instead (see parse_display() in vl.c), which is quite
      ugly, since most of the other code is using the QAPIfied DisplayOption
      already. Unfortunately, the "alt_grab" and "ctrl_grab" use underscores in
      their names which has recently been forbidden in new QAPI code, so
      a straight conversion is not possible. While we could add some exceptions
      to the QAPI schema parser for this, the way these parameters have been
      designed was maybe a bad idea anyway: First, it's not possible to enable
      both parameters at the same time, thus instead of two boolean parameters
      it would be better to have only one multi-choice parameter instead.
      Second, the naming is also somewhat unfortunate since the "alt_grab"
      parameter is not about the ALT key, but rather about the left SHIFT key
      that has to be used additionally when the parameter is enabled.
      
      So instead of trying to QAPIfy "alt_grab" and "ctrl_grab", let's rather
      introduce an alternative to these parameters instead, a new parameter
      called "grab-mod" which can either be set to "lshift-lctrl-lalt" or to
      "rctrl". In case we ever want to support additional modes later, we can
      then also simply extend the list of supported strings here.
      
      Message-Id: <20210825092023.81396-2-thuth@redhat.com>
      Reviewed-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
      8e8e844b
    • Thomas Huth's avatar
      scripts: Remove the "show-fixed-bugs.sh" file · bf6a6185
      Thomas Huth authored
      
      Since we are not using Launchpad anymore, there is no more need for
      this script.
      
      Message-Id: <20210825142143.142037-1-thuth@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Reviewed-by: default avatarLaurent Vivier <laurent@vivier.eu>
      Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
      bf6a6185
    • Thomas Huth's avatar
      configure / meson: Move the GBM handling to meson.build · 8bc5184d
      Thomas Huth authored
      
      The GBM library detection does not need to be in the configure script,
      since it does not have any user-facing options (there are no
      --enable-gbm or --disable-gbm switches). Let's move it to meson.build
      instead, so we don't have to clutter config-host.mak with the related
      switches.
      
      Additionally, only check for GBM if it is really required, i.e. if we
      either compile with OpenGL or with virglrenderer support.
      
      Message-Id: <20210714085045.797168-1-thuth@redhat.com>
      Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
      8bc5184d
    • Thomas Huth's avatar
      meson.build: Don't use internal libfdt if the user requested the system libfdt · 6c22853c
      Thomas Huth authored
      
      If the users ran configure with --enable-libfdt=system, they likely did
      that on purpose. We should not silently fall back to the internal libfdt
      if the system libfdt is not usable, but report the problem with a proper
      message instead.
      
      Message-Id: <20210827120901.150276-3-thuth@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
      6c22853c
    • Thomas Huth's avatar
      meson.build: Fix the check for a usable libfdt · 87daf898
      Thomas Huth authored
      The check for libfdt currently has a flaw: If there is a system libfdt, the
      meson.build code initialized the fdt variable with fdt = cc.find_library(...).
      However, if this libfdt is too old and there is no internal dtc module
      available, it continues with "fdt" pointing to the old and unusable version.
      The check later in the file that tries to detect whether libfdt is necessary
      then fails to trigger:
      
       if not fdt.found() and fdt_required.length() > 0
        error('fdt not available but required by targets ' + ', '.join(fdt_required))
       endif
      
      The build fails then during compilation instead, which is of course bad
      since this is quite confusing and already wasted quite some time of the user.
      Thus if libfdt is not usable, we should unset the "fdt" variable immediately
      again, so that the build already fails during the configuration phase.
      
      Resolves: https://gitlab.com/qemu-project/qemu/-/issues/255
      
      
      Message-Id: <20210827120901.150276-2-thuth@redhat.com>
      Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
      87daf898
Loading