aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-09-17Merge remote-tracking branch ↵Peter Maydell21-215/+207
'remotes/huth-gitlab/tags/pull-request-2020-09-16' into staging * Fix "readlink -f" problem in iotests on macOS (to fix the Cirrus-CI tests) * Some minor qtest improvements * Fix the unit tests to work on MSYS2, too * Enable building and testing on MSYS2 in the Cirrus-CI * Build FreeBSD with one task again in the Cirrus-CI # gpg: Signature made Wed 16 Sep 2020 12:24:29 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/huth-gitlab/tags/pull-request-2020-09-16: (24 commits) cirrus: Building freebsd in a single shot ci: Enable msys2 ci in cirrus tests: Fixes test-qdev-global-props.c tests: fix test-util-sockets.c tests: Fixes test-io-channel-file by mask only owner file state mask bits tests: fixes aio-win32 about aio_remove_fd_handler, get it consistence with aio-posix.c tests: Fixes test-io-channel-socket.c tests under msys2/mingw vmstate: Fixes test-vmstate.c on msys2/mingw meson: remove empty else and duplicated gio deps meson: Use -b to ignore CR vs. CR-LF issues on Windows osdep: file locking functions are not available on Win32 tests: test-replication disable /replication/secondary/* on msys2/mingw. tests: Fixes test-replication.c on msys2/mingw. meson: disable crypto tests are empty under win32 meson: Disable test-char on msys2/mingw for fixing tests stuck rcu: fixes test-logging.c by call drain_call_rcu before rmdir_full tests: Convert g_free to g_autofree macro in test-logging.c rcu: Implement drain_call_rcu qga/commands-win32: Fix problem with redundant protype declaration Simplify the .gitignore file ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-09-16Merge remote-tracking branch ↵Peter Maydell27-116/+150
'remotes/berrange/tags/block-odirect-pull-request' into staging block: improve error reporting for unsupported O_DIRECT # gpg: Signature made Wed 16 Sep 2020 10:45:48 BST # gpg: using RSA key DAF3A6FDB26B62912D0E8E3FBE86EBB415104FDF # gpg: Good signature from "Daniel P. Berrange <dan@berrange.com>" [full] # gpg: aka "Daniel P. Berrange <berrange@redhat.com>" [full] # Primary key fingerprint: DAF3 A6FD B26B 6291 2D0E 8E3F BE86 EBB4 1510 4FDF * remotes/berrange/tags/block-odirect-pull-request: block/file: switch to use qemu_open/qemu_create for improved errors util: give a specific error message when O_DIRECT doesn't work util: introduce qemu_open and qemu_create with error reporting util: add Error object for qemu_open_internal error reporting util: refactor qemu_open_old to split off variadic args handling util: rename qemu_open() to qemu_open_old() util: split off a helper for dealing with O_CLOEXEC flag monitor: simplify functions for getting a dup'd fdset entry Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-09-16Merge remote-tracking branch 'remotes/cschoenebeck/tags/pull-9p-20200915' ↵Peter Maydell3-0/+15
into staging The intention of the following two patches is making users aware about the negative file I/O performance impact when using a very low value for 9P client parameter 'msize', which especially is the case if no 'msize' parameter was supplied by the user with a 9P Linux client at all. All it does is logging a performance warning on host side (once) in that case. By setting 'msize' on client side to any value larger than 8192 the performance warning will disappear. See https://wiki.qemu.org/Documentation/9psetup#msize for details. # gpg: Signature made Tue 15 Sep 2020 11:37:32 BST # gpg: using RSA key 96D8D110CF7AF8084F88590134C2B58765A47395 # gpg: issuer "qemu_oss@crudebyte.com" # gpg: Good signature from "Christian Schoenebeck <qemu_oss@crudebyte.com>" [unknown] # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: ECAB 1A45 4014 1413 BA38 4926 30DB 47C3 A012 D5F4 # Subkey fingerprint: 96D8 D110 CF7A F808 4F88 5901 34C2 B587 65A4 7395 * remotes/cschoenebeck/tags/pull-9p-20200915: 9pfs: disable msize warning for synth driver 9pfs: log warning if msize <= 8192 Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-09-16cirrus: Building freebsd in a single shotYonggang Luo1-27/+8
This reverts commit 45f7b7b9f38f5c4d1529a37c93dedfc26a231bba ("cirrus.yml: Split FreeBSD job into two parts"). freebsd 1 hour limit not hit anymore I think we going to a wrong direction, I think there is some tests a stall the test runner, please look at https://cirrus-ci.com/task/5110577531977728 When its running properly, the consumed time are little, but when tests running too long, look at the cpu usage, the cpu usage are nearly zero. doesn't consuming time. And look at https://cirrus-ci.com/task/6119341601062912 If the tests running properly, the time consuming are little We should not hide the error by split them Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Ed Maste <emaste@FreeBSD.org> Message-Id: <20200915121318.247-16-luoyonggang@gmail.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-16ci: Enable msys2 ci in cirrusYonggang Luo1-0/+63
Install msys2 in a proper way refer to: https://github.com/cirruslabs/cirrus-ci-docs/issues/699 The https://wiki.qemu.org/Hosts/W32#Native_builds_with_MSYS2 need to be updated. There is no need of --cross-prefix, open mingw64.exe instead of msys2.exe then we don't need the --cross-prefix, besides we use environment variable settings: MSYS: winsymlinks:nativestrict MSYSTEM: MINGW64 CHERE_INVOKING: 1 to opening mingw64 native shell. Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20200915121318.247-25-luoyonggang@gmail.com> [thuth: Add --target-list-exclude to speed it up a little bit, and add capstone package to avoid build failure with internal capstone] Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-16tests: Fixes test-qdev-global-props.cYonggang Luo1-3/+6
On win32 the line ending are \r\n, so we skip the \n in function test_dynamic_globalprop Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20200915171234.236-22-luoyonggang@gmail.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-16tests: fix test-util-sockets.cYonggang Luo1-1/+5
Fixes following errors: Running test test-util-sockets ERROR test-util-sockets - missing test plan # Start of name tests ** ERROR:../tests/test-util-sockets.c:93:test_socket_fd_pass_name_good: assertion failed (fd != -1): (-1 != -1) Bail out! ERROR:../tests/test-util-sockets.c:93:test_socket_fd_pass_name_good: assertion failed (fd != -1): (-1 != -1) First should call to qemu_init_main_loop before socket_init, then on win32 doesn't support for SOCKET_ADDRESS_TYPE_FD socket type Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20200915121318.247-21-luoyonggang@gmail.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-16tests: Fixes test-io-channel-file by mask only owner file state mask bitsYonggang Luo1-1/+11
This is the error on msys2/mingw Running test test-io-channel-file ** ERROR:../tests/test-io-channel-file.c:59:test_io_channel_file_helper: assertion failed (TEST_MASK & ~mask == st.st_mode & 0777): (384 == 438) ERROR test-io-channel-file - Bail out! ERROR:../tests/test-io-channel-file.c:59:test_io_channel_file_helper: assertion failed (TEST_MASK & ~mask == st.st_mode & 0777): (384 == 438) Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20200915171234.236-20-luoyonggang@gmail.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-16tests: fixes aio-win32 about aio_remove_fd_handler, get it consistence with ↵Yonggang Luo1-2/+10
aio-posix.c This is a fixes for (C:\work\xemu\qemu\build\tests\test-aio-multithread.exe:19100): GLib-CRITICAL **: 23:03:24.965: g_source_remove_poll: assertion '!SOURCE_DESTROYED (source)' failed ERROR test-aio-multithread - Bail out! GLib-FATAL-CRITICAL: g_source_remove_poll: assertion '!SOURCE_DESTROYED (source)' failed (C:\work\xemu\qemu\build\tests\test-bdrv-drain.exe:21036): GLib-CRITICAL **: 23:03:29.861: g_source_remove_poll: assertion '!SOURCE_DESTROYED (source)' failed ERROR test-bdrv-drain - Bail out! GLib-FATAL-CRITICAL: g_source_remove_poll: assertion '!SOURCE_DESTROYED (source)' failed And the idea comes from https://patchwork.kernel.org/patch/9975239/ Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Message-Id: <20200915171234.236-19-luoyonggang@gmail.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-16block/file: switch to use qemu_open/qemu_create for improved errorsDaniel P. Berrangé2-15/+9
Currently at startup if using cache=none on a filesystem lacking O_DIRECT such as tmpfs, at startup QEMU prints qemu-system-x86_64: -drive file=/tmp/foo.img,cache=none: file system may not support O_DIRECT qemu-system-x86_64: -drive file=/tmp/foo.img,cache=none: Could not open '/tmp/foo.img': Invalid argument while at QMP level the hint is missing, so QEMU reports just "error": { "class": "GenericError", "desc": "Could not open '/tmp/foo.img': Invalid argument" } which is close to useless for the end user trying to figure out what they did wrong. With this change at startup QEMU prints qemu-system-x86_64: -drive file=/tmp/foo.img,cache=none: Unable to open '/tmp/foo.img': filesystem does not support O_DIRECT while at the QMP level QEMU reports a massively more informative "error": { "class": "GenericError", "desc": "Unable to open '/tmp/foo.img': filesystem does not support O_DIRECT" } Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-09-16util: give a specific error message when O_DIRECT doesn't workDaniel P. Berrangé1-1/+14
A common error scenario is to tell QEMU to use O_DIRECT in combination with a filesystem that doesn't support it. To aid users to diagnosing their mistake we want to provide a clear error message when this happens. Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-09-16util: introduce qemu_open and qemu_create with error reportingDaniel P. Berrangé2-0/+22
qemu_open_old() works like open(): set errno and return -1 on failure. It has even more failure modes, though. Reporting the error clearly to users is basically impossible for many of them. Our standard cure for "errno is too coarse" is the Error object. Introduce two new helper methods: int qemu_open(const char *name, int flags, Error **errp); int qemu_create(const char *name, int flags, mode_t mode, Error **errp); Note that with this design we no longer require or even accept the O_CREAT flag. Avoiding overloading the two distinct operations means we can avoid variable arguments which would prevent 'errp' from being the last argument. It also gives us a guarantee that the 'mode' is given when creating files, avoiding a latent security bug. Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-09-16util: add Error object for qemu_open_internal error reportingDaniel P. Berrangé1-2/+13
Instead of relying on the limited information from errno, we can now also provide detailed error messages to callers that ask for it. Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-09-16util: refactor qemu_open_old to split off variadic args handlingDaniel P. Berrangé1-7/+17
This simple refactoring prepares for future patches. The variadic args handling is split from the main bulk of the open logic. Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-09-16util: rename qemu_open() to qemu_open_old()Daniel P. Berrangé24-42/+44
We want to introduce a new version of qemu_open() that uses an Error object for reporting problems and make this it the preferred interface. Rename the existing method to release the namespace for the new impl. Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-09-16util: split off a helper for dealing with O_CLOEXEC flagDaniel P. Berrangé1-8/+15
We're going to have multiple callers to open() from qemu_open() soon. Readability would thus benefit from having a helper for dealing with O_CLOEXEC. Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-09-16monitor: simplify functions for getting a dup'd fdset entryDaniel P. Berrangé5-57/+32
Currently code has to call monitor_fdset_get_fd, then dup the return fd, and then add the duplicate FD back into the fdset. This dance is overly verbose for the caller and introduces extra failure modes which can be avoided by folding all the logic into monitor_fdset_dup_fd_add and removing monitor_fdset_get_fd entirely. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-09-16tests: Fixes test-io-channel-socket.c tests under msys2/mingwYonggang Luo1-0/+2
Currently test-io-channel-socket doesn't init with qemu_init_main_loop and that's cause the qemu_aio_context not inited, and the following is the stack when null pointer accessed: qemu_fd_register (c:\work\xemu\qemu\util\main-loop.c:336) qemu_try_set_nonblock (c:\work\xemu\qemu\util\oslib-win32.c:224) qemu_set_nonblock (c:\work\xemu\qemu\util\oslib-win32.c:230) socket_can_bind_connect (c:\work\xemu\qemu\tests\socket-helpers.c:93) socket_check_protocol_support (c:\work\xemu\qemu\tests\socket-helpers.c:141) main (c:\work\xemu\qemu\tests\test-io-channel-socket.c:568) __tmainCRTStartup (@__tmainCRTStartup:142) mainCRTStartup (@1400014f6..140001539:3) BaseThreadInitThunk (@BaseThreadInitThunk:9) RtlUserThreadStart (@RtlUserThreadStart:12) Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20200915121318.247-18-luoyonggang@gmail.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-16vmstate: Fixes test-vmstate.c on msys2/mingwYonggang Luo1-1/+2
The vmstate are valid on win32, just need generate tmp path properly Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20200910103059.987-17-luoyonggang@gmail.com> [thuth: Make indentation a little bit nicer] Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-16meson: remove empty else and duplicated gio depsYonggang Luo1-6/+0
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20200915121318.247-14-luoyonggang@gmail.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-16meson: Use -b to ignore CR vs. CR-LF issues on WindowsYonggang Luo1-1/+1
Ideally we would use the '--strip-trailing-cr' option, but not being POSIX is a portability problem (i.e. BSDs and Solaris based OSes). Instead use the '-b' option which, although doing slightly more, produce the expected result on Windows." Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20200915121318.247-11-luoyonggang@gmail.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-16osdep: file locking functions are not available on Win32Yonggang Luo1-1/+1
Do not declare the following locking functions on Win32: int qemu_lock_fd(int fd, int64_t start, int64_t len, bool exclusive); int qemu_unlock_fd(int fd, int64_t start, int64_t len); int qemu_lock_fd_test(int fd, int64_t start, int64_t len, bool exclusive); bool qemu_has_ofd_lock(void); Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20200915121318.247-10-luoyonggang@gmail.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-16tests: test-replication disable /replication/secondary/* on msys2/mingw.Yonggang Luo1-0/+4
They caused failure on msys2/mingw, that's because file-win32.c not implement .bdrv_reopen_prepare/commit/abort yet. This is the error message: > $ ./tests/test-replication.exe > # random seed: R02S3f4d1c01af2b0a046990e0235c481faf > 1..13 > # Start of replication tests > # Start of primary tests > ok 1 /replication/primary/read > ok 2 /replication/primary/write > ok 3 /replication/primary/start > ok 4 /replication/primary/stop > ok 5 /replication/primary/do_checkpoint > ok 6 /replication/primary/get_error_all > # End of primary tests > # Start of secondary tests > ok 7 /replication/secondary/read > ok 8 /replication/secondary/write > Unexpected error in bdrv_reopen_prepare() at ../block.c:4191: > Block format 'file' used by node '#block4287' does not support reopening > files Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20200915121318.247-9-luoyonggang@gmail.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-16tests: Fixes test-replication.c on msys2/mingw.Yonggang Luo1-4/+14
On Windows there is no path like /tmp/s_local_disk.XXXXXX Use g_get_tmp_dir instead of /tmp. Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20200915121318.247-8-luoyonggang@gmail.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-16meson: disable crypto tests are empty under win32Yonggang Luo1-1/+2
Disable following tests on msys2/mingw 'test-crypto-tlscredsx509': ['crypto-tls-x509-helpers.c', 'pkix_asn1_tab.c', tasn1, crypto], 'test-crypto-tlssession': ['crypto-tls-x509-helpers.c', 'pkix_asn1_tab.c', 'crypto-tls-psk-helpers.c', tasn1, crypto], 'test-io-channel-tls': ['io-channel-helpers.c', 'crypto-tls-x509-helpers.c', 'pkix_asn1_tab.c', tasn1, io, crypto]} These tests are failure with: ERROR test-crypto-tlscredsx509 - missing test plan ERROR test-crypto-tlssession - missing test plan ERROR test-io-channel-tls - missing test plan Because on win32 those test case are all disabled. Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Message-Id: <20200909094617.1582-12-luoyonggang@gmail.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-16meson: Disable test-char on msys2/mingw for fixing tests stuckYonggang Luo1-1/+6
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Message-Id: <20200907200432.2418-3-luoyonggang@gmail.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-16rcu: fixes test-logging.c by call drain_call_rcu before rmdir_fullYonggang Luo1-0/+2
drain_call_rcu is necessary on win32, because under win32, if you don't close the file before remove it, the remove would be fail. Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Message-Id: <20200915121318.247-23-luoyonggang@gmail.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-16tests: Convert g_free to g_autofree macro in test-logging.cYonggang Luo1-2/+1
g_autofree are prefer than g_free when possible. Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20200915121318.247-17-luoyonggang@gmail.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-16rcu: Implement drain_call_rcuMaxim Levitsky2-0/+56
This will allow is to preserve the semantics of hmp_device_del, that the device is deleted immediatly which was changed by previos patch that delayed this to RCU callback Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com> Suggested-by: Stefan Hajnoczi <stefanha@gmail.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20200915121318.247-2-luoyonggang@gmail.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-16qga/commands-win32: Fix problem with redundant protype declarationThomas Huth1-1/+4
When compiling QEMU with MSYS2 on Windows, there is currently the following error: ../qga/commands-win32.c:62:24: error: redundant redeclaration of 'CM_Get_DevNode_PropertyW' [-Werror=redundant-decls] 62 | CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW( | ^~~~~~~~~~~~~~~~~~~~~~~~ In file included from ../qga/commands-win32.c:26: C:/tools/msys64/mingw64/x86_64-w64-mingw32/include/cfgmgr32.h:840:26: note: previous declaration of 'CM_Get_DevNode_PropertyW' was here 840 | CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(DEVINST dnDevInst, const DEVPROPKEY *PropertyKey, DEVPROPTYPE *PropertyType, PBYTE PropertyBuffer, PULONG PropertyBufferSize, ULONG ulFlags); Seems like this protype is sometimes available in the cfgmgr32.h header, and sometimes not. Let's silence the compiler warning here to let the build pass with -Werror, too. Message-Id: <20200915114757.55635-1-thuth@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-16Simplify the .gitignore fileThomas Huth1-152/+0
Now that we always do out-of-tree builds (and the in-tree builds are faked via a "build" directory), we can simplify out .gitignore file quite a bit. Message-Id: <20200909080305.258961-1-thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-16tests/socket-helpers: Treat EAI_NONAME as EADDRNOTAVAILThomas Huth1-2/+1
The tests/test-char test is currently always failing on my system since the getaddrinfo() in socket_can_bind_connect() returns EAI_NONAME when it is called from socket_check_protocol_support() to check for IPv6. socket_check_protocol_support() then returns -1 and thus the tests are not run at all - even though IPv4 is working fine. socket_can_bind_connect() connect should return EADDRNOTAVAIL in this case instead, so that socket_check_protocol_support() does not fail. Suggested-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20200908121543.222872-1-thuth@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-16tests/qtest/qmp-cmd-test: Use inclusive languageThomas Huth1-5/+5
We simply want to ignore certain queries here, so let's rather use the term 'ignore' to express this intention. Message-Id: <20200914163755.42618-1-thuth@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-16fuzz: Change the way we write qtest log to stderrAlexander Bulekov1-3/+2
Telling QTest to log to /dev/fd/2, essentially results in dup(2). This is fine, if other code isn't logging to stderr. Otherwise, the order of the logs is mixed due to buffering issues, since two file-descriptors are used to write to the same file. We can avoid this, since just specifying "-qtest" sets the log fd to stderr. If we want to disable qtest logs, we can just add -qtest-log none. Reviewed-by: Darren Kenny <darren.kenny@oracle.com> Signed-off-by: Alexander Bulekov <alxndr@bu.edu> Message-Id: <20200819061110.1320568-2-alxndr@bu.edu> Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-16iotests: Drop readlink -fMax Reitz1-1/+1
On macOS, (out of the box) readlink does not have -f. We do not really need readlink here, though, it was just a replacement for realpath (which is not available on our BSD test systems), which we needed to make the $(dirname) into an absolute path. Instead of using either, just use "cd; pwd" like is done for $source_iotests. Fixes: b1cbc33a3971b6bb005d5ac3569feae35a71de0f ("iotests: Allow running from different directory") Suggested-by: Peter Maydell <peter.maydell@linaro.org> Reported-by: Claudio Fontana <cfontana@suse.de> Reported-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com> Message-Id: <20200914145606.94620-1-mreitz@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-15Merge remote-tracking branch 'remotes/kraxel/tags/vga-20200915-pull-request' ↵Peter Maydell7-31/+28
into staging vga: fix qxl modular build. vga: add support for virtio-gpu modular builds. # gpg: Signature made Tue 15 Sep 2020 14:08:53 BST # gpg: using RSA key 4CB6D8EED3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full] # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" [full] # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full] # Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138 * remotes/kraxel/tags/vga-20200915-pull-request: virtio-gpu: build modular virtio-gpu: make virtio_gpu_ops static object_initialize: try module load meson: remove duplicate qxl sources meson: fix module config meson: fix qxl dependencies Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-09-15virtio-gpu: build modularGerd Hoffmann2-16/+8
Only build virtio-gpu-device modular (the code which actually depends on the external virglrenderer library). virtio-gpu-pci and virtio-vga are compiled into core qemu still. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20200914134224.29769-7-kraxel@redhat.com
2020-09-15virtio-gpu: make virtio_gpu_ops staticGerd Hoffmann3-11/+11
Reference it via ops pointer instead, simliar to the vga one. Removes hard symbol reference, needed to build virtio-gpu modular. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20200914134224.29769-6-kraxel@redhat.com
2020-09-15object_initialize: try module loadGerd Hoffmann1-0/+6
Needed to allow virtio-gpu-pci initialize the virtio-gpu-device child device. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20200914134224.29769-5-kraxel@redhat.com
2020-09-15meson: remove duplicate qxl sourcesGerd Hoffmann1-2/+0
We should add sources to the softmmu_ss or module_ss but not both. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20200914134224.29769-4-kraxel@redhat.com
2020-09-15meson: fix module configGerd Hoffmann1-1/+1
Use all config symbols not only the host ones. Needed to make sure device configs like CONFIG_QXL are used for modules too. Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20200914134224.29769-3-kraxel@redhat.com
2020-09-15meson: fix qxl dependenciesGerd Hoffmann1-1/+2
Add pixman and spice deps to qxl module. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20200914134224.29769-2-kraxel@redhat.com
2020-09-15Merge remote-tracking branch 'remotes/otubo/tags/pull-seccomp-20200915' into ↵Peter Maydell1-1/+2
staging seccomp branch queue # gpg: Signature made Tue 15 Sep 2020 11:58:27 BST # gpg: using RSA key D67E1B50937486B40723DBABDF32E7C0F0FFF9A2 # gpg: issuer "otubo@redhat.com" # gpg: Good signature from "Eduardo Otubo (Senior Software Engineer) <otubo@redhat.com>" [full] # Primary key fingerprint: D67E 1B50 9374 86B4 0723 DBAB DF32 E7C0 F0FF F9A2 * remotes/otubo/tags/pull-seccomp-20200915: seccomp: fix killing of whole process instead of thread Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-09-15seccomp: fix killing of whole process instead of threadDaniel P. Berrangé1-1/+2
Back in 2018 we introduced support for killing the whole QEMU process instead of just one thread, when a seccomp rule is violated: commit bda08a5764d470f101fa38635d30b41179a313e1 Author: Marc-André Lureau <marcandre.lureau@redhat.com> Date: Wed Aug 22 19:02:48 2018 +0200 seccomp: prefer SCMP_ACT_KILL_PROCESS if available Fast forward a year and we introduced a patch to avoid killing the process for resource control syscalls tickled by Mesa. commit 9a1565a03b79d80b236bc7cc2dbce52a2ef3a1b8 Author: Daniel P. Berrangé <berrange@redhat.com> Date: Wed Mar 13 09:49:03 2019 +0000 seccomp: don't kill process for resource control syscalls Unfortunately a logic bug effectively reverted the first commit mentioned so that we go back to only killing the thread, not the whole process. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Acked-by: Eduardo Otubo <otubo@redhat.com>
2020-09-15Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-2020-09-15' ↵Peter Maydell24-282/+395
into staging Block patches: - Several qcow2 fixes and refactorings - Let qemu-img convert try to stay at cluster boundaries - Stable child names for quorum (with x-blockdev-change) - Explicitly drop vhdx 4k sector support, as it was never actually working - rbd: Mark @namespace a strong runtime option - iotests.py improvements - Drop unused runtime_opts objects - Skip a test case in 030 when run through make check-block # gpg: Signature made Tue 15 Sep 2020 11:27:05 BST # gpg: using RSA key 91BEB60A30DB3E8857D11829F407DB0061D5CF40 # gpg: issuer "mreitz@redhat.com" # gpg: Good signature from "Max Reitz <mreitz@redhat.com>" [full] # Primary key fingerprint: 91BE B60A 30DB 3E88 57D1 1829 F407 DB00 61D5 CF40 * remotes/maxreitz/tags/pull-block-2020-09-15: (22 commits) block/rbd: add 'namespace' to qemu_rbd_strong_runtime_opts[] qcow2: Convert qcow2_alloc_cluster_offset() into qcow2_alloc_host_offset() qcow2: Make preallocate_co() resize the image to the correct size block/qcow: remove runtime opts block/rbd: remove runtime_opts qcow2: Return the original error code in qcow2_co_pwrite_zeroes() qcow2: Make qcow2_free_any_clusters() free only one cluster qcow2: Handle QCowL2Meta on error in preallocate_co() block/vhdx: Support vhdx image only with 512 bytes logical sector size iotests: Skip test_stream_parallel in test 030 when doing "make check" qemu-img: Explicit number replaced by a constant qcow2: Rewrite the documentation of qcow2_alloc_cluster_offset() qcow2: Don't check nb_clusters when removing l2meta from the list qcow2: Fix removal of list members from BDRVQcow2State.cluster_allocs qcow2: Use macros for the L1, refcount and bitmap table entry sizes qemu-img: avoid unaligned read requests during convert block/quorum.c: stable children names qemu-iotests: Simplify FilePath __init__ qemu-iotests: Merge FilePaths and FilePath qemu-iotests: Support varargs syntax in FilePaths ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-09-159pfs: disable msize warning for synth driverChristian Schoenebeck3-1/+7
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>
2020-09-159pfs: log warning if msize <= 8192Christian Schoenebeck1-0/+9
It is essential to choose a reasonable high value for 'msize' to avoid severely degraded file I/O performance. This parameter can only be chosen on client/guest side, and a Linux client defaults to an 'msize' of only 8192 if the user did not explicitly specify a value for 'msize', which results in very poor file I/O performance. Unfortunately many users are not aware that they should specify an appropriate value for 'msize' to avoid severe performance issues, so log a performance warning (with a QEMU wiki link explaining this issue in detail) on host side in that case to make it more clear. Currently a client cannot automatically pick a reasonable value for 'msize', because a good value for 'msize' depends on the file I/O potential of the underlying storage on host side, i.e. a feature invisible to the client, and even then a user would still need to trade off between performance profit and additional RAM costs, i.e. with growing 'msize' (RAM occupation), performance still increases, but performance delta will shrink continuously. Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com> Reviewed-by: Greg Kurz <groug@kaod.org> Message-Id: <e6fc84845c95816ad5baecb0abd6bfefdcf7ec9f.1599144062.git.qemu_oss@crudebyte.com> Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
2020-09-15block/rbd: add 'namespace' to qemu_rbd_strong_runtime_opts[]Stefano Garzarella1-0/+1
Commit 19ae9ae014 ("block/rbd: Add support for ceph namespaces") introduced namespace support for RBD, but we forgot to add the new 'namespace' options to qemu_rbd_strong_runtime_opts[]. The 'namespace' is used to identify the image, so it is a strong option since it can changes the data of a BDS. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1821528 Fixes: 19ae9ae014 ("block/rbd: Add support for ceph namespaces") Cc: Florian Florensa <fflorensa@online.net> Signed-off-by: Stefano Garzarella <sgarzare@redhat.com> Message-Id: <20200914190553.74871-1-sgarzare@redhat.com> Reviewed-by: Jason Dillaman <dillaman@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
2020-09-15qcow2: Convert qcow2_alloc_cluster_offset() into qcow2_alloc_host_offset()Alberto Garcia3-30/+26
qcow2_alloc_cluster_offset() takes an (unaligned) guest offset and returns the (aligned) offset of the corresponding cluster in the qcow2 image. In practice none of the callers need to know where the cluster starts so this patch makes the function calculate and return the final host offset directly. The function is also renamed accordingly. See 388e581615 for a similar change to qcow2_get_cluster_offset(). Signed-off-by: Alberto Garcia <berto@igalia.com> Message-Id: <9bfef50ec9200d752413be4fc2aeb22a28378817.1599833007.git.berto@igalia.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
2020-09-15qcow2: Make preallocate_co() resize the image to the correct sizeAlberto Garcia3-20/+53
This function preallocates metadata structures and then extends the image to its new size, but that new size calculation is wrong because it doesn't take into account that the host_offset variable is always cluster-aligned. This problem can be reproduced with preallocation=metadata when the original size is not cluster-aligned but the new size is. In this case the final image size will be shorter than expected. qemu-img create -f qcow2 img.qcow2 31k qemu-img resize --preallocation=metadata img.qcow2 128k Signed-off-by: Alberto Garcia <berto@igalia.com> Message-Id: <adeb8b059917b141d5f5b3bd2a016262d3052c79.1599833007.git.berto@igalia.com> Reviewed-by: Max Reitz <mreitz@redhat.com> [mreitz: Mark compat=0.10 unsupported for iotest 125] Signed-off-by: Max Reitz <mreitz@redhat.com>