All of lore.kernel.org
 help / color / mirror / Atom feed
* [PULL 00/12] s390x and misc patches
@ 2022-06-03  6:58 Thomas Huth
  2022-06-03  6:58 ` [PULL 01/12] s390: Typo fix FLOATING_POINT_SUPPPORT_ENH Thomas Huth
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: Thomas Huth @ 2022-06-03  6:58 UTC (permalink / raw)
  To: qemu-devel, Richard Henderson; +Cc: qemu-s390x

The following changes since commit 1e62a82574fc28e64deca589a23cf55ada2e1a7d:

  Merge tag 'm68k-for-7.1-pull-request' of https://github.com/vivier/qemu-m68k into staging (2022-06-02 06:30:24 -0700)

are available in the Git repository at:

  https://gitlab.com/thuth/qemu.git tags/pull-request-2022-06-03

for you to fetch changes up to 707d93d4abc6485c638e2aecd93fbd904f2f6b3e:

  ui: Remove deprecated options "-sdl" and "-curses" (2022-06-03 08:03:28 +0200)

----------------------------------------------------------------
* s390x storage key improvements for KVM
* Some cosmetics for s390x
* Update MAINTAINERS entries
* Improve some spots wrt memory handling in the qtests
* Clean up the "-display sdl" parameter parsing

----------------------------------------------------------------
Alex Bennée (1):
      tests/qtest: use g_autofree for test_server_create_chr

Dr. David Alan Gilbert (1):
      s390: Typo fix FLOATING_POINT_SUPPPORT_ENH

Eric Farman (1):
      MAINTAINERS: Update s390 vhost entries

Gautam Agrawal (1):
      tests/tcg: Test overflow conditions

Hailiang Zhang (1):
      MAINTAINERS: Change my email address

Janis Schoetterl-Glausch (1):
      target/s390x: kvm: Honor storage keys during emulation

Miaoqian Lin (1):
      qtest/npcm7xx_pwm-test: Fix memory leak in mft_qom_set

Thomas Huth (4):
      hw/s390x/s390-virtio-ccw: Improve the machine description string
      ui: Remove deprecated parameters of the "-display sdl" option
      ui: Switch "-display sdl" to use the QAPI parser
      ui: Remove deprecated options "-sdl" and "-curses"

Wenchao Wang (1):
      MAINTAINERS: Update maintainers for Guest x86 HAXM CPUs

 docs/about/deprecated.rst           |  26 --------
 docs/about/removed-features.rst     |  27 ++++++++
 qapi/ui.json                        |  26 +++++++-
 include/sysemu/sysemu.h             |   2 -
 target/s390x/cpu_features_def.h.inc |   2 +-
 hw/s390x/s390-virtio-ccw.c          |   2 +-
 softmmu/globals.c                   |   2 -
 softmmu/vl.c                        | 128 +-----------------------------------
 target/s390x/gen-features.c         |   6 +-
 target/s390x/kvm/kvm.c              |   9 +++
 target/s390x/tcg/translate.c        |   8 +--
 tests/qtest/npcm7xx_pwm-test.c      |   3 +
 tests/qtest/vhost-user-test.c       |   7 +-
 tests/tcg/multiarch/overflow.c      |  58 ++++++++++++++++
 ui/sdl2.c                           |  10 +++
 MAINTAINERS                         |   6 +-
 qemu-options.hx                     |  56 ++--------------
 17 files changed, 151 insertions(+), 227 deletions(-)
 create mode 100644 tests/tcg/multiarch/overflow.c



^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PULL 01/12] s390: Typo fix FLOATING_POINT_SUPPPORT_ENH
  2022-06-03  6:58 [PULL 00/12] s390x and misc patches Thomas Huth
@ 2022-06-03  6:58 ` Thomas Huth
  2022-06-03  6:58 ` [PULL 02/12] hw/s390x/s390-virtio-ccw: Improve the machine description string Thomas Huth
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Thomas Huth @ 2022-06-03  6:58 UTC (permalink / raw)
  To: qemu-devel, Richard Henderson; +Cc: qemu-s390x, Dr. David Alan Gilbert

From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>

One less P needed.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20220523115123.150340-1-dgilbert@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 target/s390x/cpu_features_def.h.inc | 2 +-
 target/s390x/gen-features.c         | 6 +++---
 target/s390x/tcg/translate.c        | 8 ++++----
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/target/s390x/cpu_features_def.h.inc b/target/s390x/cpu_features_def.h.inc
index e86662bb3b..3603e5fb12 100644
--- a/target/s390x/cpu_features_def.h.inc
+++ b/target/s390x/cpu_features_def.h.inc
@@ -58,7 +58,7 @@ DEF_FEAT(ENHANCED_MONITOR, "emon", STFL, 36, "Enhanced-monitor facility")
 DEF_FEAT(FLOATING_POINT_EXT, "fpe", STFL, 37, "Floating-point extension facility")
 DEF_FEAT(ORDER_PRESERVING_COMPRESSION, "opc", STFL, 38, "Order Preserving Compression facility")
 DEF_FEAT(SET_PROGRAM_PARAMETERS, "sprogp", STFL, 40, "Set-program-parameters facility")
-DEF_FEAT(FLOATING_POINT_SUPPPORT_ENH, "fpseh", STFL, 41, "Floating-point-support-enhancement facilities")
+DEF_FEAT(FLOATING_POINT_SUPPORT_ENH, "fpseh", STFL, 41, "Floating-point-support-enhancement facilities")
 DEF_FEAT(DFP, "dfp", STFL, 42, "DFP (decimal-floating-point) facility")
 DEF_FEAT(DFP_FAST, "dfphp", STFL, 43, "DFP (decimal-floating-point) facility has high performance")
 DEF_FEAT(PFPO, "pfpo", STFL, 44, "PFPO instruction")
diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c
index c03ec2c9a9..ad140184b9 100644
--- a/target/s390x/gen-features.c
+++ b/target/s390x/gen-features.c
@@ -374,7 +374,7 @@ static uint16_t base_GEN10_GA1[] = {
     S390_FEAT_COMPARE_AND_SWAP_AND_STORE_2,
     S390_FEAT_GENERAL_INSTRUCTIONS_EXT,
     S390_FEAT_EXECUTE_EXT,
-    S390_FEAT_FLOATING_POINT_SUPPPORT_ENH,
+    S390_FEAT_FLOATING_POINT_SUPPORT_ENH,
     S390_FEAT_DFP,
     S390_FEAT_DFP_FAST,
     S390_FEAT_PFPO,
@@ -476,7 +476,7 @@ static uint16_t full_GEN9_GA2[] = {
     S390_FEAT_MOVE_WITH_OPTIONAL_SPEC,
     S390_FEAT_EXTRACT_CPU_TIME,
     S390_FEAT_COMPARE_AND_SWAP_AND_STORE,
-    S390_FEAT_FLOATING_POINT_SUPPPORT_ENH,
+    S390_FEAT_FLOATING_POINT_SUPPORT_ENH,
     S390_FEAT_DFP,
 };
 
@@ -700,7 +700,7 @@ static uint16_t qemu_V3_1[] = {
     S390_FEAT_GENERAL_INSTRUCTIONS_EXT,
     S390_FEAT_EXECUTE_EXT,
     S390_FEAT_SET_PROGRAM_PARAMETERS,
-    S390_FEAT_FLOATING_POINT_SUPPPORT_ENH,
+    S390_FEAT_FLOATING_POINT_SUPPORT_ENH,
     S390_FEAT_STFLE_45,
     S390_FEAT_STFLE_49,
     S390_FEAT_LOCAL_TLB_CLEARING,
diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c
index b40cb84bae..fd2433d625 100644
--- a/target/s390x/tcg/translate.c
+++ b/target/s390x/tcg/translate.c
@@ -6185,17 +6185,17 @@ enum DisasInsnEnum {
 #define FAC_Z           S390_FEAT_ZARCH
 #define FAC_CASS        S390_FEAT_COMPARE_AND_SWAP_AND_STORE
 #define FAC_DFP         S390_FEAT_DFP
-#define FAC_DFPR        S390_FEAT_FLOATING_POINT_SUPPPORT_ENH /* DFP-rounding */
+#define FAC_DFPR        S390_FEAT_FLOATING_POINT_SUPPORT_ENH /* DFP-rounding */
 #define FAC_DO          S390_FEAT_STFLE_45 /* distinct-operands */
 #define FAC_EE          S390_FEAT_EXECUTE_EXT
 #define FAC_EI          S390_FEAT_EXTENDED_IMMEDIATE
 #define FAC_FPE         S390_FEAT_FLOATING_POINT_EXT
-#define FAC_FPSSH       S390_FEAT_FLOATING_POINT_SUPPPORT_ENH /* FPS-sign-handling */
-#define FAC_FPRGR       S390_FEAT_FLOATING_POINT_SUPPPORT_ENH /* FPR-GR-transfer */
+#define FAC_FPSSH       S390_FEAT_FLOATING_POINT_SUPPORT_ENH /* FPS-sign-handling */
+#define FAC_FPRGR       S390_FEAT_FLOATING_POINT_SUPPORT_ENH /* FPR-GR-transfer */
 #define FAC_GIE         S390_FEAT_GENERAL_INSTRUCTIONS_EXT
 #define FAC_HFP_MA      S390_FEAT_HFP_MADDSUB
 #define FAC_HW          S390_FEAT_STFLE_45 /* high-word */
-#define FAC_IEEEE_SIM   S390_FEAT_FLOATING_POINT_SUPPPORT_ENH /* IEEE-exception-simulation */
+#define FAC_IEEEE_SIM   S390_FEAT_FLOATING_POINT_SUPPORT_ENH /* IEEE-exception-simulation */
 #define FAC_MIE         S390_FEAT_STFLE_49 /* misc-instruction-extensions */
 #define FAC_LAT         S390_FEAT_STFLE_49 /* load-and-trap */
 #define FAC_LOC         S390_FEAT_STFLE_45 /* load/store on condition 1 */
-- 
2.31.1



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PULL 02/12] hw/s390x/s390-virtio-ccw: Improve the machine description string
  2022-06-03  6:58 [PULL 00/12] s390x and misc patches Thomas Huth
  2022-06-03  6:58 ` [PULL 01/12] s390: Typo fix FLOATING_POINT_SUPPPORT_ENH Thomas Huth
@ 2022-06-03  6:58 ` Thomas Huth
  2022-06-03  6:58 ` [PULL 03/12] target/s390x: kvm: Honor storage keys during emulation Thomas Huth
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Thomas Huth @ 2022-06-03  6:58 UTC (permalink / raw)
  To: qemu-devel, Richard Henderson; +Cc: qemu-s390x, Cornelia Huck

The machine name already contains the words "ccw" and "virtio", so
using "VirtIO-ccw" in the description likely does not really help
the average user to get an idea what this machine type is about.
Thus let's switch to "Virtual s390x machine" now, since "virtual
machine" should be a familiar term, and "s390x" signals that this
is about 64-bit guests (unlike S390 which could mean that it is
31-bit only).
Also expand "v" to "version", since this makes it easier to use
this macro also with non-numeric machine names in downstream.

Message-Id: <20220506065026.513590-1-thuth@redhat.com>
Acked-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 hw/s390x/s390-virtio-ccw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index 047cca0487..cc3097bfee 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -768,7 +768,7 @@ bool css_migration_enabled(void)
     {                                                                         \
         MachineClass *mc = MACHINE_CLASS(oc);                                 \
         ccw_machine_##suffix##_class_options(mc);                             \
-        mc->desc = "VirtIO-ccw based S390 machine v" verstr;                  \
+        mc->desc = "Virtual s390x machine (version " verstr ")";              \
         if (latest) {                                                         \
             mc->alias = "s390-ccw-virtio";                                    \
             mc->is_default = true;                                            \
-- 
2.31.1



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PULL 03/12] target/s390x: kvm: Honor storage keys during emulation
  2022-06-03  6:58 [PULL 00/12] s390x and misc patches Thomas Huth
  2022-06-03  6:58 ` [PULL 01/12] s390: Typo fix FLOATING_POINT_SUPPPORT_ENH Thomas Huth
  2022-06-03  6:58 ` [PULL 02/12] hw/s390x/s390-virtio-ccw: Improve the machine description string Thomas Huth
@ 2022-06-03  6:58 ` Thomas Huth
  2022-06-03  6:58 ` [PULL 04/12] MAINTAINERS: Update s390 vhost entries Thomas Huth
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Thomas Huth @ 2022-06-03  6:58 UTC (permalink / raw)
  To: qemu-devel, Richard Henderson; +Cc: qemu-s390x, Janis Schoetterl-Glausch

From: Janis Schoetterl-Glausch <scgl@linux.ibm.com>

Storage key controlled protection is currently not honored when
emulating instructions.
If available, enable key protection for the MEM_OP ioctl, thereby
enabling it for the s390_cpu_virt_mem_* functions, when using kvm.
As a result, the emulation of the following instructions honors storage
keys:

* CLP
  	The Synch I/O CLP command would need special handling in order
  	to support storage keys, but is currently not supported.
* CHSC
	Performing commands asynchronously would require special
	handling, but commands are currently always synchronous.
* STSI
* TSCH
	Must (and does) not change channel if terminated due to
	protection.
* MSCH
	Suppressed on protection, works because fetching instruction.
* SSCH
	Suppressed on protection, works because fetching instruction.
* STSCH
* STCRW
	Suppressed on protection, this works because no partial store is
	possible, because the operand cannot span multiple pages.
* PCISTB
* MPCIFC
* STPCIFC

Signed-off-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com>
Message-Id: <20220506153956.2217601-3-scgl@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 target/s390x/kvm/kvm.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/target/s390x/kvm/kvm.c b/target/s390x/kvm/kvm.c
index 53098bf541..7bd8db0e7b 100644
--- a/target/s390x/kvm/kvm.c
+++ b/target/s390x/kvm/kvm.c
@@ -151,12 +151,15 @@ const KVMCapabilityInfo kvm_arch_required_capabilities[] = {
 static int cap_sync_regs;
 static int cap_async_pf;
 static int cap_mem_op;
+static int cap_mem_op_extension;
 static int cap_s390_irq;
 static int cap_ri;
 static int cap_hpage_1m;
 static int cap_vcpu_resets;
 static int cap_protected;
 
+static bool mem_op_storage_key_support;
+
 static int active_cmma;
 
 static int kvm_s390_query_mem_limit(uint64_t *memory_limit)
@@ -354,6 +357,8 @@ int kvm_arch_init(MachineState *ms, KVMState *s)
     cap_sync_regs = kvm_check_extension(s, KVM_CAP_SYNC_REGS);
     cap_async_pf = kvm_check_extension(s, KVM_CAP_ASYNC_PF);
     cap_mem_op = kvm_check_extension(s, KVM_CAP_S390_MEM_OP);
+    cap_mem_op_extension = kvm_check_extension(s, KVM_CAP_S390_MEM_OP_EXTENSION);
+    mem_op_storage_key_support = cap_mem_op_extension > 0;
     cap_s390_irq = kvm_check_extension(s, KVM_CAP_S390_INJECT_IRQ);
     cap_vcpu_resets = kvm_check_extension(s, KVM_CAP_S390_VCPU_RESETS);
     cap_protected = kvm_check_extension(s, KVM_CAP_S390_PROTECTED);
@@ -842,6 +847,7 @@ int kvm_s390_mem_op(S390CPU *cpu, vaddr addr, uint8_t ar, void *hostbuf,
                        : KVM_S390_MEMOP_LOGICAL_READ,
         .buf = (uint64_t)hostbuf,
         .ar = ar,
+        .key = (cpu->env.psw.mask & PSW_MASK_KEY) >> PSW_SHIFT_KEY,
     };
     int ret;
 
@@ -851,6 +857,9 @@ int kvm_s390_mem_op(S390CPU *cpu, vaddr addr, uint8_t ar, void *hostbuf,
     if (!hostbuf) {
         mem_op.flags |= KVM_S390_MEMOP_F_CHECK_ONLY;
     }
+    if (mem_op_storage_key_support) {
+        mem_op.flags |= KVM_S390_MEMOP_F_SKEY_PROTECTION;
+    }
 
     ret = kvm_vcpu_ioctl(CPU(cpu), KVM_S390_MEM_OP, &mem_op);
     if (ret < 0) {
-- 
2.31.1



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PULL 04/12] MAINTAINERS: Update s390 vhost entries
  2022-06-03  6:58 [PULL 00/12] s390x and misc patches Thomas Huth
                   ` (2 preceding siblings ...)
  2022-06-03  6:58 ` [PULL 03/12] target/s390x: kvm: Honor storage keys during emulation Thomas Huth
@ 2022-06-03  6:58 ` Thomas Huth
  2022-06-03  6:58 ` [PULL 05/12] tests/tcg: Test overflow conditions Thomas Huth
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Thomas Huth @ 2022-06-03  6:58 UTC (permalink / raw)
  To: qemu-devel, Richard Henderson; +Cc: qemu-s390x, Eric Farman, Cornelia Huck

From: Eric Farman <farman@linux.ibm.com>

Commit 7a523d96a0 ("virtio-ccw: move vhost_ccw_scsi to a separate file")
introduced a new file hw/s390x/vhost-scsi-ccw.c, which received a
couple comments [1][2] to update MAINTAINERS that were missed.

Fix that by making the vhost CCW entries a wildcard.

[1] https://lore.kernel.org/r/d8d2bbd5021076bdba444d31a6da74f507baede3.camel@linux.ibm.com/
[2] https://lore.kernel.org/r/87k0c4gb9f.fsf@redhat.com/

Signed-off-by: Eric Farman <farman@linux.ibm.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Message-Id: <20220525145814.2750501-1-farman@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 MAINTAINERS | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 00dc4a8ecb..7b7d3f9c02 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2018,8 +2018,7 @@ M: Halil Pasic <pasic@linux.ibm.com>
 M: Eric Farman <farman@linux.ibm.com>
 S: Supported
 F: hw/s390x/virtio-ccw*.[hc]
-F: hw/s390x/vhost-vsock-ccw.c
-F: hw/s390x/vhost-user-fs-ccw.c
+F: hw/s390x/vhost-*-ccw.c
 T: git https://gitlab.com/cohuck/qemu.git s390-next
 T: git https://github.com/borntraeger/qemu.git s390-next
 L: qemu-s390x@nongnu.org
-- 
2.31.1



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PULL 05/12] tests/tcg: Test overflow conditions
  2022-06-03  6:58 [PULL 00/12] s390x and misc patches Thomas Huth
                   ` (3 preceding siblings ...)
  2022-06-03  6:58 ` [PULL 04/12] MAINTAINERS: Update s390 vhost entries Thomas Huth
@ 2022-06-03  6:58 ` Thomas Huth
  2022-06-03  6:58 ` [PULL 06/12] MAINTAINERS: Change my email address Thomas Huth
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Thomas Huth @ 2022-06-03  6:58 UTC (permalink / raw)
  To: qemu-devel, Richard Henderson; +Cc: qemu-s390x, Gautam Agrawal

From: Gautam Agrawal <gautamnagrawal@gmail.com>

Add a test to check for overflow conditions in s390x.
This patch is based on the following patches :
* https://git.qemu.org/?p=qemu.git;a=commitdiff;h=5a2e67a691501
* https://git.qemu.org/?p=qemu.git;a=commitdiff;h=fc6e0d0f2db51

Signed-off-by: Gautam Agrawal <gautamnagrawal@gmail.com>
Message-Id: <20220531183524.40948-1-gautamnagrawal@gmail.com>
[thuth: Move overflow.c to tests/tcg/multiarch/ to make it generic]
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/tcg/multiarch/overflow.c | 58 ++++++++++++++++++++++++++++++++++
 1 file changed, 58 insertions(+)
 create mode 100644 tests/tcg/multiarch/overflow.c

diff --git a/tests/tcg/multiarch/overflow.c b/tests/tcg/multiarch/overflow.c
new file mode 100644
index 0000000000..1c59c2cb70
--- /dev/null
+++ b/tests/tcg/multiarch/overflow.c
@@ -0,0 +1,58 @@
+#include <stdio.h>
+
+int overflow_add_32(int x, int y)
+{
+    int res;
+    return __builtin_add_overflow(x, y, &res);
+}
+
+int overflow_add_64(long long x, long long y)
+{
+    long long res;
+    return __builtin_add_overflow(x, y, &res);
+}
+
+int overflow_sub_32(int x, int y)
+{
+    int res;
+    return __builtin_sub_overflow(x, y, &res);
+}
+
+int overflow_sub_64(long long x, long long y)
+{
+    long long res;
+    return __builtin_sub_overflow(x, y, &res);
+}
+
+int a1_add = -2147483648;
+int b1_add = -2147483648;
+long long a2_add = -9223372036854775808ULL;
+long long b2_add = -9223372036854775808ULL;
+
+int a1_sub;
+int b1_sub = -2147483648;
+long long a2_sub = 0L;
+long long b2_sub = -9223372036854775808ULL;
+
+int main()
+{
+    int ret = 0;
+
+    if (!overflow_add_32(a1_add, b1_add)) {
+        fprintf(stderr, "data overflow while adding 32 bits\n");
+        ret = 1;
+    }
+    if (!overflow_add_64(a2_add, b2_add)) {
+        fprintf(stderr, "data overflow while adding 64 bits\n");
+        ret = 1;
+    }
+    if (!overflow_sub_32(a1_sub, b1_sub)) {
+        fprintf(stderr, "data overflow while subtracting 32 bits\n");
+        ret = 1;
+    }
+    if (!overflow_sub_64(a2_sub, b2_sub)) {
+        fprintf(stderr, "data overflow while subtracting 64 bits\n");
+        ret = 1;
+    }
+    return ret;
+}
-- 
2.31.1



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PULL 06/12] MAINTAINERS: Change my email address
  2022-06-03  6:58 [PULL 00/12] s390x and misc patches Thomas Huth
                   ` (4 preceding siblings ...)
  2022-06-03  6:58 ` [PULL 05/12] tests/tcg: Test overflow conditions Thomas Huth
@ 2022-06-03  6:58 ` Thomas Huth
  2022-06-03  6:59 ` [PULL 07/12] MAINTAINERS: Update maintainers for Guest x86 HAXM CPUs Thomas Huth
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Thomas Huth @ 2022-06-03  6:58 UTC (permalink / raw)
  To: qemu-devel, Richard Henderson
  Cc: qemu-s390x, Hailiang Zhang, Gonglei, Zhang Chen

From: Hailiang Zhang <zhanghailiang@xfusion.com>

The zhang.zhanghailiang@huawei.com email address has been
stopped. Change it to my new email address.

Signed-off-by: Hailiang Zhang <zhanghailiang@xfusion.com>
Message-Id: <20211214075424.6920-1-zhanghailiang@xfusion.com>
Acked-by: Gonglei <arei.gonglei@huawei.com>
Acked-by: Zhang Chen <chen.zhang@intel.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 MAINTAINERS | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 7b7d3f9c02..ee9693dc3a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3102,7 +3102,7 @@ F: include/qemu/yank.h
 F: qapi/yank.json
 
 COLO Framework
-M: zhanghailiang <zhang.zhanghailiang@huawei.com>
+M: Hailiang Zhang <zhanghailiang@xfusion.com>
 S: Maintained
 F: migration/colo*
 F: include/migration/colo.h
-- 
2.31.1



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PULL 07/12] MAINTAINERS: Update maintainers for Guest x86 HAXM CPUs
  2022-06-03  6:58 [PULL 00/12] s390x and misc patches Thomas Huth
                   ` (5 preceding siblings ...)
  2022-06-03  6:58 ` [PULL 06/12] MAINTAINERS: Change my email address Thomas Huth
@ 2022-06-03  6:59 ` Thomas Huth
  2022-06-03  6:59 ` [PULL 08/12] qtest/npcm7xx_pwm-test: Fix memory leak in mft_qom_set Thomas Huth
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Thomas Huth @ 2022-06-03  6:59 UTC (permalink / raw)
  To: qemu-devel, Richard Henderson; +Cc: qemu-s390x, Wenchao Wang, Hang Yuan

From: Wenchao Wang <wenchao.wang@intel.com>

Clean up the maintainer list.

Reviewed-by: Hang Yuan <hang.yuan@intel.com>
Signed-off-by: Wenchao Wang <wenchao.wang@intel.com>
Message-Id: <DM6PR11MB4090A58ACCA4AD8C752AEEA587199@DM6PR11MB4090.namprd11.prod.outlook.com>
[thuth: Note: Colin Xu's address bounces]
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 MAINTAINERS | 1 -
 1 file changed, 1 deletion(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index ee9693dc3a..5fe8f7eca2 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -488,7 +488,6 @@ Guest CPU Cores (HAXM)
 ---------------------
 X86 HAXM CPUs
 M: Wenchao Wang <wenchao.wang@intel.com>
-M: Colin Xu <colin.xu@intel.com>
 L: haxm-team@intel.com
 W: https://github.com/intel/haxm/issues
 S: Maintained
-- 
2.31.1



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PULL 08/12] qtest/npcm7xx_pwm-test: Fix memory leak in mft_qom_set
  2022-06-03  6:58 [PULL 00/12] s390x and misc patches Thomas Huth
                   ` (6 preceding siblings ...)
  2022-06-03  6:59 ` [PULL 07/12] MAINTAINERS: Update maintainers for Guest x86 HAXM CPUs Thomas Huth
@ 2022-06-03  6:59 ` Thomas Huth
  2022-06-03  6:59 ` [PULL 09/12] tests/qtest: use g_autofree for test_server_create_chr Thomas Huth
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Thomas Huth @ 2022-06-03  6:59 UTC (permalink / raw)
  To: qemu-devel, Richard Henderson; +Cc: qemu-s390x, Miaoqian Lin, Hao Wu

From: Miaoqian Lin <linmq006@gmail.com>

g_strdup_printf() allocated memory for path, we should free it with
g_free() when no longer needed.

Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Reviewed-by: Hao Wu <wuhaotsh@google.com>
Message-Id: <20220531080921.4704-1-linmq006@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/qtest/npcm7xx_pwm-test.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/qtest/npcm7xx_pwm-test.c b/tests/qtest/npcm7xx_pwm-test.c
index c4a5fdcacd..e320a625c4 100644
--- a/tests/qtest/npcm7xx_pwm-test.c
+++ b/tests/qtest/npcm7xx_pwm-test.c
@@ -268,6 +268,9 @@ static void mft_qom_set(QTestState *qts, int index, const char *name,
             path, name, value);
     /* The qom set message returns successfully. */
     g_assert_true(qdict_haskey(response, "return"));
+
+    qobject_unref(response);
+    g_free(path);
 }
 
 static uint32_t get_pll(uint32_t con)
-- 
2.31.1



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PULL 09/12] tests/qtest: use g_autofree for test_server_create_chr
  2022-06-03  6:58 [PULL 00/12] s390x and misc patches Thomas Huth
                   ` (7 preceding siblings ...)
  2022-06-03  6:59 ` [PULL 08/12] qtest/npcm7xx_pwm-test: Fix memory leak in mft_qom_set Thomas Huth
@ 2022-06-03  6:59 ` Thomas Huth
  2022-06-03  6:59 ` [PULL 10/12] ui: Remove deprecated parameters of the "-display sdl" option Thomas Huth
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Thomas Huth @ 2022-06-03  6:59 UTC (permalink / raw)
  To: qemu-devel, Richard Henderson; +Cc: qemu-s390x, Alex Bennée

From: Alex Bennée <alex.bennee@linaro.org>

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20220524154056.2896913-12-alex.bennee@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/qtest/vhost-user-test.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/tests/qtest/vhost-user-test.c b/tests/qtest/vhost-user-test.c
index a2cec87684..8bf390be20 100644
--- a/tests/qtest/vhost-user-test.c
+++ b/tests/qtest/vhost-user-test.c
@@ -524,14 +524,13 @@ static void chr_event(void *opaque, QEMUChrEvent event)
 
 static void test_server_create_chr(TestServer *server, const gchar *opt)
 {
-    gchar *chr_path;
+    g_autofree gchar *chr_path = g_strdup_printf("unix:%s%s",
+                                                 server->socket_path, opt);
     Chardev *chr;
 
-    chr_path = g_strdup_printf("unix:%s%s", server->socket_path, opt);
     chr = qemu_chr_new(server->chr_name, chr_path, server->context);
-    g_free(chr_path);
+    g_assert(chr);
 
-    g_assert_nonnull(chr);
     qemu_chr_fe_init(&server->chr, chr, &error_abort);
     qemu_chr_fe_set_handlers(&server->chr, chr_can_read, chr_read,
                              chr_event, NULL, server, server->context, true);
-- 
2.31.1



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PULL 10/12] ui: Remove deprecated parameters of the "-display sdl" option
  2022-06-03  6:58 [PULL 00/12] s390x and misc patches Thomas Huth
                   ` (8 preceding siblings ...)
  2022-06-03  6:59 ` [PULL 09/12] tests/qtest: use g_autofree for test_server_create_chr Thomas Huth
@ 2022-06-03  6:59 ` Thomas Huth
  2022-06-03  6:59 ` [PULL 11/12] ui: Switch "-display sdl" to use the QAPI parser Thomas Huth
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Thomas Huth @ 2022-06-03  6:59 UTC (permalink / raw)
  To: qemu-devel, Richard Henderson
  Cc: qemu-s390x, Daniel P . Berrangé, Markus Armbruster

Dropping these deprecated parameters simplifies further refactoring
(e.g. QAPIfication is easier without underscores in the name).

Message-Id: <20220519155625.1414365-2-thuth@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 docs/about/deprecated.rst       | 16 -------------
 docs/about/removed-features.rst | 17 ++++++++++++++
 softmmu/vl.c                    | 41 +--------------------------------
 qemu-options.hx                 | 32 ++-----------------------
 4 files changed, 20 insertions(+), 86 deletions(-)

diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst
index a92ae0f162..562a133f18 100644
--- a/docs/about/deprecated.rst
+++ b/docs/about/deprecated.rst
@@ -81,22 +81,6 @@ the process listing. This is replaced by the new ``password-secret``
 option which lets the password be securely provided on the command
 line using a ``secret`` object instance.
 
-``-display sdl,window_close=...`` (since 6.1)
-'''''''''''''''''''''''''''''''''''''''''''''
-
-Use ``-display sdl,window-close=...`` instead (i.e. with a minus instead of
-an underscore between "window" and "close").
-
-``-alt-grab`` and ``-display sdl,alt_grab=on`` (since 6.2)
-''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
-
-Use ``-display sdl,grab-mod=lshift-lctrl-lalt`` instead.
-
-``-ctrl-grab`` and ``-display sdl,ctrl_grab=on`` (since 6.2)
-''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
-
-Use ``-display sdl,grab-mod=rctrl`` instead.
-
 ``-sdl`` (since 6.2)
 ''''''''''''''''''''
 
diff --git a/docs/about/removed-features.rst b/docs/about/removed-features.rst
index eb76974347..4c9e001c35 100644
--- a/docs/about/removed-features.rst
+++ b/docs/about/removed-features.rst
@@ -370,6 +370,23 @@ The ``opened=on`` option in the command line or QMP ``object-add`` either had
 no effect (if ``opened`` was the last option) or caused errors.  The property
 is therefore useless and should simply be removed.
 
+``-display sdl,window_close=...`` (removed in 7.1)
+''''''''''''''''''''''''''''''''''''''''''''''''''
+
+Use ``-display sdl,window-close=...`` instead (i.e. with a minus instead of
+an underscore between "window" and "close").
+
+``-alt-grab`` and ``-display sdl,alt_grab=on`` (removed in 7.1)
+'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
+
+Use ``-display sdl,grab-mod=lshift-lctrl-lalt`` instead.
+
+``-ctrl-grab`` and ``-display sdl,ctrl_grab=on`` (removed in 7.1)
+'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
+
+Use ``-display sdl,grab-mod=rctrl`` instead.
+
+
 QEMU Machine Protocol (QMP) commands
 ------------------------------------
 
diff --git a/softmmu/vl.c b/softmmu/vl.c
index 84a31eba76..57ab9d5322 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -1079,32 +1079,7 @@ static void parse_display(const char *p)
                 } else {
                     goto invalid_sdl_args;
                 }
-            } else if (strstart(opts, ",alt_grab=", &nextopt)) {
-                opts = nextopt;
-                if (strstart(opts, "on", &nextopt)) {
-                    alt_grab = 1;
-                } else if (strstart(opts, "off", &nextopt)) {
-                    alt_grab = 0;
-                } else {
-                    goto invalid_sdl_args;
-                }
-                warn_report("alt_grab is deprecated, use grab-mod instead.");
-            } else if (strstart(opts, ",ctrl_grab=", &nextopt)) {
-                opts = nextopt;
-                if (strstart(opts, "on", &nextopt)) {
-                    ctrl_grab = 1;
-                } else if (strstart(opts, "off", &nextopt)) {
-                    ctrl_grab = 0;
-                } else {
-                    goto invalid_sdl_args;
-                }
-                warn_report("ctrl_grab is deprecated, use grab-mod instead.");
-            } else if (strstart(opts, ",window_close=", &nextopt) ||
-                       strstart(opts, ",window-close=", &nextopt)) {
-                if (strstart(opts, ",window_close=", NULL)) {
-                    warn_report("window_close with an underscore is deprecated,"
-                                " please use window-close instead.");
-                }
+            } else if (strstart(opts, ",window-close=", &nextopt)) {
                 opts = nextopt;
                 dpy.has_window_close = true;
                 if (strstart(opts, "on", &nextopt)) {
@@ -1962,10 +1937,6 @@ static void qemu_create_early_backends(void)
     const bool use_gtk = false;
 #endif
 
-    if ((alt_grab || ctrl_grab) && !use_sdl) {
-        error_report("-alt-grab and -ctrl-grab are only valid "
-                     "for SDL, ignoring option");
-    }
     if (dpy.has_window_close && !use_gtk && !use_sdl) {
         error_report("window-close is only valid for GTK and SDL, "
                      "ignoring option");
@@ -3273,16 +3244,6 @@ void qemu_init(int argc, char **argv, char **envp)
                 dpy.has_full_screen = true;
                 dpy.full_screen = true;
                 break;
-            case QEMU_OPTION_alt_grab:
-                alt_grab = 1;
-                warn_report("-alt-grab is deprecated, please use "
-                            "-display sdl,grab-mod=lshift-lctrl-lalt instead.");
-                break;
-            case QEMU_OPTION_ctrl_grab:
-                ctrl_grab = 1;
-                warn_report("-ctrl-grab is deprecated, please use "
-                            "-display sdl,grab-mod=rctrl instead.");
-                break;
             case QEMU_OPTION_sdl:
                 warn_report("-sdl is deprecated, use -display sdl instead.");
 #ifdef CONFIG_SDL
diff --git a/qemu-options.hx b/qemu-options.hx
index a664baaa18..726e437a97 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -1938,8 +1938,8 @@ DEF("display", HAS_ARG, QEMU_OPTION_display,
     "-display spice-app[,gl=on|off]\n"
 #endif
 #if defined(CONFIG_SDL)
-    "-display sdl[,alt_grab=on|off][,ctrl_grab=on|off][,gl=on|core|es|off]\n"
-    "            [,grab-mod=<mod>][,show-cursor=on|off][,window-close=on|off]\n"
+    "-display sdl[,gl=on|core|es|off][,grab-mod=<mod>][,show-cursor=on|off]\n"
+    "            [,window-close=on|off]\n"
 #endif
 #if defined(CONFIG_GTK)
     "-display gtk[,full-screen=on|off][,gl=on|off][,grab-on-hover=on|off]\n"
@@ -2012,12 +2012,6 @@ SRST
         the mouse grabbing in conjunction with the "g" key. ``<mods>`` can be
         either ``lshift-lctrl-lalt`` or ``rctrl``.
 
-        ``alt_grab=on|off`` : Use Control+Alt+Shift-g to toggle mouse grabbing.
-        This parameter is deprecated - use ``grab-mod`` instead.
-
-        ``ctrl_grab=on|off`` : Use Right-Control-g to toggle mouse grabbing.
-        This parameter is deprecated - use ``grab-mod`` instead.
-
         ``gl=on|off|core|es`` : Use OpenGL for displaying
 
         ``show-cursor=on|off`` :  Force showing the mouse cursor
@@ -2103,28 +2097,6 @@ SRST
     is displayed in graphical mode.
 ERST
 
-DEF("alt-grab", 0, QEMU_OPTION_alt_grab,
-    "-alt-grab       use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt)\n",
-    QEMU_ARCH_ALL)
-SRST
-``-alt-grab``
-    Use Ctrl-Alt-Shift to grab mouse (instead of Ctrl-Alt). Note that
-    this also affects the special keys (for fullscreen, monitor-mode
-    switching, etc). This option is deprecated - please use
-    ``-display sdl,grab-mod=lshift-lctrl-lalt`` instead.
-ERST
-
-DEF("ctrl-grab", 0, QEMU_OPTION_ctrl_grab,
-    "-ctrl-grab      use Right-Ctrl to grab mouse (instead of Ctrl-Alt)\n",
-    QEMU_ARCH_ALL)
-SRST
-``-ctrl-grab``
-    Use Right-Ctrl to grab mouse (instead of Ctrl-Alt). Note that this
-    also affects the special keys (for fullscreen, monitor-mode
-    switching, etc). This option is deprecated - please use
-    ``-display sdl,grab-mod=rctrl`` instead.
-ERST
-
 DEF("sdl", 0, QEMU_OPTION_sdl,
     "-sdl            shorthand for -display sdl\n", QEMU_ARCH_ALL)
 SRST
-- 
2.31.1



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PULL 11/12] ui: Switch "-display sdl" to use the QAPI parser
  2022-06-03  6:58 [PULL 00/12] s390x and misc patches Thomas Huth
                   ` (9 preceding siblings ...)
  2022-06-03  6:59 ` [PULL 10/12] ui: Remove deprecated parameters of the "-display sdl" option Thomas Huth
@ 2022-06-03  6:59 ` Thomas Huth
  2022-06-03  6:59 ` [PULL 12/12] ui: Remove deprecated options "-sdl" and "-curses" Thomas Huth
  2022-06-03 15:16 ` [PULL 00/12] s390x and misc patches Richard Henderson
  12 siblings, 0 replies; 14+ messages in thread
From: Thomas Huth @ 2022-06-03  6:59 UTC (permalink / raw)
  To: qemu-devel, Richard Henderson; +Cc: qemu-s390x, Markus Armbruster

The "-display sdl" option still uses a hand-crafted parser for its
parameters since we didn't want to drag an interface we considered
somewhat flawed into the QAPI schema. Since the flaws are gone now,
it's time to QAPIfy.

This introduces the new "DisplaySDL" QAPI struct that is used to hold
the parameters that are unique to the SDL display. The only specific
parameter is currently "grab-mod" that is used to specify the required
modifier keys to escape from the mouse grabbing mode.

Message-Id: <20220519155625.1414365-3-thuth@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 qapi/ui.json            | 26 ++++++++++++++-
 include/sysemu/sysemu.h |  2 --
 softmmu/globals.c       |  2 --
 softmmu/vl.c            | 70 +----------------------------------------
 ui/sdl2.c               | 10 ++++++
 5 files changed, 36 insertions(+), 74 deletions(-)

diff --git a/qapi/ui.json b/qapi/ui.json
index 11a827d10f..413371d5e8 100644
--- a/qapi/ui.json
+++ b/qapi/ui.json
@@ -1295,6 +1295,29 @@
       '*swap-opt-cmd': 'bool'
   } }
 
+##
+# @HotKeyMod:
+#
+# Set of modifier keys that need to be held for shortcut key actions.
+#
+# Since: 7.1
+##
+{ 'enum'  : 'HotKeyMod',
+  'data'  : [ 'lctrl-lalt', 'lshift-lctrl-lalt', 'rctrl' ] }
+
+##
+# @DisplaySDL:
+#
+# SDL2 display options.
+#
+# @grab-mod:  Modifier keys that should be pressed together with the
+#             "G" key to release the mouse grab.
+#
+# Since: 7.1
+##
+{ 'struct'  : 'DisplaySDL',
+  'data'    : { '*grab-mod'   : 'HotKeyMod' } }
+
 ##
 # @DisplayType:
 #
@@ -1374,7 +1397,8 @@
       'curses': { 'type': 'DisplayCurses', 'if': 'CONFIG_CURSES' },
       'egl-headless': { 'type': 'DisplayEGLHeadless',
                         'if': { 'all': ['CONFIG_OPENGL', 'CONFIG_GBM'] } },
-      'dbus': { 'type': 'DisplayDBus', 'if': 'CONFIG_DBUS_DISPLAY' }
+      'dbus': { 'type': 'DisplayDBus', 'if': 'CONFIG_DBUS_DISPLAY' },
+      'sdl': { 'type': 'DisplaySDL', 'if': 'CONFIG_SDL' }
   }
 }
 
diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
index b4030acd74..812f66a31a 100644
--- a/include/sysemu/sysemu.h
+++ b/include/sysemu/sysemu.h
@@ -42,8 +42,6 @@ extern int graphic_depth;
 extern int display_opengl;
 extern const char *keyboard_layout;
 extern int win2k_install_hack;
-extern int alt_grab;
-extern int ctrl_grab;
 extern int graphic_rotate;
 extern int old_param;
 extern uint8_t *boot_splash_filedata;
diff --git a/softmmu/globals.c b/softmmu/globals.c
index 916bc12e2b..527edbefdd 100644
--- a/softmmu/globals.c
+++ b/softmmu/globals.c
@@ -50,8 +50,6 @@ QEMUOptionRom option_rom[MAX_OPTION_ROMS];
 int nb_option_roms;
 int old_param;
 const char *qemu_name;
-int alt_grab;
-int ctrl_grab;
 unsigned int nb_prom_envs;
 const char *prom_envs[MAX_PROM_ENVS];
 uint8_t *boot_splash_filedata;
diff --git a/softmmu/vl.c b/softmmu/vl.c
index 57ab9d5322..484e9d9921 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -1056,75 +1056,7 @@ static void parse_display(const char *p)
         exit(0);
     }
 
-    if (strstart(p, "sdl", &opts)) {
-        /*
-         * sdl DisplayType needs hand-crafted parser instead of
-         * parse_display_qapi() due to some options not in
-         * DisplayOptions, specifically:
-         *   - ctrl_grab + alt_grab
-         *     They can't be moved into the QAPI since they use underscores,
-         *     thus they will get replaced by "grab-mod" in the long term
-         */
-#if defined(CONFIG_SDL)
-        dpy.type = DISPLAY_TYPE_SDL;
-        while (*opts) {
-            const char *nextopt;
-
-            if (strstart(opts, ",grab-mod=", &nextopt)) {
-                opts = nextopt;
-                if (strstart(opts, "lshift-lctrl-lalt", &nextopt)) {
-                    alt_grab = 1;
-                } else if (strstart(opts, "rctrl", &nextopt)) {
-                    ctrl_grab = 1;
-                } else {
-                    goto invalid_sdl_args;
-                }
-            } else if (strstart(opts, ",window-close=", &nextopt)) {
-                opts = nextopt;
-                dpy.has_window_close = true;
-                if (strstart(opts, "on", &nextopt)) {
-                    dpy.window_close = true;
-                } else if (strstart(opts, "off", &nextopt)) {
-                    dpy.window_close = false;
-                } else {
-                    goto invalid_sdl_args;
-                }
-            } else if (strstart(opts, ",show-cursor=", &nextopt)) {
-                opts = nextopt;
-                dpy.has_show_cursor = true;
-                if (strstart(opts, "on", &nextopt)) {
-                    dpy.show_cursor = true;
-                } else if (strstart(opts, "off", &nextopt)) {
-                    dpy.show_cursor = false;
-                } else {
-                    goto invalid_sdl_args;
-                }
-            } else if (strstart(opts, ",gl=", &nextopt)) {
-                opts = nextopt;
-                dpy.has_gl = true;
-                if (strstart(opts, "on", &nextopt)) {
-                    dpy.gl = DISPLAYGL_MODE_ON;
-                } else if (strstart(opts, "core", &nextopt)) {
-                    dpy.gl = DISPLAYGL_MODE_CORE;
-                } else if (strstart(opts, "es", &nextopt)) {
-                    dpy.gl = DISPLAYGL_MODE_ES;
-                } else if (strstart(opts, "off", &nextopt)) {
-                    dpy.gl = DISPLAYGL_MODE_OFF;
-                } else {
-                    goto invalid_sdl_args;
-                }
-            } else {
-            invalid_sdl_args:
-                error_report("invalid SDL option string");
-                exit(1);
-            }
-            opts = nextopt;
-        }
-#else
-        error_report("SDL display supported is not available in this binary");
-        exit(1);
-#endif
-    } else if (strstart(p, "vnc", &opts)) {
+    if (strstart(p, "vnc", &opts)) {
         /*
          * vnc isn't a (local) DisplayType but a protocol for remote
          * display access.
diff --git a/ui/sdl2.c b/ui/sdl2.c
index d3741f9b75..8cb77416af 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -40,6 +40,8 @@ static struct sdl2_console *sdl2_console;
 
 static SDL_Surface *guest_sprite_surface;
 static int gui_grab; /* if true, all keyboard/mouse events are grabbed */
+static bool alt_grab;
+static bool ctrl_grab;
 
 static int gui_saved_grab;
 static int gui_fullscreen;
@@ -853,6 +855,14 @@ static void sdl2_display_init(DisplayState *ds, DisplayOptions *o)
 
     gui_fullscreen = o->has_full_screen && o->full_screen;
 
+    if (o->u.sdl.has_grab_mod) {
+        if (o->u.sdl.grab_mod == HOT_KEY_MOD_LSHIFT_LCTRL_LALT) {
+            alt_grab = true;
+        } else if (o->u.sdl.grab_mod == HOT_KEY_MOD_RCTRL) {
+            ctrl_grab = true;
+        }
+    }
+
     for (i = 0;; i++) {
         QemuConsole *con = qemu_console_lookup_by_index(i);
         if (!con) {
-- 
2.31.1



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PULL 12/12] ui: Remove deprecated options "-sdl" and "-curses"
  2022-06-03  6:58 [PULL 00/12] s390x and misc patches Thomas Huth
                   ` (10 preceding siblings ...)
  2022-06-03  6:59 ` [PULL 11/12] ui: Switch "-display sdl" to use the QAPI parser Thomas Huth
@ 2022-06-03  6:59 ` Thomas Huth
  2022-06-03 15:16 ` [PULL 00/12] s390x and misc patches Richard Henderson
  12 siblings, 0 replies; 14+ messages in thread
From: Thomas Huth @ 2022-06-03  6:59 UTC (permalink / raw)
  To: qemu-devel, Richard Henderson; +Cc: qemu-s390x, Daniel P . Berrangé

We have "-sdl" and "-curses", but no "-gtk" and no "-cocoa" ...
these old-style options are rather confusing than helpful nowadays.
Now that the deprecation period is over, let's remove them, so we
get a cleaner interface (where "-display" is the only way to select
the user interface).

Message-Id: <20220519155625.1414365-4-thuth@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 docs/about/deprecated.rst       | 10 ----------
 docs/about/removed-features.rst | 10 ++++++++++
 softmmu/vl.c                    | 19 -------------------
 qemu-options.hx                 | 24 ++----------------------
 4 files changed, 12 insertions(+), 51 deletions(-)

diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst
index 562a133f18..e19bcba242 100644
--- a/docs/about/deprecated.rst
+++ b/docs/about/deprecated.rst
@@ -81,16 +81,6 @@ the process listing. This is replaced by the new ``password-secret``
 option which lets the password be securely provided on the command
 line using a ``secret`` object instance.
 
-``-sdl`` (since 6.2)
-''''''''''''''''''''
-
-Use ``-display sdl`` instead.
-
-``-curses`` (since 6.2)
-'''''''''''''''''''''''
-
-Use ``-display curses`` instead.
-
 ``-watchdog`` (since 6.2)
 '''''''''''''''''''''''''
 
diff --git a/docs/about/removed-features.rst b/docs/about/removed-features.rst
index 4c9e001c35..c7b9dadd5d 100644
--- a/docs/about/removed-features.rst
+++ b/docs/about/removed-features.rst
@@ -386,6 +386,16 @@ Use ``-display sdl,grab-mod=lshift-lctrl-lalt`` instead.
 
 Use ``-display sdl,grab-mod=rctrl`` instead.
 
+``-sdl`` (removed in 7.1)
+'''''''''''''''''''''''''
+
+Use ``-display sdl`` instead.
+
+``-curses`` (removed in 7.1)
+''''''''''''''''''''''''''''
+
+Use ``-display curses`` instead.
+
 
 QEMU Machine Protocol (QMP) commands
 ------------------------------------
diff --git a/softmmu/vl.c b/softmmu/vl.c
index 484e9d9921..4c1e94b00e 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -2800,16 +2800,6 @@ void qemu_init(int argc, char **argv, char **envp)
                 nographic = true;
                 dpy.type = DISPLAY_TYPE_NONE;
                 break;
-            case QEMU_OPTION_curses:
-                warn_report("-curses is deprecated, "
-                            "use -display curses instead.");
-#ifdef CONFIG_CURSES
-                dpy.type = DISPLAY_TYPE_CURSES;
-#else
-                error_report("curses or iconv support is disabled");
-                exit(1);
-#endif
-                break;
             case QEMU_OPTION_portrait:
                 graphic_rotate = 90;
                 break;
@@ -3176,15 +3166,6 @@ void qemu_init(int argc, char **argv, char **envp)
                 dpy.has_full_screen = true;
                 dpy.full_screen = true;
                 break;
-            case QEMU_OPTION_sdl:
-                warn_report("-sdl is deprecated, use -display sdl instead.");
-#ifdef CONFIG_SDL
-                dpy.type = DISPLAY_TYPE_SDL;
-                break;
-#else
-                error_report("SDL support is disabled");
-                exit(1);
-#endif
             case QEMU_OPTION_pidfile:
                 pid_file = optarg;
                 break;
diff --git a/qemu-options.hx b/qemu-options.hx
index 726e437a97..60cf188da4 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -1981,9 +1981,8 @@ DEF("display", HAS_ARG, QEMU_OPTION_display,
     , QEMU_ARCH_ALL)
 SRST
 ``-display type``
-    Select type of display to use. This option is a replacement for the
-    old style -sdl/-curses/... options. Use ``-display help`` to list
-    the available display types. Valid values for type are
+    Select type of display to use. Use ``-display help`` to list the available
+    display types. Valid values for type are
 
     ``spice-app[,gl=on|off]``
         Start QEMU as a Spice server and launch the default Spice client
@@ -2085,25 +2084,6 @@ SRST
     Use C-a h for help on switching between the console and monitor.
 ERST
 
-DEF("curses", 0, QEMU_OPTION_curses,
-    "-curses         shorthand for -display curses\n",
-    QEMU_ARCH_ALL)
-SRST
-``-curses``
-    Normally, if QEMU is compiled with graphical window support, it
-    displays output such as guest graphics, guest console, and the QEMU
-    monitor in a window. With this option, QEMU can display the VGA
-    output when in text mode using a curses/ncurses interface. Nothing
-    is displayed in graphical mode.
-ERST
-
-DEF("sdl", 0, QEMU_OPTION_sdl,
-    "-sdl            shorthand for -display sdl\n", QEMU_ARCH_ALL)
-SRST
-``-sdl``
-    Enable SDL.
-ERST
-
 #ifdef CONFIG_SPICE
 DEF("spice", HAS_ARG, QEMU_OPTION_spice,
     "-spice [port=port][,tls-port=secured-port][,x509-dir=<dir>]\n"
-- 
2.31.1



^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PULL 00/12] s390x and misc patches
  2022-06-03  6:58 [PULL 00/12] s390x and misc patches Thomas Huth
                   ` (11 preceding siblings ...)
  2022-06-03  6:59 ` [PULL 12/12] ui: Remove deprecated options "-sdl" and "-curses" Thomas Huth
@ 2022-06-03 15:16 ` Richard Henderson
  12 siblings, 0 replies; 14+ messages in thread
From: Richard Henderson @ 2022-06-03 15:16 UTC (permalink / raw)
  To: Thomas Huth, qemu-devel; +Cc: qemu-s390x

On 6/2/22 23:58, Thomas Huth wrote:
> The following changes since commit 1e62a82574fc28e64deca589a23cf55ada2e1a7d:
> 
>    Merge tag 'm68k-for-7.1-pull-request' of https://github.com/vivier/qemu-m68k into staging (2022-06-02 06:30:24 -0700)
> 
> are available in the Git repository at:
> 
>    https://gitlab.com/thuth/qemu.git tags/pull-request-2022-06-03
> 
> for you to fetch changes up to 707d93d4abc6485c638e2aecd93fbd904f2f6b3e:
> 
>    ui: Remove deprecated options "-sdl" and "-curses" (2022-06-03 08:03:28 +0200)
> 
> ----------------------------------------------------------------
> * s390x storage key improvements for KVM
> * Some cosmetics for s390x
> * Update MAINTAINERS entries
> * Improve some spots wrt memory handling in the qtests
> * Clean up the "-display sdl" parameter parsing

Applied, thanks.  Please update https://wiki.qemu.org/ChangeLog/7.1 as appropriate.


r~


> 
> ----------------------------------------------------------------
> Alex Bennée (1):
>        tests/qtest: use g_autofree for test_server_create_chr
> 
> Dr. David Alan Gilbert (1):
>        s390: Typo fix FLOATING_POINT_SUPPPORT_ENH
> 
> Eric Farman (1):
>        MAINTAINERS: Update s390 vhost entries
> 
> Gautam Agrawal (1):
>        tests/tcg: Test overflow conditions
> 
> Hailiang Zhang (1):
>        MAINTAINERS: Change my email address
> 
> Janis Schoetterl-Glausch (1):
>        target/s390x: kvm: Honor storage keys during emulation
> 
> Miaoqian Lin (1):
>        qtest/npcm7xx_pwm-test: Fix memory leak in mft_qom_set
> 
> Thomas Huth (4):
>        hw/s390x/s390-virtio-ccw: Improve the machine description string
>        ui: Remove deprecated parameters of the "-display sdl" option
>        ui: Switch "-display sdl" to use the QAPI parser
>        ui: Remove deprecated options "-sdl" and "-curses"
> 
> Wenchao Wang (1):
>        MAINTAINERS: Update maintainers for Guest x86 HAXM CPUs
> 
>   docs/about/deprecated.rst           |  26 --------
>   docs/about/removed-features.rst     |  27 ++++++++
>   qapi/ui.json                        |  26 +++++++-
>   include/sysemu/sysemu.h             |   2 -
>   target/s390x/cpu_features_def.h.inc |   2 +-
>   hw/s390x/s390-virtio-ccw.c          |   2 +-
>   softmmu/globals.c                   |   2 -
>   softmmu/vl.c                        | 128 +-----------------------------------
>   target/s390x/gen-features.c         |   6 +-
>   target/s390x/kvm/kvm.c              |   9 +++
>   target/s390x/tcg/translate.c        |   8 +--
>   tests/qtest/npcm7xx_pwm-test.c      |   3 +
>   tests/qtest/vhost-user-test.c       |   7 +-
>   tests/tcg/multiarch/overflow.c      |  58 ++++++++++++++++
>   ui/sdl2.c                           |  10 +++
>   MAINTAINERS                         |   6 +-
>   qemu-options.hx                     |  56 ++--------------
>   17 files changed, 151 insertions(+), 227 deletions(-)
>   create mode 100644 tests/tcg/multiarch/overflow.c
> 



^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2022-06-03 15:17 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-03  6:58 [PULL 00/12] s390x and misc patches Thomas Huth
2022-06-03  6:58 ` [PULL 01/12] s390: Typo fix FLOATING_POINT_SUPPPORT_ENH Thomas Huth
2022-06-03  6:58 ` [PULL 02/12] hw/s390x/s390-virtio-ccw: Improve the machine description string Thomas Huth
2022-06-03  6:58 ` [PULL 03/12] target/s390x: kvm: Honor storage keys during emulation Thomas Huth
2022-06-03  6:58 ` [PULL 04/12] MAINTAINERS: Update s390 vhost entries Thomas Huth
2022-06-03  6:58 ` [PULL 05/12] tests/tcg: Test overflow conditions Thomas Huth
2022-06-03  6:58 ` [PULL 06/12] MAINTAINERS: Change my email address Thomas Huth
2022-06-03  6:59 ` [PULL 07/12] MAINTAINERS: Update maintainers for Guest x86 HAXM CPUs Thomas Huth
2022-06-03  6:59 ` [PULL 08/12] qtest/npcm7xx_pwm-test: Fix memory leak in mft_qom_set Thomas Huth
2022-06-03  6:59 ` [PULL 09/12] tests/qtest: use g_autofree for test_server_create_chr Thomas Huth
2022-06-03  6:59 ` [PULL 10/12] ui: Remove deprecated parameters of the "-display sdl" option Thomas Huth
2022-06-03  6:59 ` [PULL 11/12] ui: Switch "-display sdl" to use the QAPI parser Thomas Huth
2022-06-03  6:59 ` [PULL 12/12] ui: Remove deprecated options "-sdl" and "-curses" Thomas Huth
2022-06-03 15:16 ` [PULL 00/12] s390x and misc patches Richard Henderson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.