- Sep 27, 2022
-
-
Bin Meng authored
This case was written to use hardcoded /tmp directory for temporary files. Update to use g_get_tmp_dir() for a portable implementation. Signed-off-by:
Bin Meng <bin.meng@windriver.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220925113032.1949844-24-bmeng.cn@gmail.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
Bin Meng authored
This case was written to use hardcoded /tmp directory for temporary files. Update to use g_file_open_tmp() for a portable implementation. Signed-off-by:
Bin Meng <bin.meng@windriver.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220925113032.1949844-23-bmeng.cn@gmail.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
- Sep 22, 2022
-
-
Philippe Mathieu-Daudé authored
Use autofree heap allocation instead of variable-length array on the stack. Signed-off-by:
Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Signed-off-by:
Peter Maydell <peter.maydell@linaro.org> Message-id: 20220819153931.3147384-12-peter.maydell@linaro.org
-
- Sep 20, 2022
-
-
Thomas Huth authored
Let's use a more appropriate wording for this command line and config file option. The old ones are still accepted for compatibility reasons, but marked as deprecated now so that it could be removed in a future version of QEMU. This change is based on earlier patches from Philippe Mathieu-Daudé, with the idea for the new option name suggested by BALATON Zoltan. And while we're at it, replace the "?" in the help text with "help" since that does not have the problem of conflicting with the wildcard character of the shells. Message-Id: <20220727092135.302915-2-thuth@redhat.com> Reviewed-by:
Daniel P. Berrangé <berrange@redhat.com> Reviewed-by:
Konstantin Kostiuk <kkostiuk@redhat.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
- Sep 19, 2022
-
-
Marc-André Lureau authored
Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20220901110414.2892954-1-marcandre.lureau@redhat.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
- Sep 18, 2022
-
-
Paolo Bonzini authored
In CID 1432593, Coverity complains that the result of qdict_crumple() might leak if it is not a dictionary. This is not a practical concern since the test would fail immediately with a NULL pointer dereference in qdict_size(). However, it is not nice to depend on qdict_size() crashing, so add an explicit assertion that that the crumpled object was indeed a dictionary. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
Reported by Coverity as CID 1432543. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
test-visitor-serialization list tests is using an "if" to pick either the first element of the list or the next one. This was done presumably to mimic the code that creates the list, which has to fill in either the head pointer or the next pointer of the last element. However, the code in the insert phase is a pretty standard singly-linked list insertion, while the one in the visit phase looks weird and even looks at the first item twice: this is confusing because the test puts in 32 items and finishes with an assertion that i == 33. So, move the "else" step in a separate switch statement, and change the do...while loop to a while, because cur_head has already been initialized beforehand. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Sep 02, 2022
-
-
Bin Meng authored
Change to dynamically include the test cases by checking AF_UNIX availability using a new helper socket_check_afunix_support(). With such changes testing on a Windows host can be covered as well. Signed-off-by:
Bin Meng <bin.meng@windriver.com> Reviewed-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220802075200.907360-5-bmeng.cn@gmail.com>
-
- Aug 25, 2022
-
-
Bin Meng authored
Use the same g_mkdir_with_parents() call to create a directory on all platforms. Signed-off-by:
Bin Meng <bin.meng@windriver.com> Reviewed-by:
Dr. David Alan Gilbert <dgilbert@redhat.com> Message-Id: <20220824094029.1634519-13-bmeng.cn@gmail.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
Bin Meng authored
Windows does not provide a mkdtemp() API, but glib does. Replace mkdtemp() call with the glib version. Signed-off-by:
Bin Meng <bin.meng@windriver.com> Reviewed-by:
Thomas Huth <thuth@redhat.com> Message-Id: <20220824094029.1634519-3-bmeng.cn@gmail.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
- Aug 12, 2022
-
-
Marc-André Lureau authored
../tests/test-qobject-input-visitor.c: In function ‘test_visitor_in_list’: ../tests/test-qobject-input-visitor.c:454:49: warning: ‘%d’ directive output may be truncated writing between 1 and 10 bytes into a region of size 6 [-Wformat-truncation=] 454 | snprintf(string, sizeof(string), "string%d", i); | ^~ ../tests/test-qobject-input-visitor.c:454:42: note: directive argument in the range [0, 2147483606] 454 | snprintf(string, sizeof(string), "string%d", i); | ^~~~~~~~~~ ../tests/test-qobject-input-visitor.c:454:9: note: ‘snprintf’ output between 8 and 17 bytes into a destination of size 12 454 | snprintf(string, sizeof(string), "string%d", i); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Rather than trying to be clever, since this is called 3 times during tests, let's simply use g_strdup_printf(). Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Message-id: 20220810121513.1356081-1-marcandre.lureau@redhat.com Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> [PMM: fixed commit message typos] Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
- Aug 01, 2022
-
-
Thomas Huth authored
Let's use better, more inclusive wording here. Message-Id: <20220727092135.302915-4-thuth@redhat.com> Reviewed-by:
Konstantin Kostiuk <kkostiuk@redhat.com> Reviewed-by:
Daniel P. Berrangé <berrange@redhat.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
- Jul 18, 2022
-
-
Philippe Mathieu-Daudé authored
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large values, that would lead to a silent truncation of the size from 64 to 32 bits, and result in a heap area being returned which is significantly smaller than what the caller expects. This can likely be exploited in various modules to cause a heap buffer overflow. Replace g_memdup() by the safer g_memdup2() wrapper. Signed-off-by:
Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20210903174510.751630-24-philmd@redhat.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
- Jul 12, 2022
-
-
Alberto Faria authored
Also convert blk_truncate() into a generated_co_wrapper. Signed-off-by:
Alberto Faria <afaria@redhat.com> Reviewed-by:
Paolo Bonzini <pbonzini@redhat.com> Reviewed-by:
Hanna Reitz <hreitz@redhat.com> Message-Id: <20220705161527.1054072-17-afaria@redhat.com> Signed-off-by:
Hanna Reitz <hreitz@redhat.com>
-
Alberto Faria authored
Signed-off-by:
Alberto Faria <afaria@redhat.com> Reviewed-by:
Paolo Bonzini <pbonzini@redhat.com> Reviewed-by:
Hanna Reitz <hreitz@redhat.com> Message-Id: <20220705161527.1054072-13-afaria@redhat.com> Signed-off-by:
Hanna Reitz <hreitz@redhat.com>
-
Alberto Faria authored
Also convert blk_pwrite_compressed() into a generated_co_wrapper. Signed-off-by:
Alberto Faria <afaria@redhat.com> Reviewed-by:
Paolo Bonzini <pbonzini@redhat.com> Reviewed-by:
Hanna Reitz <hreitz@redhat.com> Message-Id: <20220705161527.1054072-12-afaria@redhat.com> Signed-off-by:
Hanna Reitz <hreitz@redhat.com>
-
Alberto Faria authored
Also convert it into a generated_co_wrapper. Signed-off-by:
Alberto Faria <afaria@redhat.com> Reviewed-by:
Paolo Bonzini <pbonzini@redhat.com> Reviewed-by:
Hanna Reitz <hreitz@redhat.com> Message-Id: <20220705161527.1054072-10-afaria@redhat.com> Signed-off-by:
Hanna Reitz <hreitz@redhat.com>
-
Alberto Faria authored
Implement blk_preadv_part() using generated_co_wrapper. Signed-off-by:
Alberto Faria <afaria@redhat.com> Reviewed-by:
Paolo Bonzini <pbonzini@redhat.com> Reviewed-by:
Hanna Reitz <hreitz@redhat.com> Message-Id: <20220705161527.1054072-9-afaria@redhat.com> Signed-off-by:
Hanna Reitz <hreitz@redhat.com>
-
Alberto Faria authored
Implement them using generated_co_wrapper. Signed-off-by:
Alberto Faria <afaria@redhat.com> Reviewed-by:
Paolo Bonzini <pbonzini@redhat.com> Reviewed-by:
Hanna Reitz <hreitz@redhat.com> Message-Id: <20220705161527.1054072-8-afaria@redhat.com> Signed-off-by:
Hanna Reitz <hreitz@redhat.com>
-
Alberto Faria authored
Swap 'buf' and 'bytes' around for consistency with blk_co_{pread,pwrite}(), and in preparation to implement these functions using generated_co_wrapper. Callers were updated using this Coccinelle script: @@ expression blk, offset, buf, bytes, flags; @@ - blk_pread(blk, offset, buf, bytes, flags) + blk_pread(blk, offset, bytes, buf, flags) @@ expression blk, offset, buf, bytes, flags; @@ - blk_pwrite(blk, offset, buf, bytes, flags) + blk_pwrite(blk, offset, bytes, buf, flags) It had no effect on hw/block/nand.c, presumably due to the #if, so that file was updated manually. Overly-long lines were then fixed by hand. Signed-off-by:
Alberto Faria <afaria@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Reviewed-by:
Hanna Reitz <hreitz@redhat.com> Message-Id: <20220705161527.1054072-4-afaria@redhat.com> Signed-off-by:
Hanna Reitz <hreitz@redhat.com>
-
Alberto Faria authored
For consistency with other I/O functions, and in preparation to implement it using generated_co_wrapper. Callers were updated using this Coccinelle script: @@ expression blk, offset, buf, bytes; @@ - blk_pread(blk, offset, buf, bytes) + blk_pread(blk, offset, buf, bytes, 0) It had no effect on hw/block/nand.c, presumably due to the #if, so that file was updated manually. Overly-long lines were then fixed by hand. Signed-off-by:
Alberto Faria <afaria@redhat.com> Reviewed-by:
Paolo Bonzini <pbonzini@redhat.com> Reviewed-by:
Greg Kurz <groug@kaod.org> Reviewed-by:
Hanna Reitz <hreitz@redhat.com> Message-Id: <20220705161527.1054072-3-afaria@redhat.com> Signed-off-by:
Hanna Reitz <hreitz@redhat.com>
-
Alberto Faria authored
They currently return the value of their 'bytes' parameter on success. Make them return 0 instead, for consistency with other I/O functions and in preparation to implement them using generated_co_wrapper. This also makes it clear that short reads/writes are not possible. Signed-off-by:
Alberto Faria <afaria@redhat.com> Message-Id: <20220705161527.1054072-2-afaria@redhat.com> Reviewed-by:
Hanna Reitz <hreitz@redhat.com> Signed-off-by:
Hanna Reitz <hreitz@redhat.com>
-
Alberto Faria authored
They currently return the value of their headerlen/buflen parameter on success. Returning 0 instead makes it clear that short reads/writes are not possible. Signed-off-by:
Alberto Faria <afaria@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20220609152744.3891847-5-afaria@redhat.com> Reviewed-by:
Hanna Reitz <hreitz@redhat.com> Signed-off-by:
Hanna Reitz <hreitz@redhat.com>
-
Alberto Faria authored
They currently return the value of their 'bytes' parameter on success. Make them return 0 instead, for consistency with other I/O functions and in preparation to implement them using generated_co_wrapper. This also makes it clear that short reads/writes are not possible. The few callers that rely on the previous behavior are adjusted accordingly by hand. Signed-off-by:
Alberto Faria <afaria@redhat.com> Reviewed-by:
Paolo Bonzini <pbonzini@redhat.com> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20220609152744.3891847-4-afaria@redhat.com> Reviewed-by:
Hanna Reitz <hreitz@redhat.com> Signed-off-by:
Hanna Reitz <hreitz@redhat.com>
-
Alberto Faria authored
Swap 'buf' and 'bytes' around for consistency with bdrv_co_{pread,pwrite}(), and in preparation to implement these functions using generated_co_wrapper. Callers were updated using this Coccinelle script: @@ expression child, offset, buf, bytes, flags; @@ - bdrv_pread(child, offset, buf, bytes, flags) + bdrv_pread(child, offset, bytes, buf, flags) @@ expression child, offset, buf, bytes, flags; @@ - bdrv_pwrite(child, offset, buf, bytes, flags) + bdrv_pwrite(child, offset, bytes, buf, flags) @@ expression child, offset, buf, bytes, flags; @@ - bdrv_pwrite_sync(child, offset, buf, bytes, flags) + bdrv_pwrite_sync(child, offset, bytes, buf, flags) Resulting overly-long lines were then fixed by hand. Signed-off-by:
Alberto Faria <afaria@redhat.com> Reviewed-by:
Paolo Bonzini <pbonzini@redhat.com> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by:
Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> Message-Id: <20220609152744.3891847-3-afaria@redhat.com> Reviewed-by:
Hanna Reitz <hreitz@redhat.com> Signed-off-by:
Hanna Reitz <hreitz@redhat.com>
-
Alberto Faria authored
For consistency with other I/O functions, and in preparation to implement them using generated_co_wrapper. Callers were updated using this Coccinelle script: @@ expression child, offset, buf, bytes; @@ - bdrv_pread(child, offset, buf, bytes) + bdrv_pread(child, offset, buf, bytes, 0) @@ expression child, offset, buf, bytes; @@ - bdrv_pwrite(child, offset, buf, bytes) + bdrv_pwrite(child, offset, buf, bytes, 0) @@ expression child, offset, buf, bytes; @@ - bdrv_pwrite_sync(child, offset, buf, bytes) + bdrv_pwrite_sync(child, offset, buf, bytes, 0) Resulting overly-long lines were then fixed by hand. Signed-off-by:
Alberto Faria <afaria@redhat.com> Reviewed-by:
Paolo Bonzini <pbonzini@redhat.com> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by:
Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> Message-Id: <20220609152744.3891847-2-afaria@redhat.com> Reviewed-by:
Hanna Reitz <hreitz@redhat.com> Signed-off-by:
Hanna Reitz <hreitz@redhat.com>
-
- Jul 04, 2022
-
-
Marc-André Lureau authored
Reported by ASAN. Fixes commit cfb34489 ("cutils: add functions for IEC and SI prefixes"). Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Message-Id: <20220621083420.66365-1-marcandre.lureau@redhat.com> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
- Jun 23, 2022
-
-
Daniel P. Berrangé authored
Now that all QEMUFile callbacks are removed, the entire concept can be deleted. Reviewed-by:
Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by:
Daniel P. Berrangé <berrange@redhat.com> Reviewed-by:
Juan Quintela <quintela@redhat.com> Signed-off-by:
Juan Quintela <quintela@redhat.com> Signed-off-by:
Dr. David Alan Gilbert <dgilbert@redhat.com>
-
- Jun 22, 2022
-
-
Daniel P. Berrangé authored
This is for code which needs a portable equivalent to a QIOChannelFile connected to /dev/null. Signed-off-by:
Daniel P. Berrangé <berrange@redhat.com> Reviewed-by:
Juan Quintela <quintela@redhat.com> Signed-off-by:
Juan Quintela <quintela@redhat.com> Signed-off-by:
Dr. David Alan Gilbert <dgilbert@redhat.com>
-
- Jun 14, 2022
-
-
Paolo Bonzini authored
Extract the knowledge of IEC and SI prefixes out of size_to_str and freq_to_str, so that it can be reused when printing statistics. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- May 28, 2022
-
-
Marc-André Lureau authored
Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Konstantin Kostiuk <kkostiuk@redhat.com> Message-Id: <20220525144140.591926-16-marcandre.lureau@redhat.com>
-
Marc-André Lureau authored
This a more accurate way to lookup the test data, and will allow to move the test in a subproject. Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Konstantin Kostiuk <kkostiuk@redhat.com> Message-Id: <20220525144140.591926-11-marcandre.lureau@redhat.com>
-
- May 26, 2022
-
-
Lei He authored
As Daniel suggested, Add tests suite for rsakey, as a way to prove that we can handle DER errors correctly. Signed-off-by:
lei he <helei.sig11@bytedance.com> Signed-off-by:
Daniel P. Berrangé <berrange@redhat.com>
-
Lei He authored
Add unit test and benchmark test for crypto akcipher. Signed-off-by:
lei he <helei.sig11@bytedance.com> Signed-off-by:
zhenwei pi <pizhenwei@bytedance.com> Signed-off-by:
Daniel P. Berrangé <berrange@redhat.com>
-
Lei He authored
Add an ANS.1 DER decoder which is used to parse asymmetric cipher keys Signed-off-by:
zhenwei pi <pizhenwei@bytedance.com> Signed-off-by:
lei he <helei.sig11@bytedance.com> Signed-off-by:
Daniel P. Berrangé <berrange@redhat.com>
-
- May 19, 2022
-
-
Peter Maydell authored
The traditional ptimer behaviour includes a collection of weird edge case behaviours. In 2016 we improved the ptimer implementation to fix these and generally make the behaviour more flexible, with ptimers opting in to the new behaviour by passing an appropriate set of policy flags to ptimer_init(). For backwards-compatibility, we defined PTIMER_POLICY_DEFAULT (which sets no flags) to give the old weird behaviour. This turns out to be a poor choice of name, because people writing new devices which use ptimers are misled into thinking that the default is probably a sensible choice of flags, when in fact it is almost always not what you want. Rename PTIMER_POLICY_DEFAULT to PTIMER_POLICY_LEGACY and beef up the comment to more clearly say that new devices should not be using it. The code-change part of this commit was produced by sed -i -e 's/PTIMER_POLICY_DEFAULT/PTIMER_POLICY_LEGACY/g' $(git grep -l PTIMER_POLICY_DEFAULT) with the exception of a test name string change in tests/unit/ptimer-test.c which was added manually. Signed-off-by:
Peter Maydell <peter.maydell@linaro.org> Reviewed-by:
Francisco Iglesias <francisco.iglesias@amd.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Message-id: 20220516103058.162280-1-peter.maydell@linaro.org
-
- May 16, 2022
-
-
Leonardo Bras authored
Add flags to io_writev and introduce io_flush as optional callback to QIOChannelClass, allowing the implementation of zero copy writes by subclasses. How to use them: - Write data using qio_channel_writev*(...,QIO_CHANNEL_WRITE_FLAG_ZERO_COPY), - Wait write completion with qio_channel_flush(). Notes: As some zero copy write implementations work asynchronously, it's recommended to keep the write buffer untouched until the return of qio_channel_flush(), to avoid the risk of sending an updated buffer instead of the buffer state during write. As io_flush callback is optional, if a subclass does not implement it, then: - io_flush will return 0 without changing anything. Also, some functions like qio_channel_writev_full_all() were adapted to receive a flag parameter. That allows shared code between zero copy and non-zero copy writev, and also an easier implementation on new flags. Signed-off-by:
Leonardo Bras <leobras@redhat.com> Reviewed-by:
Daniel P. Berrangé <berrange@redhat.com> Reviewed-by:
Peter Xu <peterx@redhat.com> Reviewed-by:
Juan Quintela <quintela@redhat.com> Message-Id: <20220513062836.965425-3-leobras@redhat.com> Signed-off-by:
Dr. David Alan Gilbert <dgilbert@redhat.com>
-
Daniel P. Berrangé authored
This validates that we correctly handle migration success and failure scenarios when using TLS with pre shared keys. Signed-off-by:
Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20220426160048.812266-4-berrange@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Signed-off-by:
Dr. David Alan Gilbert <dgilbert@redhat.com>
-
Daniel P. Berrangé authored
These macros are more suited to the general consumers of certs in the test suite, where we don't need to exercise every single possible permutation. Signed-off-by:
Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20220426160048.812266-3-berrange@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Signed-off-by:
Dr. David Alan Gilbert <dgilbert@redhat.com>
-