Skip to content
Snippets Groups Projects
  1. Aug 29, 2023
  2. Jul 06, 2023
  3. Jun 20, 2023
  4. Jun 08, 2023
  5. Feb 08, 2023
  6. Oct 24, 2022
  7. Apr 06, 2022
  8. Mar 22, 2022
  9. Mar 07, 2022
  10. Oct 27, 2021
    • Christian Schoenebeck's avatar
      9pfs: make V9fsPath usable via P9Array API · cc82fde9
      Christian Schoenebeck authored
      
      Signed-off-by: default avatarChristian Schoenebeck <qemu_oss@crudebyte.com>
      Message-Id: <79a0ddf8375f6c95f0565ef155a1bf1e9387664f.1633097129.git.qemu_oss@crudebyte.com>
      cc82fde9
    • Christian Schoenebeck's avatar
      9pfs: make V9fsString usable via P9Array API · 42bdeb04
      Christian Schoenebeck authored
      
      Signed-off-by: default avatarChristian Schoenebeck <qemu_oss@crudebyte.com>
      Message-Id: <ce9f7a0a63585dc27f4545c485109efbec1251da.1633097129.git.qemu_oss@crudebyte.com>
      42bdeb04
    • Christian Schoenebeck's avatar
      fsdev/p9array.h: check scalar type in P9ARRAY_NEW() · c0451f0b
      Christian Schoenebeck authored
      
      Make sure at compile time that the scalar type of the array
      requested to be created via P9ARRAY_NEW() matches the scalar
      type of the passed auto reference variable (unique pointer).
      
      Suggested-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Signed-off-by: default avatarChristian Schoenebeck <qemu_oss@crudebyte.com>
      Message-Id: <c1965e2a096835dc9e1d4d659dfb15d96755cbe0.1633097129.git.qemu_oss@crudebyte.com>
      c0451f0b
    • Christian Schoenebeck's avatar
      9pfs: introduce P9Array · 30e702ab
      Christian Schoenebeck authored
      
      Implements deep auto free of arrays while retaining common C-style
      squared bracket access. Main purpose of this API is to get rid of
      error prone individual array deallocation pathes in user code, i.e.
      turning something like this:
      
        void doSomething(size_t n) {
            Foo *foos = malloc(n * sizeof(Foo));
            for (...) {
                foos[i].s = malloc(...);
                if (...) {
                    goto out;
                }
            }
        out:
            if (...) {
                for (...) {
                    /* deep deallocation */
                    free(foos[i].s);
                }
                /* array deallocation */
                free(foos);
            }
        }
      
      into something more simple and safer like:
      
        void doSomething(size_t n) {
            P9ARRAY_REF(Foo) foos = NULL;
            P9ARRAY_NEW(Foo, foos, n);
            for (...) {
                foos[i].s = malloc(...);
                if (...) {
                    return; /* array auto freed here */
                }
            }
            /* array auto freed here */
        }
      
      Unlike GArray, P9Array does not require special macros, function
      calls or struct member dereferencing to access the individual array
      elements:
      
        C-array = P9Array:   vs.  GArray:
      
        for (...) {           |   for (...) {
            ... = arr[i].m;   |       ... = g_array_index(arr, Foo, i).m;
            arr[i].m = ... ;  |       g_array_index(arr, Foo, i).m = ... ;
        }                     |   }
      
      So existing C-style array code can be retained with only very little
      changes; basically limited to replacing array allocation call and of
      course removing individual array deallocation pathes.
      
      In this initial version P9Array only supports the concept of unique
      pointers, i.e. it does not support reference counting. The array (and
      all dynamically allocated memory of individual array elements) is auto
      freed once execution leaves the scope of the reference variable (unique
      pointer) associated with the array.
      
      Internally a flex array struct is used in combination with macros
      spanned over a continuous memory space for both the array's meta data
      (private) and the actual C-array user data (public):
      
        struct P9Array##scalar_type {
          size_t len;            /* private, hidden from user code */
          scalar_type first[];   /* public, directly exposed to user code */
        };
      
      Which has the advantage that the compiler automatically takes care
      about correct padding, alignment and overall size for all scalar data
      types on all systems and that the user space exposed pointer can
      directly be translated back and forth between user space C-array
      pointer and internal P9Array struct whenever needed, in a type-safe
      manner.
      
      This header file is released under MIT license, to allow this file
      being used in other C-projects as well. The common QEMU license
      GPL2+ might have construed a conflict for other projects.
      
      Signed-off-by: default avatarChristian Schoenebeck <qemu_oss@crudebyte.com>
      Message-Id: <a954ef47b5ac26085a16c5c2aec8695374e0424d.1633097129.git.qemu_oss@crudebyte.com>
      30e702ab
  11. Jan 23, 2021
  12. Jan 12, 2021
  13. Dec 13, 2020
  14. Sep 17, 2020
  15. Sep 15, 2020
    • Christian Schoenebeck's avatar
      9pfs: disable msize warning for synth driver · c418f935
      Christian Schoenebeck authored
      
      Previous patch introduced a performance warning being logged on host
      side if client connected with an 'msize' <= 8192. Disable this
      performance warning for the synth driver to prevent that warning from
      being printed whenever the 9pfs (qtest) test cases are running.
      
      Introduce a new export flag V9FS_NO_PERF_WARN for that purpose, which
      might also be used to disable such warnings from the CLI in future.
      
      We could have also prevented the warning by simply raising P9_MAX_SIZE
      in virtio-9p-test.c to any value larger than 8192, however in the
      context of test cases it makes sense running for edge cases, which
      includes the lowest 'msize' value supported by the server which is
      4096, hence we want to preserve an msize of 4096 for the test client.
      
      Signed-off-by: default avatarChristian Schoenebeck <qemu_oss@crudebyte.com>
      Reviewed-by: default avatarGreg Kurz <groug@kaod.org>
      Message-Id: <E1kEyDy-0006nN-5A@lizzy.crudebyte.com>
      Signed-off-by: default avatarChristian Schoenebeck <qemu_oss@crudebyte.com>
      c418f935
  16. Aug 21, 2020
  17. Jul 10, 2020
  18. Mar 09, 2020
  19. Feb 03, 2020
    • Peter Maydell's avatar
      virtfs-proxy-helper: Convert documentation to rST · 78813586
      Peter Maydell authored
      
      The virtfs-proxy-helper documentation is currently in
      fsdev/qemu-trace-stap.texi in Texinfo format, which we
      present to the user as:
       * a virtfs-proxy-helper manpage
       * but not (unusually for QEMU) part of the HTML docs
      
      Convert the documentation to rST format that lives in
      the docs/ subdirectory, and present it to the user as:
       * a virtfs-proxy-helper manpage
       * part of the interop/ Sphinx manual
      
      There are minor formatting changes to suit Sphinx, but no
      content changes. In particular I've split the -u and -g
      options into each having their own description text.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Acked-by: default avatarGreg Kurz <groug@kaod.org>
      Message-id: 20200124162606.8787-9-peter.maydell@linaro.org
      78813586
  20. Jan 20, 2020
  21. Dec 02, 2019
  22. Oct 10, 2019
    • Antonios Motakis's avatar
      9p: Added virtfs option 'multidevs=remap|forbid|warn' · 1a6ed33c
      Antonios Motakis authored
      
      'warn' (default): Only log an error message (once) on host if more than one
      device is shared by same export, except of that just ignore this config
      error though. This is the default behaviour for not breaking existing
      installations implying that they really know what they are doing.
      
      'forbid': Like 'warn', but except of just logging an error this
      also denies access of guest to additional devices.
      
      'remap': Allows to share more than one device per export by remapping
      inodes from host to guest appropriately. To support multiple devices on the
      9p share, and avoid qid path collisions we take the device id as input to
      generate a unique QID path. The lowest 48 bits of the path will be set
      equal to the file inode, and the top bits will be uniquely assigned based
      on the top 16 bits of the inode and the device id.
      
      Signed-off-by: default avatarAntonios Motakis <antonios.motakis@huawei.com>
      [CS: - Rebased to https://github.com/gkurz/qemu/commits/9p-next
      
      
             (SHA1 7fc4c49e91).
           - Added virtfs option 'multidevs', original patch simply did the inode
             remapping without being asked.
           - Updated hash calls to new xxhash API.
           - Updated docs for new option 'multidevs'.
           - Fixed v9fs_do_readdir() not having remapped inodes.
           - Log error message when running out of prefixes in
             qid_path_prefixmap().
           - Fixed definition of QPATH_INO_MASK.
           - Wrapped qpp_table initialization to dedicated qpp_table_init()
             function.
           - Dropped unnecessary parantheses in qpp_lookup_func().
           - Dropped unnecessary g_malloc0() result checks. ]
      Signed-off-by: default avatarChristian Schoenebeck <qemu_oss@crudebyte.com>
      [groug: - Moved "multidevs" parsing to the local backend.
              - Added hint to invalid multidevs option error.
      	- Turn "remap" into "x-remap". ]
      Signed-off-by: default avatarGreg Kurz <groug@kaod.org>
      1a6ed33c
    • Greg Kurz's avatar
      fsdev: Add return value to fsdev_throttle_parse_opts() · ea52cdd4
      Greg Kurz authored
      
      It is more convenient to use the return value of the function to notify
      errors, rather than to be tied up setting up the &local_err boilerplate.
      
      Signed-off-by: default avatarGreg Kurz <groug@kaod.org>
      ea52cdd4
    • Antonios Motakis's avatar
      9p: unsigned type for type, version, path · 87032833
      Antonios Motakis authored
      
      There is no need for signedness on these QID fields for 9p.
      
      Signed-off-by: default avatarAntonios Motakis <antonios.motakis@huawei.com>
      [CS: - Also make QID type unsigned.
           - Adjust donttouch_stat() to new types.
           - Adjust trace-events to new types. ]
      Signed-off-by: default avatarChristian Schoenebeck <qemu_oss@crudebyte.com>
      Signed-off-by: default avatarGreg Kurz <groug@kaod.org>
      87032833
  23. Aug 20, 2019
  24. Aug 16, 2019
  25. Jun 12, 2019
  26. May 17, 2019
  27. May 13, 2019
  28. Jan 11, 2019
    • Paolo Bonzini's avatar
      qemu/queue.h: leave head structs anonymous unless necessary · b58deb34
      Paolo Bonzini authored
      
      Most list head structs need not be given a name.  In most cases the
      name is given just in case one is going to use QTAILQ_LAST, QTAILQ_PREV
      or reverse iteration, but this does not apply to lists of other kinds,
      and even for QTAILQ in practice this is only rarely needed.  In addition,
      we will soon reimplement those macros completely so that they do not
      need a name for the head struct.  So clean up everything, not giving a
      name except in the rare case where it is necessary.
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      b58deb34
Loading