- Oct 27, 2021
-
-
Christian Schoenebeck authored
Signed-off-by:
Christian Schoenebeck <qemu_oss@crudebyte.com> Message-Id: <79a0ddf8375f6c95f0565ef155a1bf1e9387664f.1633097129.git.qemu_oss@crudebyte.com>
-
Christian Schoenebeck authored
Signed-off-by:
Christian Schoenebeck <qemu_oss@crudebyte.com> Message-Id: <ce9f7a0a63585dc27f4545c485109efbec1251da.1633097129.git.qemu_oss@crudebyte.com>
-
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:
Richard Henderson <richard.henderson@linaro.org> Signed-off-by:
Christian Schoenebeck <qemu_oss@crudebyte.com> Message-Id: <c1965e2a096835dc9e1d4d659dfb15d96755cbe0.1633097129.git.qemu_oss@crudebyte.com>
-
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:
Christian Schoenebeck <qemu_oss@crudebyte.com> Message-Id: <a954ef47b5ac26085a16c5c2aec8695374e0424d.1633097129.git.qemu_oss@crudebyte.com>
-
- Jan 23, 2021
-
-
Philippe Mathieu-Daudé authored
have_virtfs_proxy_helper is used from docs/meson.build, and can be not declared when including it before fsdev/meson.build. This fixes: ../docs/meson.build:54:2: ERROR: Unknown variable "have_virtfs_proxy_helper". Signed-off-by:
Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20210120151539.1166252-1-philmd@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Jan 12, 2021
-
-
Paolo Bonzini authored
CONFIG_VIRTFS is not anymore part of the config_host dictionary. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Dec 13, 2020
-
-
zhouyang authored
I found some style problems while check the code using checkpatch.pl. This commit fixs the issue below: ERROR: open brace '{' following struct go on the same line Signed-off-by:
zhouyang <zhouyang789@huawei.com> Reviewed-by:
Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20201209060735.2760943-1-zhouyang789@huawei.com> Signed-off-by:
Laurent Vivier <laurent@vivier.eu>
-
- Sep 17, 2020
-
-
zhaolichang authored
I found that there are many spelling errors in the comments of qemu, so I used the spellcheck tool to check the spelling errors and finally found some spelling errors in the folder. Signed-off-by:
zhaolichang <zhaolichang@huawei.com> Reviewed-by:
Alex Bennee <alex.bennee@linaro.org> Message-Id: <20200917075029.313-2-zhaolichang@huawei.com> Signed-off-by:
Laurent Vivier <laurent@vivier.eu>
-
- Sep 15, 2020
-
-
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:
Christian Schoenebeck <qemu_oss@crudebyte.com> Reviewed-by:
Greg Kurz <groug@kaod.org> Message-Id: <E1kEyDy-0006nN-5A@lizzy.crudebyte.com> Signed-off-by:
Christian Schoenebeck <qemu_oss@crudebyte.com>
-
- Aug 21, 2020
-
-
Marc-André Lureau authored
Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Marc-André Lureau authored
Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Jul 10, 2020
-
-
Prasad J Pandit authored
NULL terminate fs driver options' list, validate_opt() looks for a null entry to terminate the loop. Fixes: aee7f3ec ("fsdev: Error out when unsupported option is passed") Signed-off-by:
Prasad J Pandit <pjp@fedoraproject.org> Reviewed-by:
Li Qiang <liq3ea@gmail.com> Message-Id: <20200709175848.650400-1-ppandit@redhat.com> Signed-off-by:
Greg Kurz <groug@kaod.org>
-
- Mar 09, 2020
-
-
Philippe Mathieu-Daudé authored
Reduce a bit the memory footprint by making the helper_opts[] array const. Signed-off-by:
Philippe Mathieu-Daudé <philmd@redhat.com> Acked-by:
Greg Kurz <groug@kaod.org> Acked-by:
Paolo Bonzini <pbonzini@redhat.com> Reviewed-by:
Stefano Garzarella <sgarzare@redhat.com> Message-Id: <20200305010446.17029-4-philmd@redhat.com> Signed-off-by:
Laurent Vivier <laurent@vivier.eu>
-
- Feb 03, 2020
-
-
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:
Peter Maydell <peter.maydell@linaro.org> Acked-by:
Greg Kurz <groug@kaod.org> Message-id: 20200124162606.8787-9-peter.maydell@linaro.org
-
- Jan 20, 2020
-
-
Daniel Henrique Barboza authored
'err_out' can be removed and be replaced by 'return -errno' in its only instance in the function. CC: Greg Kurz <groug@kaod.org> Signed-off-by:
Daniel Henrique Barboza <danielhb413@gmail.com> Acked-by:
Greg Kurz <groug@kaod.org> Signed-off-by:
Greg Kurz <groug@kaod.org>
-
- Dec 02, 2019
-
-
Paolo Bonzini authored
virtfs-proxy-helper is the only user of libcap; everyone else is using the simpler libcap-ng API. Switch and remove the configure code to detect libcap. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Reviewed-by:
Daniel P. Berrangé <berrange@redhat.com> Reviewed-by:
Greg Kurz <groug@kaod.org> [groug: - drop remaining -lcap from Makefile - fix error message in configure] Signed-off-by:
Greg Kurz <groug@kaod.org>
-
- Oct 10, 2019
-
-
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:
Antonios 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:
Christian 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:
Greg Kurz <groug@kaod.org>
-
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:
Greg Kurz <groug@kaod.org>
-
Antonios Motakis authored
There is no need for signedness on these QID fields for 9p. Signed-off-by:
Antonios 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:
Christian Schoenebeck <qemu_oss@crudebyte.com> Signed-off-by:
Greg Kurz <groug@kaod.org>
-
- Aug 20, 2019
-
-
Paolo Bonzini authored
Express the complex conditions in Kconfig rather than Makefiles, since Kconfig is better suited at expressing dependencies and detecting contradictions. Cc: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Aug 16, 2019
-
-
Markus Armbruster authored
In my "build everything" tree, changing qemu/main-loop.h triggers a recompile of some 5600 out of 6600 objects (not counting tests and objects that don't depend on qemu/osdep.h). It includes block/aio.h, which in turn includes qemu/event_notifier.h, qemu/notify.h, qemu/processor.h, qemu/qsp.h, qemu/queue.h, qemu/thread-posix.h, qemu/thread.h, qemu/timer.h, and a few more. Include qemu/main-loop.h only where it's needed. Touching it now recompiles only some 1700 objects. For block/aio.h and qemu/event_notifier.h, these numbers drop from 5600 to 2800. For the others, they shrink only slightly. Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <20190812052359.30071-21-armbru@redhat.com> Reviewed-by:
Alex Bennée <alex.bennee@linaro.org> Reviewed-by:
Philippe Mathieu-Daudé <philmd@redhat.com> Tested-by:
Philippe Mathieu-Daudé <philmd@redhat.com>
-
- Jun 12, 2019
-
-
Markus Armbruster authored
Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <20190523143508.25387-4-armbru@redhat.com> [Rebased with conflicts resolved automatically, except for hw/usb/dev-hub.c hw/misc/exynos4210_rng.c hw/misc/bcm2835_rng.c hw/misc/aspeed_scu.c hw/display/virtio-vga.c hw/arm/stm32f205_soc.c; ui/cocoa.m fixed up]
-
- May 17, 2019
-
-
Greg Kurz authored
Each fsdriver only supports a subset of the options that can be passed to -fsdev. Unsupported options are simply ignored. This could cause the user to erroneously think QEMU has a bug. Enforce strict checking of supported options for all fsdrivers. This shouldn't impact libvirt, since it doesn't know about the synth and proxy fsdrivers. Signed-off-by:
Greg Kurz <groug@kaod.org> Reviewed-by:
Eric Blake <eblake@redhat.com>
-
Greg Kurz authored
It would make sense for these types to be defined in a header file if we had an API for fsdrivers to register themselves. In practice, we only have three of them and it is very unlikely we add new ones since the future of file sharing between host and guest is the upcoming virtio-fs. Move the types to qemu-fsdev.c instead since they are only used there. Signed-off-by:
Greg Kurz <groug@kaod.org> Reviewed-by:
Thomas Huth <thuth@redhat.com>
-
Greg Kurz authored
This was introduced along with -fsdev but it never got used. Signed-off-by:
Greg Kurz <groug@kaod.org> Reviewed-by:
Thomas Huth <thuth@redhat.com>
-
Greg Kurz authored
This is a leftover of the handle backend, removed in QEMU 4.0. Signed-off-by:
Greg Kurz <groug@kaod.org> Reviewed-by:
Thomas Huth <thuth@redhat.com>
-
- May 13, 2019
-
-
Markus Armbruster authored
Header guard symbols should match their file name to make guard collisions less likely. Cleaned up with scripts/clean-header-guards.pl, followed by some renaming of new guard symbols picked by the script to better ones. Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <20190315145123.28030-6-armbru@redhat.com> [Rebase to master: update include/hw/net/ne2000-isa.h]
-
- Jan 11, 2019
-
-
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:
Paolo Bonzini <pbonzini@redhat.com>
-
- Dec 12, 2018
-
-
Greg Kurz authored
The "handle" fsdev backend was deprecated in QEMU 2.12.0 with: commit db3b3c72 Author: Greg Kurz <groug@kaod.org> Date: Mon Jan 8 11:18:23 2018 +0100 9pfs: deprecate handle backend This backend raise some concerns: - doesn't support symlinks - fails +100 tests in the PJD POSIX file system test suite [1] - requires the QEMU process to run with the CAP_DAC_READ_SEARCH capability, which isn't recommended for security reasons This backend should not be used and wil be removed. The 'local' backend is the recommended alternative. [1] https://www.tuxera.com/community/posix-test-suite/ Signed-off-by:
Greg Kurz <groug@kaod.org> Reviewed-by:
Daniel P. Berrange <berrange@redhat.com> Reviewed-by:
Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> It has passed the two release cooling period without any complaint. Remove it now. Signed-off-by:
Greg Kurz <groug@kaod.org> Reviewed-by:
Thomas Huth <thuth@redhat.com>
-
- Oct 19, 2018
-
-
Markus Armbruster authored
Calling error_report() from within a function that takes an Error ** argument is suspicious. qemu_fsdev_add() does that, and its caller fsdev_init_func() then fails without setting an error. Its caller main(), via qemu_opts_foreach(), is fine with it, but clean it up anyway. Cc: Greg Kurz <groug@kaod.org> Signed-off-by:
Markus Armbruster <armbru@redhat.com> Acked-by:
Greg Kurz <groug@kaod.org> Message-Id: <20181017082702.5581-32-armbru@redhat.com>
-
- Aug 22, 2018
-
-
Paolo Bonzini authored
hw/9pfs/Makefile.objs uses CONFIG_VIRTIO_9P to guard the definition for FileOperations structs, while fsdev/Makefile.objs uses CONFIG_VIRTIO to guard the use. Mismatch causes linking to fail when CONFIG_VIRTIO is set but CONFIG_VIRTIO_9P is not. Fix it and use if/else to clarify that the two lines are for opposite conditions. Reported-by:
Peter Maydell <peter.maydell@linaro.org> Fixes: b5dfdb08 Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Acked-by:
Greg Kurz <groug@kaod.org> Tested-by:
Greg Kurz <groug@kaod.org> Signed-off-by:
Greg Kurz <groug@kaod.org>
-
- Mar 06, 2018
-
-
Julia Suvorova authored
basename(3) and dirname(3) modify their argument and may return pointers to statically allocated memory which may be overwritten by subsequent calls. g_path_get_basename and g_path_get_dirname have no such issues, and therefore more preferable. Signed-off-by:
Julia Suvorova <jusual@mail.ru> Message-Id: <1519888086-4207-1-git-send-email-jusual@mail.ru> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Cornelia Huck <cohuck@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Feb 09, 2018
-
-
Markus Armbruster authored
qemu-common.h includes qemu/option.h, but most places that include the former don't actually need the latter. Drop the include, and add it to the places that actually need it. While there, drop superfluous includes of both headers, and separate #include from file comment with a blank line. This cleanup makes the number of objects depending on qemu/option.h drop from 4545 (out of 4743) to 284 in my "build everything" tree. Reviewed-by:
Eric Blake <eblake@redhat.com> Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <20180201111846.21846-20-armbru@redhat.com> [Semantic conflict with commit bdd6a90a in block/nvme.c resolved]
-
Markus Armbruster authored
This cleanup makes the number of objects depending on qapi/error.h drop from 1910 (out of 4743) to 1612 in my "build everything" tree. While there, separate #include from file comment with a blank line, and drop a useless comment on why qemu/osdep.h is included first. Reviewed-by:
Eric Blake <eblake@redhat.com> Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <20180201111846.21846-5-armbru@redhat.com> [Semantic conflict with commit 34e304e9 resolved, OSX breakage fixed]
-
- Feb 08, 2018
-
-
Paolo Bonzini authored
qemu_co_queue_next does not need to release and re-acquire the mutex, because the queued coroutine does not run immediately. However, this does not hold for qemu_co_enter_next. Now that qemu_co_queue_wait can synchronize (via QemuLockable) with code that is not running in coroutine context, it's important that code using qemu_co_enter_next can easily use a standardized locking idiom. First of all, qemu_co_enter_next must use aio_co_wake to restart the coroutine. Second, the function gains a second argument, a QemuLockable*, and the comments of qemu_co_queue_next and qemu_co_queue_restart_all are adjusted to clarify the difference. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20180203153935.8056-5-pbonzini@redhat.com> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by:
Fam Zheng <famz@redhat.com> Signed-off-by:
Fam Zheng <famz@redhat.com>
-
- Jan 08, 2018
-
-
Greg Kurz authored
This patch changes some error messages in the backend init code and convert backends to propagate QEMU Error objects instead of calling error_report(). One notable improvement is that the local backend now provides a more detailed error report when it fails to open the shared directory. Signed-off-by:
Greg Kurz <groug@kaod.org>
-
Greg Kurz authored
This patch changes some error messages in the backend opts parsing code and convert backends to propagate QEMU Error objects instead of calling error_report(). Signed-off-by:
Greg Kurz <groug@kaod.org>
-
Greg Kurz authored
To comply with the QEMU coding style. Signed-off-by:
Greg Kurz <groug@kaod.org>
-
Greg Kurz authored
To comply with the QEMU coding style. Signed-off-by:
Greg Kurz <groug@kaod.org>
-
- Sep 05, 2017
-
-
ZhiPeng Lu authored
@rpath and @sock_name are not freed and leaked. [groug, not really leaked since the program exits just after that. But it is always good practice to free allocated memory] Signed-off-by:
Zhipeng Lu <lu.zhipeng@zte.com.cn> Signed-off-by:
Greg Kurz <groug@kaod.org>
-