* [PULL 01/15] qemu-iotests/stream-under-throttle: do not shutdown QEMU
2023-01-06 8:28 [PULL 00/15] First batch of s390x, qtests and misc fixes in 2023 Thomas Huth
@ 2023-01-06 8:28 ` Thomas Huth
2023-01-06 8:28 ` [PULL 02/15] tests/vm: Update get_default_jobs() to work on non-x86_64 non-KVM hosts Thomas Huth
` (14 subsequent siblings)
15 siblings, 0 replies; 20+ messages in thread
From: Thomas Huth @ 2023-01-06 8:28 UTC (permalink / raw)
To: Peter Maydell, qemu-devel; +Cc: Nikita Ivanov
From: Christian Borntraeger <borntraeger@linux.ibm.com>
Without a kernel or boot disk a QEMU on s390 will exit (usually with a
disabled wait state). This breaks the stream-under-throttle test case.
Do not exit qemu if on s390.
Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Message-Id: <20221207131452.8455-1-borntraeger@linux.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
tests/qemu-iotests/tests/stream-under-throttle | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tests/qemu-iotests/tests/stream-under-throttle b/tests/qemu-iotests/tests/stream-under-throttle
index 8d2d9e1684..c24dfbcaa2 100755
--- a/tests/qemu-iotests/tests/stream-under-throttle
+++ b/tests/qemu-iotests/tests/stream-under-throttle
@@ -88,6 +88,8 @@ class TestStreamWithThrottle(iotests.QMPTestCase):
'x-iops-total=10000,x-bps-total=104857600')
self.vm.add_blockdev(self.vm.qmp_to_opts(blockdev))
self.vm.add_device('virtio-blk,iothread=iothr0,drive=throttled-node')
+ if iotests.qemu_default_machine == 's390-ccw-virtio':
+ self.vm.add_args('-no-shutdown')
self.vm.launch()
def tearDown(self) -> None:
--
2.31.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PULL 02/15] tests/vm: Update get_default_jobs() to work on non-x86_64 non-KVM hosts
2023-01-06 8:28 [PULL 00/15] First batch of s390x, qtests and misc fixes in 2023 Thomas Huth
2023-01-06 8:28 ` [PULL 01/15] qemu-iotests/stream-under-throttle: do not shutdown QEMU Thomas Huth
@ 2023-01-06 8:28 ` Thomas Huth
2023-01-06 8:28 ` [PULL 03/15] MAINTAINERS: Add MIPS-related docs and configs to the MIPS architecture section Thomas Huth
` (13 subsequent siblings)
15 siblings, 0 replies; 20+ messages in thread
From: Thomas Huth @ 2023-01-06 8:28 UTC (permalink / raw)
To: Peter Maydell, qemu-devel; +Cc: Nikita Ivanov
From: Philippe Mathieu-Daudé <philmd@linaro.org>
On non-x86_64 host, if KVM is not available we get:
Traceback (most recent call last):
File "tests/vm/basevm.py", line 634, in main
vm = vmcls(args, config=config)
File "tests/vm/basevm.py", line 104, in __init__
mem = max(4, args.jobs)
TypeError: '>' not supported between instances of 'NoneType' and 'int'
Fix by always returning a -- not ideal but safe -- '1' value.
Fixes: b09539444a ("tests/vm: allow us to take advantage of MTTCG")
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20221209164743.70836-1-philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
tests/vm/basevm.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py
index 2276364c42..23229e23d1 100644
--- a/tests/vm/basevm.py
+++ b/tests/vm/basevm.py
@@ -569,8 +569,7 @@ def get_default_jobs():
# more cores. but only up to a reasonable limit. User
# can always override these limits with --jobs.
return min(multiprocessing.cpu_count() // 2, 8)
- else:
- return 1
+ return 1
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
--
2.31.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PULL 03/15] MAINTAINERS: Add MIPS-related docs and configs to the MIPS architecture section
2023-01-06 8:28 [PULL 00/15] First batch of s390x, qtests and misc fixes in 2023 Thomas Huth
2023-01-06 8:28 ` [PULL 01/15] qemu-iotests/stream-under-throttle: do not shutdown QEMU Thomas Huth
2023-01-06 8:28 ` [PULL 02/15] tests/vm: Update get_default_jobs() to work on non-x86_64 non-KVM hosts Thomas Huth
@ 2023-01-06 8:28 ` Thomas Huth
2023-01-06 8:28 ` [PULL 04/15] exec/memory: Expose memory_region_access_valid() Thomas Huth
` (12 subsequent siblings)
15 siblings, 0 replies; 20+ messages in thread
From: Thomas Huth @ 2023-01-06 8:28 UTC (permalink / raw)
To: Peter Maydell, qemu-devel; +Cc: Nikita Ivanov
docs/system/target-mips.rst and configs/targets/mips* are not covered
in our MAINTAINERS file yet, so let's add them now.
Message-Id: <20221212171252.194864-1-thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
MAINTAINERS | 2 ++
1 file changed, 2 insertions(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index 7a40d4d865..5606e5dbd2 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -113,6 +113,8 @@ M: Philippe Mathieu-Daudé <philmd@linaro.org>
R: Jiaxun Yang <jiaxun.yang@flygoat.com>
S: Odd Fixes
K: ^Subject:.*(?i)mips
+F: docs/system/target-mips.rst
+F: configs/targets/mips*
Guest CPU cores (TCG)
---------------------
--
2.31.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PULL 04/15] exec/memory: Expose memory_region_access_valid()
2023-01-06 8:28 [PULL 00/15] First batch of s390x, qtests and misc fixes in 2023 Thomas Huth
` (2 preceding siblings ...)
2023-01-06 8:28 ` [PULL 03/15] MAINTAINERS: Add MIPS-related docs and configs to the MIPS architecture section Thomas Huth
@ 2023-01-06 8:28 ` Thomas Huth
2023-01-06 8:28 ` [PULL 05/15] hw/s390x/pv: Restrict Protected Virtualization to sysemu Thomas Huth
` (11 subsequent siblings)
15 siblings, 0 replies; 20+ messages in thread
From: Thomas Huth @ 2023-01-06 8:28 UTC (permalink / raw)
To: Peter Maydell, qemu-devel; +Cc: Nikita Ivanov
From: Philippe Mathieu-Daudé <philmd@linaro.org>
Instead of having hardware device poking into memory
internal API, expose memory_region_access_valid().
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20221217152454.96388-2-philmd@linaro.org>
Reviewed-by: Eric Farman <farman@linux.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
include/exec/memory-internal.h | 4 ----
include/exec/memory.h | 4 ++++
hw/s390x/s390-pci-inst.c | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/include/exec/memory-internal.h b/include/exec/memory-internal.h
index 9fcc2af25c..100c1237ac 100644
--- a/include/exec/memory-internal.h
+++ b/include/exec/memory-internal.h
@@ -38,10 +38,6 @@ void flatview_unref(FlatView *view);
extern const MemoryRegionOps unassigned_mem_ops;
-bool memory_region_access_valid(MemoryRegion *mr, hwaddr addr,
- unsigned size, bool is_write,
- MemTxAttrs attrs);
-
void flatview_add_to_dispatch(FlatView *fv, MemoryRegionSection *section);
AddressSpaceDispatch *address_space_dispatch_new(FlatView *fv);
void address_space_dispatch_compact(AddressSpaceDispatch *d);
diff --git a/include/exec/memory.h b/include/exec/memory.h
index 91f8a2395a..c37ffdbcd1 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -2442,6 +2442,10 @@ void memory_global_dirty_log_stop(unsigned int flags);
void mtree_info(bool flatview, bool dispatch_tree, bool owner, bool disabled);
+bool memory_region_access_valid(MemoryRegion *mr, hwaddr addr,
+ unsigned size, bool is_write,
+ MemTxAttrs attrs);
+
/**
* memory_region_dispatch_read: perform a read directly to the specified
* MemoryRegion.
diff --git a/hw/s390x/s390-pci-inst.c b/hw/s390x/s390-pci-inst.c
index 9abe95130c..2eee5db7e1 100644
--- a/hw/s390x/s390-pci-inst.c
+++ b/hw/s390x/s390-pci-inst.c
@@ -13,7 +13,7 @@
#include "qemu/osdep.h"
#include "exec/memop.h"
-#include "exec/memory-internal.h"
+#include "exec/memory.h"
#include "qemu/error-report.h"
#include "sysemu/hw_accel.h"
#include "hw/s390x/s390-pci-inst.h"
--
2.31.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PULL 05/15] hw/s390x/pv: Restrict Protected Virtualization to sysemu
2023-01-06 8:28 [PULL 00/15] First batch of s390x, qtests and misc fixes in 2023 Thomas Huth
` (3 preceding siblings ...)
2023-01-06 8:28 ` [PULL 04/15] exec/memory: Expose memory_region_access_valid() Thomas Huth
@ 2023-01-06 8:28 ` Thomas Huth
2023-01-06 8:28 ` [PULL 06/15] target/s390x/tcg/misc_helper: Remove unused "memory.h" include Thomas Huth
` (10 subsequent siblings)
15 siblings, 0 replies; 20+ messages in thread
From: Thomas Huth @ 2023-01-06 8:28 UTC (permalink / raw)
To: Peter Maydell, qemu-devel; +Cc: Nikita Ivanov
From: Philippe Mathieu-Daudé <philmd@linaro.org>
Protected Virtualization is irrelevant in user emulation.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20221217152454.96388-4-philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
target/s390x/cpu_features.c | 4 ++++
target/s390x/cpu_models.c | 4 +++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/target/s390x/cpu_features.c b/target/s390x/cpu_features.c
index 5528acd082..2e4e11d264 100644
--- a/target/s390x/cpu_features.c
+++ b/target/s390x/cpu_features.c
@@ -14,7 +14,9 @@
#include "qemu/osdep.h"
#include "qemu/module.h"
#include "cpu_features.h"
+#ifndef CONFIG_USER_ONLY
#include "hw/s390x/pv.h"
+#endif
#define DEF_FEAT(_FEAT, _NAME, _TYPE, _BIT, _DESC) \
[S390_FEAT_##_FEAT] = { \
@@ -107,6 +109,7 @@ void s390_fill_feat_block(const S390FeatBitmap features, S390FeatType type,
feat = find_next_bit(features, S390_FEAT_MAX, feat + 1);
}
+#ifndef CONFIG_USER_ONLY
if (!s390_is_pv()) {
return;
}
@@ -147,6 +150,7 @@ void s390_fill_feat_block(const S390FeatBitmap features, S390FeatType type,
default:
return;
}
+#endif
}
void s390_add_from_feat_block(S390FeatBitmap features, S390FeatType type,
diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c
index c3a4f80633..065ec6d66c 100644
--- a/target/s390x/cpu_models.c
+++ b/target/s390x/cpu_models.c
@@ -23,8 +23,8 @@
#include "qemu/qemu-print.h"
#ifndef CONFIG_USER_ONLY
#include "sysemu/sysemu.h"
-#endif
#include "hw/s390x/pv.h"
+#endif
#define CPUDEF_INIT(_type, _gen, _ec_ga, _mha_pow, _hmfai, _name, _desc) \
{ \
@@ -236,6 +236,7 @@ bool s390_has_feat(S390Feat feat)
return 0;
}
+#ifndef CONFIG_USER_ONLY
if (s390_is_pv()) {
switch (feat) {
case S390_FEAT_DIAG_318:
@@ -259,6 +260,7 @@ bool s390_has_feat(S390Feat feat)
break;
}
}
+#endif
return test_bit(feat, cpu->model->features);
}
--
2.31.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PULL 06/15] target/s390x/tcg/misc_helper: Remove unused "memory.h" include
2023-01-06 8:28 [PULL 00/15] First batch of s390x, qtests and misc fixes in 2023 Thomas Huth
` (4 preceding siblings ...)
2023-01-06 8:28 ` [PULL 05/15] hw/s390x/pv: Restrict Protected Virtualization to sysemu Thomas Huth
@ 2023-01-06 8:28 ` Thomas Huth
2023-01-06 8:28 ` [PULL 07/15] target/s390x/tcg/excp_helper: Restrict system headers to sysemu Thomas Huth
` (9 subsequent siblings)
15 siblings, 0 replies; 20+ messages in thread
From: Thomas Huth @ 2023-01-06 8:28 UTC (permalink / raw)
To: Peter Maydell, qemu-devel; +Cc: Nikita Ivanov
From: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20221217152454.96388-5-philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
target/s390x/tcg/misc_helper.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/target/s390x/tcg/misc_helper.c b/target/s390x/tcg/misc_helper.c
index 71388a7119..576157b1f3 100644
--- a/target/s390x/tcg/misc_helper.c
+++ b/target/s390x/tcg/misc_helper.c
@@ -23,7 +23,6 @@
#include "qemu/main-loop.h"
#include "cpu.h"
#include "s390x-internal.h"
-#include "exec/memory.h"
#include "qemu/host-utils.h"
#include "exec/helper-proto.h"
#include "qemu/timer.h"
--
2.31.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PULL 07/15] target/s390x/tcg/excp_helper: Restrict system headers to sysemu
2023-01-06 8:28 [PULL 00/15] First batch of s390x, qtests and misc fixes in 2023 Thomas Huth
` (5 preceding siblings ...)
2023-01-06 8:28 ` [PULL 06/15] target/s390x/tcg/misc_helper: Remove unused "memory.h" include Thomas Huth
@ 2023-01-06 8:28 ` Thomas Huth
2023-01-06 8:28 ` [PULL 08/15] target/s390x: Restrict sysemu/reset.h to system emulation Thomas Huth
` (8 subsequent siblings)
15 siblings, 0 replies; 20+ messages in thread
From: Thomas Huth @ 2023-01-06 8:28 UTC (permalink / raw)
To: Peter Maydell, qemu-devel; +Cc: Nikita Ivanov
From: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20221217152454.96388-6-philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
target/s390x/tcg/excp_helper.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/target/s390x/tcg/excp_helper.c b/target/s390x/tcg/excp_helper.c
index fe02d82201..bc767f0443 100644
--- a/target/s390x/tcg/excp_helper.c
+++ b/target/s390x/tcg/excp_helper.c
@@ -21,15 +21,15 @@
#include "qemu/osdep.h"
#include "qemu/log.h"
#include "cpu.h"
-#include "s390x-internal.h"
#include "exec/helper-proto.h"
-#include "qemu/timer.h"
#include "exec/exec-all.h"
#include "exec/cpu_ldst.h"
-#include "hw/s390x/ioinst.h"
-#include "exec/address-spaces.h"
+#include "s390x-internal.h"
#include "tcg_s390x.h"
#ifndef CONFIG_USER_ONLY
+#include "qemu/timer.h"
+#include "exec/address-spaces.h"
+#include "hw/s390x/ioinst.h"
#include "hw/s390x/s390_flic.h"
#include "hw/boards.h"
#endif
--
2.31.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PULL 08/15] target/s390x: Restrict sysemu/reset.h to system emulation
2023-01-06 8:28 [PULL 00/15] First batch of s390x, qtests and misc fixes in 2023 Thomas Huth
` (6 preceding siblings ...)
2023-01-06 8:28 ` [PULL 07/15] target/s390x/tcg/excp_helper: Restrict system headers to sysemu Thomas Huth
@ 2023-01-06 8:28 ` Thomas Huth
2023-01-06 8:28 ` [PULL 09/15] tests/readconfig: spice doesn't support unix socket on windows yet Thomas Huth
` (7 subsequent siblings)
15 siblings, 0 replies; 20+ messages in thread
From: Thomas Huth @ 2023-01-06 8:28 UTC (permalink / raw)
To: Peter Maydell, qemu-devel; +Cc: Nikita Ivanov
From: Philippe Mathieu-Daudé <philmd@linaro.org>
In user emulation, threads -- implemented as CPU -- are
created/destroyed, but never reset. There is no point in
allowing the user emulation access the sysemu/reset API.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20221220145625.26392-5-philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
target/s390x/cpu.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c
index 96562c516d..b10a8541ff 100644
--- a/target/s390x/cpu.c
+++ b/target/s390x/cpu.c
@@ -26,7 +26,6 @@
#include "s390x-internal.h"
#include "kvm/kvm_s390x.h"
#include "sysemu/kvm.h"
-#include "sysemu/reset.h"
#include "qemu/module.h"
#include "trace.h"
#include "qapi/qapi-types-machine.h"
@@ -35,6 +34,9 @@
#include "fpu/softfloat-helpers.h"
#include "disas/capstone.h"
#include "sysemu/tcg.h"
+#ifndef CONFIG_USER_ONLY
+#include "sysemu/reset.h"
+#endif
#define CR0_RESET 0xE0UL
#define CR14_RESET 0xC2000000UL;
--
2.31.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PULL 09/15] tests/readconfig: spice doesn't support unix socket on windows yet
2023-01-06 8:28 [PULL 00/15] First batch of s390x, qtests and misc fixes in 2023 Thomas Huth
` (7 preceding siblings ...)
2023-01-06 8:28 ` [PULL 08/15] target/s390x: Restrict sysemu/reset.h to system emulation Thomas Huth
@ 2023-01-06 8:28 ` Thomas Huth
2023-01-06 8:28 ` [PULL 10/15] i386: Deprecate the -no-hpet QEMU command line option Thomas Huth
` (6 subsequent siblings)
15 siblings, 0 replies; 20+ messages in thread
From: Thomas Huth @ 2023-01-06 8:28 UTC (permalink / raw)
To: Peter Maydell, qemu-devel; +Cc: Nikita Ivanov
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20230103110814.3726795-6-marcandre.lureau@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
tests/qtest/readconfig-test.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tests/qtest/readconfig-test.c b/tests/qtest/readconfig-test.c
index c7a9b0c7dd..9ef870643d 100644
--- a/tests/qtest/readconfig-test.c
+++ b/tests/qtest/readconfig-test.c
@@ -109,8 +109,10 @@ static void test_spice(void)
QTestState *qts;
const char *cfgdata =
"[spice]\n"
- "disable-ticketing = \"on\"\n"
- "unix = \"on\"\n";
+#ifndef WIN32
+ "unix = \"on\"\n"
+#endif
+ "disable-ticketing = \"on\"\n";
qts = qtest_init_with_config(cfgdata);
/* Test valid command */
--
2.31.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PULL 10/15] i386: Deprecate the -no-hpet QEMU command line option
2023-01-06 8:28 [PULL 00/15] First batch of s390x, qtests and misc fixes in 2023 Thomas Huth
` (8 preceding siblings ...)
2023-01-06 8:28 ` [PULL 09/15] tests/readconfig: spice doesn't support unix socket on windows yet Thomas Huth
@ 2023-01-06 8:28 ` Thomas Huth
2023-01-06 8:28 ` [PULL 11/15] docs/interop: Change the vnc-ledstate-Pseudo-encoding doc into .rst Thomas Huth
` (5 subsequent siblings)
15 siblings, 0 replies; 20+ messages in thread
From: Thomas Huth @ 2023-01-06 8:28 UTC (permalink / raw)
To: Peter Maydell, qemu-devel; +Cc: Nikita Ivanov
The HPET setting has been turned into a machine property a while ago
already, so we should finally do the next step and deprecate the
legacy CLI option, too.
Message-Id: <20221229114913.260400-1-thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
docs/about/deprecated.rst | 6 ++++++
softmmu/vl.c | 1 +
qemu-options.hx | 2 +-
3 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst
index 93affe3669..2ae6a79b21 100644
--- a/docs/about/deprecated.rst
+++ b/docs/about/deprecated.rst
@@ -114,6 +114,12 @@ form is preferred.
Using ``-drive if=none`` to configure the OTP device of the sifive_u
RISC-V machine is deprecated. Use ``-drive if=pflash`` instead.
+``-no-hpet`` (since 8.0)
+''''''''''''''''''''''''
+
+The HPET setting has been turned into a machine property.
+Use ``-machine hpet=off`` instead.
+
QEMU Machine Protocol (QMP) commands
------------------------------------
diff --git a/softmmu/vl.c b/softmmu/vl.c
index 798e1dc933..9bd0e52d01 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -3259,6 +3259,7 @@ void qemu_init(int argc, char **argv)
qdict_put_str(machine_opts_dict, "acpi", "off");
break;
case QEMU_OPTION_no_hpet:
+ warn_report("-no-hpet is deprecated, use '-machine hpet=off' instead");
qdict_put_str(machine_opts_dict, "hpet", "off");
break;
case QEMU_OPTION_no_reboot:
diff --git a/qemu-options.hx b/qemu-options.hx
index 7f99d15b23..a3adb4163e 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -2542,7 +2542,7 @@ DEF("no-hpet", 0, QEMU_OPTION_no_hpet,
"-no-hpet disable HPET\n", QEMU_ARCH_I386)
SRST
``-no-hpet``
- Disable HPET support.
+ Disable HPET support. Deprecated, use '-machine hpet=off' instead.
ERST
DEF("acpitable", HAS_ARG, QEMU_OPTION_acpitable,
--
2.31.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PULL 11/15] docs/interop: Change the vnc-ledstate-Pseudo-encoding doc into .rst
2023-01-06 8:28 [PULL 00/15] First batch of s390x, qtests and misc fixes in 2023 Thomas Huth
` (9 preceding siblings ...)
2023-01-06 8:28 ` [PULL 10/15] i386: Deprecate the -no-hpet QEMU command line option Thomas Huth
@ 2023-01-06 8:28 ` Thomas Huth
2023-01-06 8:28 ` [PULL 12/15] Update scripts/meson-buildoptions.sh Thomas Huth
` (4 subsequent siblings)
15 siblings, 0 replies; 20+ messages in thread
From: Thomas Huth @ 2023-01-06 8:28 UTC (permalink / raw)
To: Peter Maydell, qemu-devel; +Cc: Nikita Ivanov
The file seems to contain perfectly valid rst syntax already, so
rename it to .rst and wire it up in the index.
Message-Id: <20221213101806.46640-1-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
docs/interop/index.rst | 1 +
...tate-Pseudo-encoding.txt => vnc-ledstate-pseudo-encoding.rst} | 0
2 files changed, 1 insertion(+)
rename docs/interop/{vnc-ledstate-Pseudo-encoding.txt => vnc-ledstate-pseudo-encoding.rst} (100%)
diff --git a/docs/interop/index.rst b/docs/interop/index.rst
index b7632acb7b..6351ff9ba6 100644
--- a/docs/interop/index.rst
+++ b/docs/interop/index.rst
@@ -23,3 +23,4 @@ are useful for making QEMU interoperate with other software.
vhost-user-gpu
vhost-vdpa
virtio-balloon-stats
+ vnc-ledstate-pseudo-encoding
diff --git a/docs/interop/vnc-ledstate-Pseudo-encoding.txt b/docs/interop/vnc-ledstate-pseudo-encoding.rst
similarity index 100%
rename from docs/interop/vnc-ledstate-Pseudo-encoding.txt
rename to docs/interop/vnc-ledstate-pseudo-encoding.rst
--
2.31.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PULL 12/15] Update scripts/meson-buildoptions.sh
2023-01-06 8:28 [PULL 00/15] First batch of s390x, qtests and misc fixes in 2023 Thomas Huth
` (10 preceding siblings ...)
2023-01-06 8:28 ` [PULL 11/15] docs/interop: Change the vnc-ledstate-Pseudo-encoding doc into .rst Thomas Huth
@ 2023-01-06 8:28 ` Thomas Huth
2023-01-06 8:28 ` [PULL 13/15] Refactoring: refactor TFR() macro to RETRY_ON_EINTR() Thomas Huth
` (3 subsequent siblings)
15 siblings, 0 replies; 20+ messages in thread
From: Thomas Huth @ 2023-01-06 8:28 UTC (permalink / raw)
To: Peter Maydell, qemu-devel; +Cc: Nikita Ivanov
From: Alessandro Di Federico <ale@rev.ng>
Note: `Makefile` relies on modification dates in the source tree to
detect changes to `meson_options.txt`. However, git does not track
those. Therefore, the following was necessary to regenerate
`meson-buildoptions.sh`:
touch meson_options.txt
cd "$BUILD_DIR"
make update-buildoptions
Signed-off-by: Alessandro Di Federico <ale@rev.ng>
Message-Id: <20230102104113.3438895-1-ale@rev.ng>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
scripts/meson-buildoptions.sh | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh
index aa6e30ea91..0f71e92dcb 100644
--- a/scripts/meson-buildoptions.sh
+++ b/scripts/meson-buildoptions.sh
@@ -10,6 +10,9 @@ meson_options_help() {
printf "%s\n" ' affects only QEMU, not tools like qemu-img)'
printf "%s\n" ' --datadir=VALUE Data file directory [share]'
printf "%s\n" ' --disable-coroutine-pool coroutine freelist (better performance)'
+ printf "%s\n" ' --disable-hexagon-idef-parser'
+ printf "%s\n" ' use idef-parser to automatically generate TCG'
+ printf "%s\n" ' code for the Hexagon frontend'
printf "%s\n" ' --disable-install-blobs install provided firmware blobs'
printf "%s\n" ' --docdir=VALUE Base directory for documentation installation'
printf "%s\n" ' (can be empty) [share/doc]'
@@ -40,7 +43,8 @@ meson_options_help() {
printf "%s\n" ' --enable-trace-backends=CHOICES'
printf "%s\n" ' Set available tracing backends [log] (choices:'
printf "%s\n" ' dtrace/ftrace/log/nop/simple/syslog/ust)'
- printf "%s\n" ' --firmwarepath=VALUES search PATH for firmware files [share/qemu-firmware]'
+ printf "%s\n" ' --firmwarepath=VALUES search PATH for firmware files [share/qemu-'
+ printf "%s\n" ' firmware]'
printf "%s\n" ' --iasl=VALUE Path to ACPI disassembler'
printf "%s\n" ' --includedir=VALUE Header file directory [include]'
printf "%s\n" ' --interp-prefix=VALUE where to find shared libraries etc., use %M for'
@@ -93,7 +97,7 @@ meson_options_help() {
printf "%s\n" ' glusterfs Glusterfs block device driver'
printf "%s\n" ' gnutls GNUTLS cryptography support'
printf "%s\n" ' gtk GTK+ user interface'
- printf "%s\n" ' gtk-clipboard clipboard support for GTK (EXPERIMENTAL, MAY HANG)'
+ printf "%s\n" ' gtk-clipboard clipboard support for the gtk UI (EXPERIMENTAL, MAY HANG)'
printf "%s\n" ' guest-agent Build QEMU Guest Agent'
printf "%s\n" ' guest-agent-msi Build MSI package for the QEMU Guest Agent'
printf "%s\n" ' hax HAX acceleration support'
@@ -156,6 +160,8 @@ meson_options_help() {
printf "%s\n" ' usb-redir libusbredir support'
printf "%s\n" ' vde vde network backend support'
printf "%s\n" ' vdi vdi image format support'
+ printf "%s\n" ' vduse-blk-export'
+ printf "%s\n" ' VDUSE block export support'
printf "%s\n" ' vfio-user-server'
printf "%s\n" ' vfio-user server support'
printf "%s\n" ' vhost-crypto vhost-user crypto backend support'
@@ -164,8 +170,6 @@ meson_options_help() {
printf "%s\n" ' vhost-user vhost-user backend support'
printf "%s\n" ' vhost-user-blk-server'
printf "%s\n" ' build vhost-user-blk server'
- printf "%s\n" ' vduse-blk-export'
- printf "%s\n" ' VDUSE block export support'
printf "%s\n" ' vhost-vdpa vhost-vdpa kernel backend support'
printf "%s\n" ' virglrenderer virgl rendering support'
printf "%s\n" ' virtfs virtio-9p support'
@@ -283,6 +287,8 @@ _meson_option_parse() {
--disable-guest-agent-msi) printf "%s" -Dguest_agent_msi=disabled ;;
--enable-hax) printf "%s" -Dhax=enabled ;;
--disable-hax) printf "%s" -Dhax=disabled ;;
+ --enable-hexagon-idef-parser) printf "%s" -Dhexagon_idef_parser=true ;;
+ --disable-hexagon-idef-parser) printf "%s" -Dhexagon_idef_parser=false ;;
--enable-hvf) printf "%s" -Dhvf=enabled ;;
--disable-hvf) printf "%s" -Dhvf=disabled ;;
--iasl=*) quote_sh "-Diasl=$2" ;;
@@ -429,6 +435,8 @@ _meson_option_parse() {
--disable-vde) printf "%s" -Dvde=disabled ;;
--enable-vdi) printf "%s" -Dvdi=enabled ;;
--disable-vdi) printf "%s" -Dvdi=disabled ;;
+ --enable-vduse-blk-export) printf "%s" -Dvduse_blk_export=enabled ;;
+ --disable-vduse-blk-export) printf "%s" -Dvduse_blk_export=disabled ;;
--enable-vfio-user-server) printf "%s" -Dvfio_user_server=enabled ;;
--disable-vfio-user-server) printf "%s" -Dvfio_user_server=disabled ;;
--enable-vhost-crypto) printf "%s" -Dvhost_crypto=enabled ;;
@@ -441,8 +449,6 @@ _meson_option_parse() {
--disable-vhost-user) printf "%s" -Dvhost_user=disabled ;;
--enable-vhost-user-blk-server) printf "%s" -Dvhost_user_blk_server=enabled ;;
--disable-vhost-user-blk-server) printf "%s" -Dvhost_user_blk_server=disabled ;;
- --enable-vduse-blk-export) printf "%s" -Dvduse_blk_export=enabled ;;
- --disable-vduse-blk-export) printf "%s" -Dvduse_blk_export=disabled ;;
--enable-vhost-vdpa) printf "%s" -Dvhost_vdpa=enabled ;;
--disable-vhost-vdpa) printf "%s" -Dvhost_vdpa=disabled ;;
--enable-virglrenderer) printf "%s" -Dvirglrenderer=enabled ;;
--
2.31.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PULL 13/15] Refactoring: refactor TFR() macro to RETRY_ON_EINTR()
2023-01-06 8:28 [PULL 00/15] First batch of s390x, qtests and misc fixes in 2023 Thomas Huth
` (11 preceding siblings ...)
2023-01-06 8:28 ` [PULL 12/15] Update scripts/meson-buildoptions.sh Thomas Huth
@ 2023-01-06 8:28 ` Thomas Huth
2023-01-06 8:28 ` [PULL 14/15] error handling: Use RETRY_ON_EINTR() macro where applicable Thomas Huth
` (2 subsequent siblings)
15 siblings, 0 replies; 20+ messages in thread
From: Thomas Huth @ 2023-01-06 8:28 UTC (permalink / raw)
To: Peter Maydell, qemu-devel; +Cc: Nikita Ivanov
From: Nikita Ivanov <nivanov@cloudlinux.com>
Rename macro name to more transparent one and refactor
it to expression.
Signed-off-by: Nikita Ivanov <nivanov@cloudlinux.com>
Message-Id: <20221023090422.242617-2-nivanov@cloudlinux.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
include/qemu/osdep.h | 8 +++++++-
chardev/char-fd.c | 2 +-
chardev/char-pipe.c | 8 +++++---
net/tap-bsd.c | 6 +++---
net/tap-linux.c | 2 +-
net/tap-solaris.c | 8 ++++----
net/tap.c | 2 +-
os-posix.c | 2 +-
tests/qtest/libqtest.c | 2 +-
9 files changed, 24 insertions(+), 16 deletions(-)
diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
index b9c4307779..7d059ad526 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -251,7 +251,13 @@ void QEMU_ERROR("code path is reachable")
#define ESHUTDOWN 4099
#endif
-#define TFR(expr) do { if ((expr) != -1) break; } while (errno == EINTR)
+#define RETRY_ON_EINTR(expr) \
+ (__extension__ \
+ ({ typeof(expr) __result; \
+ do { \
+ __result = (expr); \
+ } while (__result == -1 && errno == EINTR); \
+ __result; }))
/* time_t may be either 32 or 64 bits depending on the host OS, and
* can be either signed or unsigned, so we can't just hardcode a
diff --git a/chardev/char-fd.c b/chardev/char-fd.c
index cf78454841..d2c4923359 100644
--- a/chardev/char-fd.c
+++ b/chardev/char-fd.c
@@ -198,7 +198,7 @@ int qmp_chardev_open_file_source(char *src, int flags, Error **errp)
{
int fd = -1;
- TFR(fd = qemu_open_old(src, flags, 0666));
+ fd = RETRY_ON_EINTR(qemu_open_old(src, flags, 0666));
if (fd == -1) {
error_setg_file_open(errp, errno, src);
}
diff --git a/chardev/char-pipe.c b/chardev/char-pipe.c
index 66d3b85091..5ad30bcc59 100644
--- a/chardev/char-pipe.c
+++ b/chardev/char-pipe.c
@@ -131,8 +131,8 @@ static void qemu_chr_open_pipe(Chardev *chr,
filename_in = g_strdup_printf("%s.in", filename);
filename_out = g_strdup_printf("%s.out", filename);
- TFR(fd_in = qemu_open_old(filename_in, O_RDWR | O_BINARY));
- TFR(fd_out = qemu_open_old(filename_out, O_RDWR | O_BINARY));
+ fd_in = RETRY_ON_EINTR(qemu_open_old(filename_in, O_RDWR | O_BINARY));
+ fd_out = RETRY_ON_EINTR(qemu_open_old(filename_out, O_RDWR | O_BINARY));
g_free(filename_in);
g_free(filename_out);
if (fd_in < 0 || fd_out < 0) {
@@ -142,7 +142,9 @@ static void qemu_chr_open_pipe(Chardev *chr,
if (fd_out >= 0) {
close(fd_out);
}
- TFR(fd_in = fd_out = qemu_open_old(filename, O_RDWR | O_BINARY));
+ fd_in = fd_out = RETRY_ON_EINTR(
+ qemu_open_old(filename, O_RDWR | O_BINARY)
+ );
if (fd_in < 0) {
error_setg_file_open(errp, errno, filename);
return;
diff --git a/net/tap-bsd.c b/net/tap-bsd.c
index 005ce05c6e..4c98fdd337 100644
--- a/net/tap-bsd.c
+++ b/net/tap-bsd.c
@@ -56,7 +56,7 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr,
} else {
snprintf(dname, sizeof dname, "/dev/tap%d", i);
}
- TFR(fd = open(dname, O_RDWR));
+ fd = RETRY_ON_EINTR(open(dname, O_RDWR));
if (fd >= 0) {
break;
}
@@ -111,7 +111,7 @@ static int tap_open_clone(char *ifname, int ifname_size, Error **errp)
int fd, s, ret;
struct ifreq ifr;
- TFR(fd = open(PATH_NET_TAP, O_RDWR));
+ fd = RETRY_ON_EINTR(open(PATH_NET_TAP, O_RDWR));
if (fd < 0) {
error_setg_errno(errp, errno, "could not open %s", PATH_NET_TAP);
return -1;
@@ -159,7 +159,7 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr,
if (ifname[0] != '\0') {
char dname[100];
snprintf(dname, sizeof dname, "/dev/%s", ifname);
- TFR(fd = open(dname, O_RDWR));
+ fd = RETRY_ON_EINTR(open(dname, O_RDWR));
if (fd < 0 && errno != ENOENT) {
error_setg_errno(errp, errno, "could not open %s", dname);
return -1;
diff --git a/net/tap-linux.c b/net/tap-linux.c
index 304ff45071..f54f308d35 100644
--- a/net/tap-linux.c
+++ b/net/tap-linux.c
@@ -45,7 +45,7 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr,
int len = sizeof(struct virtio_net_hdr);
unsigned int features;
- TFR(fd = open(PATH_NET_TUN, O_RDWR));
+ fd = RETRY_ON_EINTR(open(PATH_NET_TUN, O_RDWR));
if (fd < 0) {
error_setg_errno(errp, errno, "could not open %s", PATH_NET_TUN);
return -1;
diff --git a/net/tap-solaris.c b/net/tap-solaris.c
index a44f8805c2..38e15028bf 100644
--- a/net/tap-solaris.c
+++ b/net/tap-solaris.c
@@ -84,13 +84,13 @@ static int tap_alloc(char *dev, size_t dev_size, Error **errp)
if( ip_fd )
close(ip_fd);
- TFR(ip_fd = open("/dev/udp", O_RDWR, 0));
+ ip_fd = RETRY_ON_EINTR(open("/dev/udp", O_RDWR, 0));
if (ip_fd < 0) {
error_setg(errp, "Can't open /dev/ip (actually /dev/udp)");
return -1;
}
- TFR(tap_fd = open("/dev/tap", O_RDWR, 0));
+ tap_fd = RETRY_ON_EINTR(open("/dev/tap", O_RDWR, 0));
if (tap_fd < 0) {
error_setg(errp, "Can't open /dev/tap");
return -1;
@@ -104,7 +104,7 @@ static int tap_alloc(char *dev, size_t dev_size, Error **errp)
if ((ppa = ioctl (tap_fd, I_STR, &strioc_ppa)) < 0)
error_report("Can't assign new interface");
- TFR(if_fd = open("/dev/tap", O_RDWR, 0));
+ if_fd = RETRY_ON_EINTR(open("/dev/tap", O_RDWR, 0));
if (if_fd < 0) {
error_setg(errp, "Can't open /dev/tap (2)");
return -1;
@@ -137,7 +137,7 @@ static int tap_alloc(char *dev, size_t dev_size, Error **errp)
if (ioctl (ip_fd, I_PUSH, "arp") < 0)
error_report("Can't push ARP module (3)");
/* Open arp_fd */
- TFR(arp_fd = open ("/dev/tap", O_RDWR, 0));
+ arp_fd = RETRY_ON_EINTR(open("/dev/tap", O_RDWR, 0));
if (arp_fd < 0)
error_report("Can't open %s", "/dev/tap");
diff --git a/net/tap.c b/net/tap.c
index e28ceb078f..bd85c56a04 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -650,7 +650,7 @@ static int net_tap_init(const NetdevTapOptions *tap, int *vnet_hdr,
vnet_hdr_required = 0;
}
- TFR(fd = tap_open(ifname, ifname_sz, vnet_hdr, vnet_hdr_required,
+ fd = RETRY_ON_EINTR(tap_open(ifname, ifname_sz, vnet_hdr, vnet_hdr_required,
mq_required, errp));
if (fd < 0) {
return -1;
diff --git a/os-posix.c b/os-posix.c
index 4858650c3e..5adc69f560 100644
--- a/os-posix.c
+++ b/os-posix.c
@@ -272,7 +272,7 @@ void os_setup_post(void)
error_report("not able to chdir to /: %s", strerror(errno));
exit(1);
}
- TFR(fd = qemu_open_old("/dev/null", O_RDWR));
+ fd = RETRY_ON_EINTR(qemu_open_old("/dev/null", O_RDWR));
if (fd == -1) {
exit(1);
}
diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c
index 2fbc3b88f3..f9c8987678 100644
--- a/tests/qtest/libqtest.c
+++ b/tests/qtest/libqtest.c
@@ -203,7 +203,7 @@ void qtest_wait_qemu(QTestState *s)
#ifndef _WIN32
pid_t pid;
- TFR(pid = waitpid(s->qemu_pid, &s->wstatus, 0));
+ pid = RETRY_ON_EINTR(waitpid(s->qemu_pid, &s->wstatus, 0));
assert(pid == s->qemu_pid);
#else
DWORD ret;
--
2.31.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PULL 14/15] error handling: Use RETRY_ON_EINTR() macro where applicable
2023-01-06 8:28 [PULL 00/15] First batch of s390x, qtests and misc fixes in 2023 Thomas Huth
` (12 preceding siblings ...)
2023-01-06 8:28 ` [PULL 13/15] Refactoring: refactor TFR() macro to RETRY_ON_EINTR() Thomas Huth
@ 2023-01-06 8:28 ` Thomas Huth
2023-01-06 8:28 ` [PULL 15/15] .gitlab-ci.d/windows: Do not run the qtests in the msys2-32bit job Thomas Huth
2023-01-07 14:25 ` [PULL 00/15] First batch of s390x, qtests and misc fixes in 2023 Peter Maydell
15 siblings, 0 replies; 20+ messages in thread
From: Thomas Huth @ 2023-01-06 8:28 UTC (permalink / raw)
To: Peter Maydell, qemu-devel; +Cc: Nikita Ivanov
From: Nikita Ivanov <nivanov@cloudlinux.com>
There is a defined RETRY_ON_EINTR() macro in qemu/osdep.h
which handles the same while loop.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/415
Signed-off-by: Nikita Ivanov <nivanov@cloudlinux.com>
Message-Id: <20221023090422.242617-3-nivanov@cloudlinux.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
[thuth: Dropped the hunk that changed socket_accept() in libqtest.c]
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
block/file-posix.c | 37 ++++++++++++++++---------------------
chardev/char-pty.c | 4 +---
hw/9pfs/9p-local.c | 8 ++------
net/l2tpv3.c | 17 +++++------------
net/socket.c | 16 +++++++---------
net/tap.c | 8 ++------
qga/commands-posix.c | 4 +---
semihosting/syscalls.c | 4 +---
tests/qtest/libqtest.c | 4 +---
tests/vhost-user-bridge.c | 4 +---
util/main-loop.c | 4 +---
util/osdep.c | 4 +---
util/vfio-helpers.c | 12 ++++++------
13 files changed, 45 insertions(+), 81 deletions(-)
diff --git a/block/file-posix.c b/block/file-posix.c
index b9647c5ffc..b9955db205 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -1229,9 +1229,7 @@ static int hdev_get_max_segments(int fd, struct stat *st)
ret = -errno;
goto out;
}
- do {
- ret = read(sysfd, buf, sizeof(buf) - 1);
- } while (ret == -1 && errno == EINTR);
+ ret = RETRY_ON_EINTR(read(sysfd, buf, sizeof(buf) - 1));
if (ret < 0) {
ret = -errno;
goto out;
@@ -1379,9 +1377,9 @@ static int handle_aiocb_ioctl(void *opaque)
RawPosixAIOData *aiocb = opaque;
int ret;
- do {
- ret = ioctl(aiocb->aio_fildes, aiocb->ioctl.cmd, aiocb->ioctl.buf);
- } while (ret == -1 && errno == EINTR);
+ ret = RETRY_ON_EINTR(
+ ioctl(aiocb->aio_fildes, aiocb->ioctl.cmd, aiocb->ioctl.buf)
+ );
if (ret == -1) {
return -errno;
}
@@ -1463,18 +1461,17 @@ static ssize_t handle_aiocb_rw_vector(RawPosixAIOData *aiocb)
{
ssize_t len;
- do {
- if (aiocb->aio_type & QEMU_AIO_WRITE)
- len = qemu_pwritev(aiocb->aio_fildes,
- aiocb->io.iov,
- aiocb->io.niov,
- aiocb->aio_offset);
- else
- len = qemu_preadv(aiocb->aio_fildes,
- aiocb->io.iov,
- aiocb->io.niov,
- aiocb->aio_offset);
- } while (len == -1 && errno == EINTR);
+ len = RETRY_ON_EINTR(
+ (aiocb->aio_type & QEMU_AIO_WRITE) ?
+ qemu_pwritev(aiocb->aio_fildes,
+ aiocb->io.iov,
+ aiocb->io.niov,
+ aiocb->aio_offset) :
+ qemu_preadv(aiocb->aio_fildes,
+ aiocb->io.iov,
+ aiocb->io.niov,
+ aiocb->aio_offset)
+ );
if (len == -1) {
return -errno;
@@ -1899,9 +1896,7 @@ static int allocate_first_block(int fd, size_t max_size)
buf = qemu_memalign(max_align, write_size);
memset(buf, 0, write_size);
- do {
- n = pwrite(fd, buf, write_size, 0);
- } while (n == -1 && errno == EINTR);
+ n = RETRY_ON_EINTR(pwrite(fd, buf, write_size, 0));
ret = (n == -1) ? -errno : 0;
diff --git a/chardev/char-pty.c b/chardev/char-pty.c
index 53f25c6bbd..92fd33c854 100644
--- a/chardev/char-pty.c
+++ b/chardev/char-pty.c
@@ -93,9 +93,7 @@ static void pty_chr_update_read_handler(Chardev *chr)
pfd.fd = fioc->fd;
pfd.events = G_IO_OUT;
pfd.revents = 0;
- do {
- rc = g_poll(&pfd, 1, 0);
- } while (rc == -1 && errno == EINTR);
+ rc = RETRY_ON_EINTR(g_poll(&pfd, 1, 0));
assert(rc >= 0);
if (pfd.revents & G_IO_HUP) {
diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c
index d2246a3d7e..9d07620235 100644
--- a/hw/9pfs/9p-local.c
+++ b/hw/9pfs/9p-local.c
@@ -470,9 +470,7 @@ static ssize_t local_readlink(FsContext *fs_ctx, V9fsPath *fs_path,
if (fd == -1) {
return -1;
}
- do {
- tsize = read(fd, (void *)buf, bufsz);
- } while (tsize == -1 && errno == EINTR);
+ tsize = RETRY_ON_EINTR(read(fd, (void *)buf, bufsz));
close_preserve_errno(fd);
} else if ((fs_ctx->export_flags & V9FS_SM_PASSTHROUGH) ||
(fs_ctx->export_flags & V9FS_SM_NONE)) {
@@ -908,9 +906,7 @@ static int local_symlink(FsContext *fs_ctx, const char *oldpath,
}
/* Write the oldpath (target) to the file. */
oldpath_size = strlen(oldpath);
- do {
- write_size = write(fd, (void *)oldpath, oldpath_size);
- } while (write_size == -1 && errno == EINTR);
+ write_size = RETRY_ON_EINTR(write(fd, (void *)oldpath, oldpath_size));
close_preserve_errno(fd);
if (write_size != oldpath_size) {
diff --git a/net/l2tpv3.c b/net/l2tpv3.c
index 5852e42738..53b2d32573 100644
--- a/net/l2tpv3.c
+++ b/net/l2tpv3.c
@@ -240,9 +240,7 @@ static ssize_t net_l2tpv3_receive_dgram_iov(NetClientState *nc,
message.msg_control = NULL;
message.msg_controllen = 0;
message.msg_flags = 0;
- do {
- ret = sendmsg(s->fd, &message, 0);
- } while ((ret == -1) && (errno == EINTR));
+ ret = RETRY_ON_EINTR(sendmsg(s->fd, &message, 0));
if (ret > 0) {
ret -= s->offset;
} else if (ret == 0) {
@@ -285,9 +283,7 @@ static ssize_t net_l2tpv3_receive_dgram(NetClientState *nc,
message.msg_control = NULL;
message.msg_controllen = 0;
message.msg_flags = 0;
- do {
- ret = sendmsg(s->fd, &message, 0);
- } while ((ret == -1) && (errno == EINTR));
+ ret = RETRY_ON_EINTR(sendmsg(s->fd, &message, 0));
if (ret > 0) {
ret -= s->offset;
} else if (ret == 0) {
@@ -434,12 +430,9 @@ static void net_l2tpv3_send(void *opaque)
msgvec = s->msgvec + s->queue_head;
if (target_count > 0) {
- do {
- count = recvmmsg(
- s->fd,
- msgvec,
- target_count, MSG_DONTWAIT, NULL);
- } while ((count == -1) && (errno == EINTR));
+ count = RETRY_ON_EINTR(
+ recvmmsg(s->fd, msgvec, target_count, MSG_DONTWAIT, NULL)
+ );
if (count < 0) {
/* Recv error - we still need to flush packets here,
* (re)set queue head to current position
diff --git a/net/socket.c b/net/socket.c
index b67437a1f0..2fc5696755 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -117,15 +117,13 @@ static ssize_t net_socket_receive_dgram(NetClientState *nc, const uint8_t *buf,
NetSocketState *s = DO_UPCAST(NetSocketState, nc, nc);
ssize_t ret;
- do {
- if (s->dgram_dst.sin_family != AF_UNIX) {
- ret = sendto(s->fd, buf, size, 0,
- (struct sockaddr *)&s->dgram_dst,
- sizeof(s->dgram_dst));
- } else {
- ret = send(s->fd, buf, size, 0);
- }
- } while (ret == -1 && errno == EINTR);
+ ret = RETRY_ON_EINTR(
+ s->dgram_dst.sin_family != AF_UNIX ?
+ sendto(s->fd, buf, size, 0,
+ (struct sockaddr *)&s->dgram_dst,
+ sizeof(s->dgram_dst)) :
+ send(s->fd, buf, size, 0)
+ );
if (ret == -1 && errno == EAGAIN) {
net_socket_write_poll(s, true);
diff --git a/net/tap.c b/net/tap.c
index bd85c56a04..7d7bc1dc5f 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -102,9 +102,7 @@ static ssize_t tap_write_packet(TAPState *s, const struct iovec *iov, int iovcnt
{
ssize_t len;
- do {
- len = writev(s->fd, iov, iovcnt);
- } while (len == -1 && errno == EINTR);
+ len = RETRY_ON_EINTR(writev(s->fd, iov, iovcnt));
if (len == -1 && errno == EAGAIN) {
tap_write_poll(s, true);
@@ -577,9 +575,7 @@ static int net_bridge_run_helper(const char *helper, const char *bridge,
close(sv[1]);
- do {
- fd = recv_fd(sv[0]);
- } while (fd == -1 && errno == EINTR);
+ fd = RETRY_ON_EINTR(recv_fd(sv[0]));
saved_errno = errno;
close(sv[0]);
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index b19b9c5d18..ebd33a643c 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -63,9 +63,7 @@ static void ga_wait_child(pid_t pid, int *status, Error **errp)
*status = 0;
- do {
- rpid = waitpid(pid, status, 0);
- } while (rpid == -1 && errno == EINTR);
+ rpid = RETRY_ON_EINTR(waitpid(pid, status, 0));
if (rpid == -1) {
error_setg_errno(errp, errno, "failed to wait for child (pid: %d)",
diff --git a/semihosting/syscalls.c b/semihosting/syscalls.c
index 508a0ad88c..5893c760c5 100644
--- a/semihosting/syscalls.c
+++ b/semihosting/syscalls.c
@@ -317,9 +317,7 @@ static void host_read(CPUState *cs, gdb_syscall_complete_cb complete,
complete(cs, -1, EFAULT);
return;
}
- do {
- ret = read(gf->hostfd, ptr, len);
- } while (ret == -1 && errno == EINTR);
+ ret = RETRY_ON_EINTR(read(gf->hostfd, ptr, len));
if (ret == -1) {
complete(cs, -1, errno);
unlock_user(ptr, buf, 0);
diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c
index f9c8987678..5cb38f90da 100644
--- a/tests/qtest/libqtest.c
+++ b/tests/qtest/libqtest.c
@@ -689,9 +689,7 @@ int qtest_socket_server(const char *socket_path)
addr.sun_family = AF_UNIX;
snprintf(addr.sun_path, sizeof(addr.sun_path), "%s", socket_path);
- do {
- ret = bind(sock, (struct sockaddr *)&addr, sizeof(addr));
- } while (ret == -1 && errno == EINTR);
+ ret = RETRY_ON_EINTR(bind(sock, (struct sockaddr *)&addr, sizeof(addr)));
g_assert_cmpint(ret, !=, -1);
ret = listen(sock, 1);
g_assert_cmpint(ret, !=, -1);
diff --git a/tests/vhost-user-bridge.c b/tests/vhost-user-bridge.c
index fecdf915e7..a5c711b1de 100644
--- a/tests/vhost-user-bridge.c
+++ b/tests/vhost-user-bridge.c
@@ -331,9 +331,7 @@ vubr_backend_recv_cb(int sock, void *ctx)
.msg_iovlen = num,
.msg_flags = MSG_DONTWAIT,
};
- do {
- ret = recvmsg(vubr->backend_udp_sock, &msg, 0);
- } while (ret == -1 && (errno == EINTR));
+ ret = RETRY_ON_EINTR(recvmsg(vubr->backend_udp_sock, &msg, 0));
if (i == 0) {
iov_restore_front(elem->in_sg, sg, hdrlen);
diff --git a/util/main-loop.c b/util/main-loop.c
index 10fa74c6e3..58f776a8c9 100644
--- a/util/main-loop.c
+++ b/util/main-loop.c
@@ -64,9 +64,7 @@ static void sigfd_handler(void *opaque)
ssize_t len;
while (1) {
- do {
- len = read(fd, &info, sizeof(info));
- } while (len == -1 && errno == EINTR);
+ len = RETRY_ON_EINTR(read(fd, &info, sizeof(info)));
if (len == -1 && errno == EAGAIN) {
break;
diff --git a/util/osdep.c b/util/osdep.c
index 77c1a6c562..e996c4744a 100644
--- a/util/osdep.c
+++ b/util/osdep.c
@@ -244,9 +244,7 @@ static int qemu_lock_fcntl(int fd, int64_t start, int64_t len, int fl_type)
.l_type = fl_type,
};
qemu_probe_lock_ops();
- do {
- ret = fcntl(fd, fcntl_op_setlk, &fl);
- } while (ret == -1 && errno == EINTR);
+ ret = RETRY_ON_EINTR(fcntl(fd, fcntl_op_setlk, &fl));
return ret == -1 ? -errno : 0;
}
diff --git a/util/vfio-helpers.c b/util/vfio-helpers.c
index 7a84b1d806..2d8af38f88 100644
--- a/util/vfio-helpers.c
+++ b/util/vfio-helpers.c
@@ -240,9 +240,9 @@ static int qemu_vfio_pci_read_config(QEMUVFIOState *s, void *buf,
s->config_region_info.offset,
s->config_region_info.size);
assert(QEMU_IS_ALIGNED(s->config_region_info.offset + ofs, size));
- do {
- ret = pread(s->device, buf, size, s->config_region_info.offset + ofs);
- } while (ret == -1 && errno == EINTR);
+ ret = RETRY_ON_EINTR(
+ pread(s->device, buf, size, s->config_region_info.offset + ofs)
+ );
return ret == size ? 0 : -errno;
}
@@ -254,9 +254,9 @@ static int qemu_vfio_pci_write_config(QEMUVFIOState *s, void *buf, int size, int
s->config_region_info.offset,
s->config_region_info.size);
assert(QEMU_IS_ALIGNED(s->config_region_info.offset + ofs, size));
- do {
- ret = pwrite(s->device, buf, size, s->config_region_info.offset + ofs);
- } while (ret == -1 && errno == EINTR);
+ ret = RETRY_ON_EINTR(
+ pwrite(s->device, buf, size, s->config_region_info.offset + ofs)
+ );
return ret == size ? 0 : -errno;
}
--
2.31.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PULL 15/15] .gitlab-ci.d/windows: Do not run the qtests in the msys2-32bit job
2023-01-06 8:28 [PULL 00/15] First batch of s390x, qtests and misc fixes in 2023 Thomas Huth
` (13 preceding siblings ...)
2023-01-06 8:28 ` [PULL 14/15] error handling: Use RETRY_ON_EINTR() macro where applicable Thomas Huth
@ 2023-01-06 8:28 ` Thomas Huth
2023-01-07 14:25 ` [PULL 00/15] First batch of s390x, qtests and misc fixes in 2023 Peter Maydell
15 siblings, 0 replies; 20+ messages in thread
From: Thomas Huth @ 2023-01-06 8:28 UTC (permalink / raw)
To: Peter Maydell, qemu-devel; +Cc: Nikita Ivanov
The qtests are not stable in the msys2-32bit job yet - especially
the test-hmp and the qom-test are failing randomly. Until this is
fixed, let's better disable the qtests here again to avoid failing
CI tests.
Message-Id: <20230105204819.26992-1-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
.gitlab-ci.d/windows.yml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/.gitlab-ci.d/windows.yml b/.gitlab-ci.d/windows.yml
index 22f794e537..a1d5790580 100644
--- a/.gitlab-ci.d/windows.yml
+++ b/.gitlab-ci.d/windows.yml
@@ -116,4 +116,5 @@ msys2-32bit:
- ..\msys64\usr\bin\bash -lc '../configure --target-list=ppc64-softmmu
--disable-opengl'
- ..\msys64\usr\bin\bash -lc 'make'
- - ..\msys64\usr\bin\bash -lc 'make check || { cat meson-logs/testlog.txt; exit 1; } ;'
+ - ..\msys64\usr\bin\bash -lc 'make check MTESTARGS=\"--no-suite qtest\" ||
+ { cat meson-logs/testlog.txt; exit 1; }'
--
2.31.1
^ permalink raw reply related [flat|nested] 20+ messages in thread
* Re: [PULL 00/15] First batch of s390x, qtests and misc fixes in 2023
2023-01-06 8:28 [PULL 00/15] First batch of s390x, qtests and misc fixes in 2023 Thomas Huth
` (14 preceding siblings ...)
2023-01-06 8:28 ` [PULL 15/15] .gitlab-ci.d/windows: Do not run the qtests in the msys2-32bit job Thomas Huth
@ 2023-01-07 14:25 ` Peter Maydell
2023-01-09 7:50 ` Thomas Huth
15 siblings, 1 reply; 20+ messages in thread
From: Peter Maydell @ 2023-01-07 14:25 UTC (permalink / raw)
To: Thomas Huth; +Cc: qemu-devel, Nikita Ivanov
On Fri, 6 Jan 2023 at 08:29, Thomas Huth <thuth@redhat.com> wrote:
>
> Hi Peter!
>
> The following changes since commit cb9c6a8e5ad6a1f0ce164d352e3102df46986e22:
>
> .gitlab-ci.d/windows: Work-around timeout and OpenGL problems of the MSYS2 jobs (2023-01-04 18:58:33 +0000)
>
> are available in the Git repository at:
>
> https://gitlab.com/thuth/qemu.git tags/pull-request-2023-01-06
>
> for you to fetch changes up to 975f619662a46cb5dc7a3b17b84a1b540fb7df5c:
>
> .gitlab-ci.d/windows: Do not run the qtests in the msys2-32bit job (2023-01-05 21:50:21 +0100)
>
> ----------------------------------------------------------------
> * s390x header clean-ups from Philippe
> * Rework and improvements of the EINTR handling by Nikita
> * Deprecate the -no-hpet command line option
> * Disable the qtests in the 32-bit Windows CI job again
> * Some other misc fixes here and there
Hi -- this produces new warnings during 'make check' on the bios-tables-test:
qemu-system-i386: -no-hpet: warning: -no-hpet is deprecated, use
'-machine hpet=off' instead
If we're deprecating that option, can we update the test suite
to not use it, please ?
thanks
-- PMM
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PULL 00/15] First batch of s390x, qtests and misc fixes in 2023
2023-01-07 14:25 ` [PULL 00/15] First batch of s390x, qtests and misc fixes in 2023 Peter Maydell
@ 2023-01-09 7:50 ` Thomas Huth
2023-01-09 10:06 ` Peter Maydell
0 siblings, 1 reply; 20+ messages in thread
From: Thomas Huth @ 2023-01-09 7:50 UTC (permalink / raw)
To: Peter Maydell; +Cc: qemu-devel, Nikita Ivanov
On 07/01/2023 15.25, Peter Maydell wrote:
> On Fri, 6 Jan 2023 at 08:29, Thomas Huth <thuth@redhat.com> wrote:
>>
>> Hi Peter!
>>
>> The following changes since commit cb9c6a8e5ad6a1f0ce164d352e3102df46986e22:
>>
>> .gitlab-ci.d/windows: Work-around timeout and OpenGL problems of the MSYS2 jobs (2023-01-04 18:58:33 +0000)
>>
>> are available in the Git repository at:
>>
>> https://gitlab.com/thuth/qemu.git tags/pull-request-2023-01-06
>>
>> for you to fetch changes up to 975f619662a46cb5dc7a3b17b84a1b540fb7df5c:
>>
>> .gitlab-ci.d/windows: Do not run the qtests in the msys2-32bit job (2023-01-05 21:50:21 +0100)
>>
>> ----------------------------------------------------------------
>> * s390x header clean-ups from Philippe
>> * Rework and improvements of the EINTR handling by Nikita
>> * Deprecate the -no-hpet command line option
>> * Disable the qtests in the 32-bit Windows CI job again
>> * Some other misc fixes here and there
>
> Hi -- this produces new warnings during 'make check' on the bios-tables-test:
>
> qemu-system-i386: -no-hpet: warning: -no-hpet is deprecated, use
> '-machine hpet=off' instead
>
> If we're deprecating that option, can we update the test suite
> to not use it, please ?
Oh, looks like these warnings now only show up in meson-logs/testlog.txt and
not in the standard output anymore as they did in the past? ... that's why I
didn't notice this.
Thanks for the hint, I'll write a patch to fix it.
Do you want me then to respin the pull request with the patch included?
Thomas
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PULL 00/15] First batch of s390x, qtests and misc fixes in 2023
2023-01-09 7:50 ` Thomas Huth
@ 2023-01-09 10:06 ` Peter Maydell
0 siblings, 0 replies; 20+ messages in thread
From: Peter Maydell @ 2023-01-09 10:06 UTC (permalink / raw)
To: Thomas Huth; +Cc: qemu-devel, Nikita Ivanov
On Mon, 9 Jan 2023 at 07:50, Thomas Huth <thuth@redhat.com> wrote:
>
> On 07/01/2023 15.25, Peter Maydell wrote:
> > On Fri, 6 Jan 2023 at 08:29, Thomas Huth <thuth@redhat.com> wrote:
> >>
> >> Hi Peter!
> >>
> >> The following changes since commit cb9c6a8e5ad6a1f0ce164d352e3102df46986e22:
> >>
> >> .gitlab-ci.d/windows: Work-around timeout and OpenGL problems of the MSYS2 jobs (2023-01-04 18:58:33 +0000)
> >>
> >> are available in the Git repository at:
> >>
> >> https://gitlab.com/thuth/qemu.git tags/pull-request-2023-01-06
> >>
> >> for you to fetch changes up to 975f619662a46cb5dc7a3b17b84a1b540fb7df5c:
> >>
> >> .gitlab-ci.d/windows: Do not run the qtests in the msys2-32bit job (2023-01-05 21:50:21 +0100)
> >>
> >> ----------------------------------------------------------------
> >> * s390x header clean-ups from Philippe
> >> * Rework and improvements of the EINTR handling by Nikita
> >> * Deprecate the -no-hpet command line option
> >> * Disable the qtests in the 32-bit Windows CI job again
> >> * Some other misc fixes here and there
> >
> > Hi -- this produces new warnings during 'make check' on the bios-tables-test:
> >
> > qemu-system-i386: -no-hpet: warning: -no-hpet is deprecated, use
> > '-machine hpet=off' instead
> >
> > If we're deprecating that option, can we update the test suite
> > to not use it, please ?
>
> Oh, looks like these warnings now only show up in meson-logs/testlog.txt and
> not in the standard output anymore as they did in the past? ... that's why I
> didn't notice this.
>
> Thanks for the hint, I'll write a patch to fix it.
>
> Do you want me then to respin the pull request with the patch included?
Yes, please.
thanks
-- PMM
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PULL 13/15] Refactoring: refactor TFR() macro to RETRY_ON_EINTR()
2023-01-09 14:25 [PULL v2 " Thomas Huth
@ 2023-01-09 14:26 ` Thomas Huth
0 siblings, 0 replies; 20+ messages in thread
From: Thomas Huth @ 2023-01-09 14:26 UTC (permalink / raw)
To: Peter Maydell, qemu-devel; +Cc: Nikita Ivanov
From: Nikita Ivanov <nivanov@cloudlinux.com>
Rename macro name to more transparent one and refactor
it to expression.
Signed-off-by: Nikita Ivanov <nivanov@cloudlinux.com>
Message-Id: <20221023090422.242617-2-nivanov@cloudlinux.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
include/qemu/osdep.h | 8 +++++++-
chardev/char-fd.c | 2 +-
chardev/char-pipe.c | 8 +++++---
net/tap-bsd.c | 6 +++---
net/tap-linux.c | 2 +-
net/tap-solaris.c | 8 ++++----
net/tap.c | 2 +-
os-posix.c | 2 +-
tests/qtest/libqtest.c | 2 +-
9 files changed, 24 insertions(+), 16 deletions(-)
diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
index b9c4307779..7d059ad526 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -251,7 +251,13 @@ void QEMU_ERROR("code path is reachable")
#define ESHUTDOWN 4099
#endif
-#define TFR(expr) do { if ((expr) != -1) break; } while (errno == EINTR)
+#define RETRY_ON_EINTR(expr) \
+ (__extension__ \
+ ({ typeof(expr) __result; \
+ do { \
+ __result = (expr); \
+ } while (__result == -1 && errno == EINTR); \
+ __result; }))
/* time_t may be either 32 or 64 bits depending on the host OS, and
* can be either signed or unsigned, so we can't just hardcode a
diff --git a/chardev/char-fd.c b/chardev/char-fd.c
index cf78454841..d2c4923359 100644
--- a/chardev/char-fd.c
+++ b/chardev/char-fd.c
@@ -198,7 +198,7 @@ int qmp_chardev_open_file_source(char *src, int flags, Error **errp)
{
int fd = -1;
- TFR(fd = qemu_open_old(src, flags, 0666));
+ fd = RETRY_ON_EINTR(qemu_open_old(src, flags, 0666));
if (fd == -1) {
error_setg_file_open(errp, errno, src);
}
diff --git a/chardev/char-pipe.c b/chardev/char-pipe.c
index 66d3b85091..5ad30bcc59 100644
--- a/chardev/char-pipe.c
+++ b/chardev/char-pipe.c
@@ -131,8 +131,8 @@ static void qemu_chr_open_pipe(Chardev *chr,
filename_in = g_strdup_printf("%s.in", filename);
filename_out = g_strdup_printf("%s.out", filename);
- TFR(fd_in = qemu_open_old(filename_in, O_RDWR | O_BINARY));
- TFR(fd_out = qemu_open_old(filename_out, O_RDWR | O_BINARY));
+ fd_in = RETRY_ON_EINTR(qemu_open_old(filename_in, O_RDWR | O_BINARY));
+ fd_out = RETRY_ON_EINTR(qemu_open_old(filename_out, O_RDWR | O_BINARY));
g_free(filename_in);
g_free(filename_out);
if (fd_in < 0 || fd_out < 0) {
@@ -142,7 +142,9 @@ static void qemu_chr_open_pipe(Chardev *chr,
if (fd_out >= 0) {
close(fd_out);
}
- TFR(fd_in = fd_out = qemu_open_old(filename, O_RDWR | O_BINARY));
+ fd_in = fd_out = RETRY_ON_EINTR(
+ qemu_open_old(filename, O_RDWR | O_BINARY)
+ );
if (fd_in < 0) {
error_setg_file_open(errp, errno, filename);
return;
diff --git a/net/tap-bsd.c b/net/tap-bsd.c
index 005ce05c6e..4c98fdd337 100644
--- a/net/tap-bsd.c
+++ b/net/tap-bsd.c
@@ -56,7 +56,7 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr,
} else {
snprintf(dname, sizeof dname, "/dev/tap%d", i);
}
- TFR(fd = open(dname, O_RDWR));
+ fd = RETRY_ON_EINTR(open(dname, O_RDWR));
if (fd >= 0) {
break;
}
@@ -111,7 +111,7 @@ static int tap_open_clone(char *ifname, int ifname_size, Error **errp)
int fd, s, ret;
struct ifreq ifr;
- TFR(fd = open(PATH_NET_TAP, O_RDWR));
+ fd = RETRY_ON_EINTR(open(PATH_NET_TAP, O_RDWR));
if (fd < 0) {
error_setg_errno(errp, errno, "could not open %s", PATH_NET_TAP);
return -1;
@@ -159,7 +159,7 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr,
if (ifname[0] != '\0') {
char dname[100];
snprintf(dname, sizeof dname, "/dev/%s", ifname);
- TFR(fd = open(dname, O_RDWR));
+ fd = RETRY_ON_EINTR(open(dname, O_RDWR));
if (fd < 0 && errno != ENOENT) {
error_setg_errno(errp, errno, "could not open %s", dname);
return -1;
diff --git a/net/tap-linux.c b/net/tap-linux.c
index 304ff45071..f54f308d35 100644
--- a/net/tap-linux.c
+++ b/net/tap-linux.c
@@ -45,7 +45,7 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr,
int len = sizeof(struct virtio_net_hdr);
unsigned int features;
- TFR(fd = open(PATH_NET_TUN, O_RDWR));
+ fd = RETRY_ON_EINTR(open(PATH_NET_TUN, O_RDWR));
if (fd < 0) {
error_setg_errno(errp, errno, "could not open %s", PATH_NET_TUN);
return -1;
diff --git a/net/tap-solaris.c b/net/tap-solaris.c
index a44f8805c2..38e15028bf 100644
--- a/net/tap-solaris.c
+++ b/net/tap-solaris.c
@@ -84,13 +84,13 @@ static int tap_alloc(char *dev, size_t dev_size, Error **errp)
if( ip_fd )
close(ip_fd);
- TFR(ip_fd = open("/dev/udp", O_RDWR, 0));
+ ip_fd = RETRY_ON_EINTR(open("/dev/udp", O_RDWR, 0));
if (ip_fd < 0) {
error_setg(errp, "Can't open /dev/ip (actually /dev/udp)");
return -1;
}
- TFR(tap_fd = open("/dev/tap", O_RDWR, 0));
+ tap_fd = RETRY_ON_EINTR(open("/dev/tap", O_RDWR, 0));
if (tap_fd < 0) {
error_setg(errp, "Can't open /dev/tap");
return -1;
@@ -104,7 +104,7 @@ static int tap_alloc(char *dev, size_t dev_size, Error **errp)
if ((ppa = ioctl (tap_fd, I_STR, &strioc_ppa)) < 0)
error_report("Can't assign new interface");
- TFR(if_fd = open("/dev/tap", O_RDWR, 0));
+ if_fd = RETRY_ON_EINTR(open("/dev/tap", O_RDWR, 0));
if (if_fd < 0) {
error_setg(errp, "Can't open /dev/tap (2)");
return -1;
@@ -137,7 +137,7 @@ static int tap_alloc(char *dev, size_t dev_size, Error **errp)
if (ioctl (ip_fd, I_PUSH, "arp") < 0)
error_report("Can't push ARP module (3)");
/* Open arp_fd */
- TFR(arp_fd = open ("/dev/tap", O_RDWR, 0));
+ arp_fd = RETRY_ON_EINTR(open("/dev/tap", O_RDWR, 0));
if (arp_fd < 0)
error_report("Can't open %s", "/dev/tap");
diff --git a/net/tap.c b/net/tap.c
index e28ceb078f..bd85c56a04 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -650,7 +650,7 @@ static int net_tap_init(const NetdevTapOptions *tap, int *vnet_hdr,
vnet_hdr_required = 0;
}
- TFR(fd = tap_open(ifname, ifname_sz, vnet_hdr, vnet_hdr_required,
+ fd = RETRY_ON_EINTR(tap_open(ifname, ifname_sz, vnet_hdr, vnet_hdr_required,
mq_required, errp));
if (fd < 0) {
return -1;
diff --git a/os-posix.c b/os-posix.c
index 4858650c3e..5adc69f560 100644
--- a/os-posix.c
+++ b/os-posix.c
@@ -272,7 +272,7 @@ void os_setup_post(void)
error_report("not able to chdir to /: %s", strerror(errno));
exit(1);
}
- TFR(fd = qemu_open_old("/dev/null", O_RDWR));
+ fd = RETRY_ON_EINTR(qemu_open_old("/dev/null", O_RDWR));
if (fd == -1) {
exit(1);
}
diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c
index 2fbc3b88f3..f9c8987678 100644
--- a/tests/qtest/libqtest.c
+++ b/tests/qtest/libqtest.c
@@ -203,7 +203,7 @@ void qtest_wait_qemu(QTestState *s)
#ifndef _WIN32
pid_t pid;
- TFR(pid = waitpid(s->qemu_pid, &s->wstatus, 0));
+ pid = RETRY_ON_EINTR(waitpid(s->qemu_pid, &s->wstatus, 0));
assert(pid == s->qemu_pid);
#else
DWORD ret;
--
2.31.1
^ permalink raw reply related [flat|nested] 20+ messages in thread