From nobody Sun Apr 28 04:02:08 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1552292790720408.7480578336988; Mon, 11 Mar 2019 01:26:30 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ADB5830821FF; Mon, 11 Mar 2019 08:26:28 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 72C1E5D70E; Mon, 11 Mar 2019 08:26:28 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id B0826181A136; Mon, 11 Mar 2019 08:26:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x2B8QPFO027363 for ; Mon, 11 Mar 2019 04:26:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2403617536; Mon, 11 Mar 2019 08:26:25 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-211.ams2.redhat.com [10.36.116.211]) by smtp.corp.redhat.com (Postfix) with ESMTP id B0C795C658; Mon, 11 Mar 2019 08:26:20 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 8C9A017475; Mon, 11 Mar 2019 09:26:19 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 11 Mar 2019 09:26:15 +0100 Message-Id: <20190311082619.17966-2-kraxel@redhat.com> In-Reply-To: <20190311082619.17966-1-kraxel@redhat.com> References: <20190311082619.17966-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: libvir-list@redhat.com, "Dr. David Alan Gilbert" , Samuel Thibault , Gerd Hoffmann Subject: [libvirt] [PULL 1/5] Reduce curses escdelay from 1s to 25ms X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Mon, 11 Mar 2019 08:26:29 +0000 (UTC) Content-Type: text/plain; charset="utf-8" From: Samuel Thibault By default, curses will only report single ESC key event after 1s delay, since ESC is also used for keypad escape sequences. This however makes users believe that ESC is not working. Reducing to 25ms provides good user experience, while still allowing 25ms for keypad sequences to get in, which should be enough. Signed-off-by: Samuel Thibault Message-Id: <20190303172557.17139-1-samuel.thibault@ens-lyon.org> Signed-off-by: Gerd Hoffmann --- ui/curses.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/curses.c b/ui/curses.c index 6e0091c3b286..870273de51a9 100644 --- a/ui/curses.c +++ b/ui/curses.c @@ -231,7 +231,7 @@ static void curses_refresh(DisplayChangeListener *dcl) keycode =3D curses2keycode[chr]; keycode_alt =3D 0; =20 - /* alt key */ + /* alt or esc key */ if (keycode =3D=3D 1) { int nextchr =3D getch(); =20 @@ -361,6 +361,7 @@ static void curses_setup(void) initscr(); noecho(); intrflush(stdscr, FALSE); nodelay(stdscr, TRUE); nonl(); keypad(stdscr, TRUE); start_color(); raw(); scrollok(stdscr, FALSE); + set_escdelay(25); =20 /* Make color pair to match color format (3bits bg:3bits fg) */ for (i =3D 0; i < 64; i++) { --=20 2.18.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 04:02:08 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1552292790733135.858074691026; Mon, 11 Mar 2019 01:26:30 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D16D63092641; Mon, 11 Mar 2019 08:26:28 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9E71D6013A; Mon, 11 Mar 2019 08:26:28 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 64953181A137; Mon, 11 Mar 2019 08:26:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x2B8QPMH027373 for ; Mon, 11 Mar 2019 04:26:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id A20625C658; Mon, 11 Mar 2019 08:26:25 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-211.ams2.redhat.com [10.36.116.211]) by smtp.corp.redhat.com (Postfix) with ESMTP id B0C1217250; Mon, 11 Mar 2019 08:26:20 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 96FA717476; Mon, 11 Mar 2019 09:26:19 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 11 Mar 2019 09:26:16 +0100 Message-Id: <20190311082619.17966-3-kraxel@redhat.com> In-Reply-To: <20190311082619.17966-1-kraxel@redhat.com> References: <20190311082619.17966-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: libvir-list@redhat.com, "Dr. David Alan Gilbert" , Samuel Thibault , Gerd Hoffmann Subject: [libvirt] [PULL 2/5] curses: support wide input X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Mon, 11 Mar 2019 08:26:29 +0000 (UTC) Content-Type: text/plain; charset="utf-8" From: Samuel Thibault This makes use of wide curses functions instead of 8bit functions. This allows to type e.g. accented letters. Unfortunately, key codes are then returned with values that could be confused with wide characters by ncurses, so we need to add a maybe_keycode variable to know whether the returned value is a key code or a character (curses with wide support), or possibly both (curses without wide support). The translation tables thus also need to be separated into key code translation and character translation. The curses2foo helper makes it easi= er to use them. Signed-off-by: Samuel Thibault Message-id: 20190304210532.7840-1-samuel.thibault@ens-lyon.org Signed-off-by: Gerd Hoffmann --- ui/curses_keys.h | 113 +++++++++++++++++++++++++++-------------------- ui/curses.c | 76 +++++++++++++++++++++++++------ 2 files changed, 127 insertions(+), 62 deletions(-) diff --git a/ui/curses_keys.h b/ui/curses_keys.h index e9195a167192..71e04acdc756 100644 --- a/ui/curses_keys.h +++ b/ui/curses_keys.h @@ -49,22 +49,28 @@ /* curses won't detect a Control + Alt + 1, so use Alt + 1 */ #define QEMU_KEY_CONSOLE0 (2 | ALT) /* (curses2keycode['1'] | ALT) */ =20 +#define CURSES_CHARS 0x100 /* Support latin1 only */ #define CURSES_KEYS KEY_MAX /* KEY_MAX defined in */ =20 -static const int curses2keysym[CURSES_KEYS] =3D { - [0 ... (CURSES_KEYS - 1)] =3D -1, +static const int _curses2keysym[CURSES_CHARS] =3D { + [0 ... (CURSES_CHARS - 1)] =3D -1, =20 [0x7f] =3D KEY_BACKSPACE, ['\r'] =3D KEY_ENTER, ['\n'] =3D KEY_ENTER, [27] =3D 27, +}; + +static const int _curseskey2keysym[CURSES_KEYS] =3D { + [0 ... (CURSES_KEYS - 1)] =3D -1, + [KEY_BTAB] =3D '\t' | KEYSYM_SHIFT, [KEY_SPREVIOUS] =3D KEY_PPAGE | KEYSYM_SHIFT, [KEY_SNEXT] =3D KEY_NPAGE | KEYSYM_SHIFT, }; =20 -static const int curses2keycode[CURSES_KEYS] =3D { - [0 ... (CURSES_KEYS - 1)] =3D -1, +static const int _curses2keycode[CURSES_CHARS] =3D { + [0 ... (CURSES_CHARS - 1)] =3D -1, =20 [0x01b] =3D 1, /* Escape */ ['1'] =3D 2, @@ -80,7 +86,6 @@ static const int curses2keycode[CURSES_KEYS] =3D { ['-'] =3D 12, ['=3D'] =3D 13, [0x07f] =3D 14, /* Backspace */ - [KEY_BACKSPACE] =3D 14, /* Backspace */ =20 ['\t'] =3D 15, /* Tab */ ['q'] =3D 16, @@ -97,7 +102,6 @@ static const int curses2keycode[CURSES_KEYS] =3D { [']'] =3D 27, ['\n'] =3D 28, /* Return */ ['\r'] =3D 28, /* Return */ - [KEY_ENTER] =3D 28, /* Return */ =20 ['a'] =3D 30, ['s'] =3D 31, @@ -126,33 +130,6 @@ static const int curses2keycode[CURSES_KEYS] =3D { =20 [' '] =3D 57, =20 - [KEY_F(1)] =3D 59, /* Function Key 1 */ - [KEY_F(2)] =3D 60, /* Function Key 2 */ - [KEY_F(3)] =3D 61, /* Function Key 3 */ - [KEY_F(4)] =3D 62, /* Function Key 4 */ - [KEY_F(5)] =3D 63, /* Function Key 5 */ - [KEY_F(6)] =3D 64, /* Function Key 6 */ - [KEY_F(7)] =3D 65, /* Function Key 7 */ - [KEY_F(8)] =3D 66, /* Function Key 8 */ - [KEY_F(9)] =3D 67, /* Function Key 9 */ - [KEY_F(10)] =3D 68, /* Function Key 10 */ - [KEY_F(11)] =3D 87, /* Function Key 11 */ - [KEY_F(12)] =3D 88, /* Function Key 12 */ - - [KEY_HOME] =3D 71 | GREY, /* Home */ - [KEY_UP] =3D 72 | GREY, /* Up Arrow */ - [KEY_PPAGE] =3D 73 | GREY, /* Page Up */ - [KEY_LEFT] =3D 75 | GREY, /* Left Arrow */ - [KEY_RIGHT] =3D 77 | GREY, /* Right Arrow */ - [KEY_END] =3D 79 | GREY, /* End */ - [KEY_DOWN] =3D 80 | GREY, /* Down Arrow */ - [KEY_NPAGE] =3D 81 | GREY, /* Page Down */ - [KEY_IC] =3D 82 | GREY, /* Insert */ - [KEY_DC] =3D 83 | GREY, /* Delete */ - - [KEY_SPREVIOUS] =3D 73 | GREY | SHIFT, /* Shift + Page Up */ - [KEY_SNEXT] =3D 81 | GREY | SHIFT, /* Shift + Page Down */ - ['!'] =3D 2 | SHIFT, ['@'] =3D 3 | SHIFT, ['#'] =3D 4 | SHIFT, @@ -166,7 +143,6 @@ static const int curses2keycode[CURSES_KEYS] =3D { ['_'] =3D 12 | SHIFT, ['+'] =3D 13 | SHIFT, =20 - [KEY_BTAB] =3D 15 | SHIFT, /* Shift + Tab */ ['Q'] =3D 16 | SHIFT, ['W'] =3D 17 | SHIFT, ['E'] =3D 18 | SHIFT, @@ -205,19 +181,6 @@ static const int curses2keycode[CURSES_KEYS] =3D { ['>'] =3D 52 | SHIFT, ['?'] =3D 53 | SHIFT, =20 - [KEY_F(13)] =3D 59 | SHIFT, /* Shift + Function Key 1 */ - [KEY_F(14)] =3D 60 | SHIFT, /* Shift + Function Key 2 */ - [KEY_F(15)] =3D 61 | SHIFT, /* Shift + Function Key 3 */ - [KEY_F(16)] =3D 62 | SHIFT, /* Shift + Function Key 4 */ - [KEY_F(17)] =3D 63 | SHIFT, /* Shift + Function Key 5 */ - [KEY_F(18)] =3D 64 | SHIFT, /* Shift + Function Key 6 */ - [KEY_F(19)] =3D 65 | SHIFT, /* Shift + Function Key 7 */ - [KEY_F(20)] =3D 66 | SHIFT, /* Shift + Function Key 8 */ - [KEY_F(21)] =3D 67 | SHIFT, /* Shift + Function Key 9 */ - [KEY_F(22)] =3D 68 | SHIFT, /* Shift + Function Key 10 */ - [KEY_F(23)] =3D 69 | SHIFT, /* Shift + Function Key 11 */ - [KEY_F(24)] =3D 70 | SHIFT, /* Shift + Function Key 12 */ - ['Q' - '@'] =3D 16 | CNTRL, /* Control + q */ ['W' - '@'] =3D 17 | CNTRL, /* Control + w */ ['E' - '@'] =3D 18 | CNTRL, /* Control + e */ @@ -249,13 +212,67 @@ static const int curses2keycode[CURSES_KEYS] =3D { =20 }; =20 -static const int curses2qemu[CURSES_KEYS] =3D { +static const int _curseskey2keycode[CURSES_KEYS] =3D { [0 ... (CURSES_KEYS - 1)] =3D -1, =20 + [KEY_BACKSPACE] =3D 14, /* Backspace */ + + [KEY_ENTER] =3D 28, /* Return */ + + [KEY_F(1)] =3D 59, /* Function Key 1 */ + [KEY_F(2)] =3D 60, /* Function Key 2 */ + [KEY_F(3)] =3D 61, /* Function Key 3 */ + [KEY_F(4)] =3D 62, /* Function Key 4 */ + [KEY_F(5)] =3D 63, /* Function Key 5 */ + [KEY_F(6)] =3D 64, /* Function Key 6 */ + [KEY_F(7)] =3D 65, /* Function Key 7 */ + [KEY_F(8)] =3D 66, /* Function Key 8 */ + [KEY_F(9)] =3D 67, /* Function Key 9 */ + [KEY_F(10)] =3D 68, /* Function Key 10 */ + [KEY_F(11)] =3D 87, /* Function Key 11 */ + [KEY_F(12)] =3D 88, /* Function Key 12 */ + + [KEY_HOME] =3D 71 | GREY, /* Home */ + [KEY_UP] =3D 72 | GREY, /* Up Arrow */ + [KEY_PPAGE] =3D 73 | GREY, /* Page Up */ + [KEY_LEFT] =3D 75 | GREY, /* Left Arrow */ + [KEY_RIGHT] =3D 77 | GREY, /* Right Arrow */ + [KEY_END] =3D 79 | GREY, /* End */ + [KEY_DOWN] =3D 80 | GREY, /* Down Arrow */ + [KEY_NPAGE] =3D 81 | GREY, /* Page Down */ + [KEY_IC] =3D 82 | GREY, /* Insert */ + [KEY_DC] =3D 83 | GREY, /* Delete */ + + [KEY_SPREVIOUS] =3D 73 | GREY | SHIFT, /* Shift + Page Up */ + [KEY_SNEXT] =3D 81 | GREY | SHIFT, /* Shift + Page Down */ + + [KEY_BTAB] =3D 15 | SHIFT, /* Shift + Tab */ + + [KEY_F(13)] =3D 59 | SHIFT, /* Shift + Function Key 1 */ + [KEY_F(14)] =3D 60 | SHIFT, /* Shift + Function Key 2 */ + [KEY_F(15)] =3D 61 | SHIFT, /* Shift + Function Key 3 */ + [KEY_F(16)] =3D 62 | SHIFT, /* Shift + Function Key 4 */ + [KEY_F(17)] =3D 63 | SHIFT, /* Shift + Function Key 5 */ + [KEY_F(18)] =3D 64 | SHIFT, /* Shift + Function Key 6 */ + [KEY_F(19)] =3D 65 | SHIFT, /* Shift + Function Key 7 */ + [KEY_F(20)] =3D 66 | SHIFT, /* Shift + Function Key 8 */ + [KEY_F(21)] =3D 67 | SHIFT, /* Shift + Function Key 9 */ + [KEY_F(22)] =3D 68 | SHIFT, /* Shift + Function Key 10 */ + [KEY_F(23)] =3D 69 | SHIFT, /* Shift + Function Key 11 */ + [KEY_F(24)] =3D 70 | SHIFT, /* Shift + Function Key 12 */ +}; + +static const int _curses2qemu[CURSES_CHARS] =3D { + [0 ... (CURSES_CHARS - 1)] =3D -1, + ['\n'] =3D '\n', ['\r'] =3D '\n', =20 [0x07f] =3D QEMU_KEY_BACKSPACE, +}; + +static const int _curseskey2qemu[CURSES_KEYS] =3D { + [0 ... (CURSES_KEYS - 1)] =3D -1, =20 [KEY_DOWN] =3D QEMU_KEY_DOWN, [KEY_UP] =3D QEMU_KEY_UP, diff --git a/ui/curses.c b/ui/curses.c index 870273de51a9..37954ce1b046 100644 --- a/ui/curses.c +++ b/ui/curses.c @@ -42,6 +42,12 @@ #define FONT_HEIGHT 16 #define FONT_WIDTH 8 =20 +enum maybe_keycode { + CURSES_KEYCODE, + CURSES_CHAR, + CURSES_CHAR_OR_KEYCODE, +}; + static DisplayChangeListener *dcl; static console_ch_t screen[160 * 100]; static WINDOW *screenpad =3D NULL; @@ -194,9 +200,54 @@ static void curses_cursor_position(DisplayChangeListen= er *dcl, =20 static kbd_layout_t *kbd_layout =3D NULL; =20 +static wint_t console_getch(enum maybe_keycode *maybe_keycode) +{ + wint_t ret; + switch (get_wch(&ret)) { + case KEY_CODE_YES: + *maybe_keycode =3D CURSES_KEYCODE; + break; + case OK: + *maybe_keycode =3D CURSES_CHAR; + break; + case ERR: + ret =3D -1; + break; + } + return ret; +} + +static int curses2foo(const int _curses2foo[], const int _curseskey2foo[], + int chr, enum maybe_keycode maybe_keycode) +{ + int ret =3D -1; + if (maybe_keycode =3D=3D CURSES_CHAR) { + if (chr < CURSES_CHARS) { + ret =3D _curses2foo[chr]; + } + } else { + if (chr < CURSES_KEYS) { + ret =3D _curseskey2foo[chr]; + } + if (ret =3D=3D -1 && maybe_keycode =3D=3D CURSES_CHAR_OR_KEYCODE && + chr < CURSES_CHARS) { + ret =3D _curses2foo[chr]; + } + } + return ret; +} + +#define curses2keycode(chr, maybe_keycode) \ + curses2foo(_curses2keycode, _curseskey2keycode, chr, maybe_keycode) +#define curses2keysym(chr, maybe_keycode) \ + curses2foo(_curses2keysym, _curseskey2keysym, chr, maybe_keycode) +#define curses2qemu(chr, maybe_keycode) \ + curses2foo(_curses2qemu, _curseskey2qemu, chr, maybe_keycode) + static void curses_refresh(DisplayChangeListener *dcl) { int chr, keysym, keycode, keycode_alt; + enum maybe_keycode maybe_keycode; =20 curses_winch_check(); =20 @@ -212,14 +263,14 @@ static void curses_refresh(DisplayChangeListener *dcl) =20 while (1) { /* while there are any pending key strokes to process */ - chr =3D getch(); + chr =3D console_getch(&maybe_keycode); =20 - if (chr =3D=3D ERR) + if (chr =3D=3D -1) break; =20 #ifdef KEY_RESIZE /* this shouldn't occur when we use a custom SIGWINCH handler */ - if (chr =3D=3D KEY_RESIZE) { + if (maybe_keycode !=3D CURSES_CHAR && chr =3D=3D KEY_RESIZE) { clear(); refresh(); curses_calc_pad(); @@ -228,17 +279,19 @@ static void curses_refresh(DisplayChangeListener *dcl) } #endif =20 - keycode =3D curses2keycode[chr]; + keycode =3D curses2keycode(chr, maybe_keycode); keycode_alt =3D 0; =20 /* alt or esc key */ if (keycode =3D=3D 1) { - int nextchr =3D getch(); + enum maybe_keycode next_maybe_keycode; + int nextchr =3D console_getch(&next_maybe_keycode); =20 - if (nextchr !=3D ERR) { + if (nextchr !=3D -1) { chr =3D nextchr; + maybe_keycode =3D next_maybe_keycode; keycode_alt =3D ALT; - keycode =3D curses2keycode[chr]; + keycode =3D curses2keycode(chr, maybe_keycode); =20 if (keycode !=3D -1) { keycode |=3D ALT; @@ -258,9 +311,7 @@ static void curses_refresh(DisplayChangeListener *dcl) } =20 if (kbd_layout) { - keysym =3D -1; - if (chr < CURSES_KEYS) - keysym =3D curses2keysym[chr]; + keysym =3D curses2keysym(chr, maybe_keycode); =20 if (keysym =3D=3D -1) { if (chr < ' ') { @@ -326,10 +377,7 @@ static void curses_refresh(DisplayChangeListener *dcl) qemu_input_event_send_key_delay(0); } } else { - keysym =3D -1; - if (chr < CURSES_KEYS) { - keysym =3D curses2qemu[chr]; - } + keysym =3D curses2qemu(chr, maybe_keycode); if (keysym =3D=3D -1) keysym =3D chr; =20 --=20 2.18.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 04:02:08 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1552292800307226.23609684687915; Mon, 11 Mar 2019 01:26:40 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7804330832EB; Mon, 11 Mar 2019 08:26:38 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 515BB5DD84; Mon, 11 Mar 2019 08:26:38 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 0ACD124C19; Mon, 11 Mar 2019 08:26:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x2B8QRrb027386 for ; Mon, 11 Mar 2019 04:26:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id 26E77614E6; Mon, 11 Mar 2019 08:26:27 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-211.ams2.redhat.com [10.36.116.211]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9900160851; Mon, 11 Mar 2019 08:26:20 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 9F1C517514; Mon, 11 Mar 2019 09:26:19 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 11 Mar 2019 09:26:17 +0100 Message-Id: <20190311082619.17966-4-kraxel@redhat.com> In-Reply-To: <20190311082619.17966-1-kraxel@redhat.com> References: <20190311082619.17966-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: libvir-list@redhat.com, "Dr. David Alan Gilbert" , Gerd Hoffmann Subject: [libvirt] [PULL 3/5] vnc: fix update stalls X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Mon, 11 Mar 2019 08:26:39 +0000 (UTC) Content-Type: text/plain; charset="utf-8" vnc aborts display update jobs on video mode switches and page flips. That can cause vnc update stalls in case an unfinished vnc job gets aborted. The vnc client will never receive the requested update then. Fix that by copying the state from job_update back to update in that case. Reports complain about stalls with two or more clients being connected at the same time, on some but not all connections. I suspect it can also happen with a single connection, multiple connections only make this more much likely to happen. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=3D1662260 Reported-by: Ying Fang Signed-off-by: Gerd Hoffmann Reviewed-by: Ying Fang Message-id: 20190305130930.24516-1-kraxel@redhat.com --- ui/vnc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ui/vnc.c b/ui/vnc.c index da4a21d4ce94..2f2ab62fcf71 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -700,6 +700,12 @@ static void vnc_abort_display_jobs(VncDisplay *vd) } QTAILQ_FOREACH(vs, &vd->clients, next) { vnc_lock_output(vs); + if (vs->update =3D=3D VNC_STATE_UPDATE_NONE && + vs->job_update !=3D VNC_STATE_UPDATE_NONE) { + /* job aborted before completion */ + vs->update =3D vs->job_update; + vs->job_update =3D VNC_STATE_UPDATE_NONE; + } vs->abort =3D false; vnc_unlock_output(vs); } --=20 2.18.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 04:02:08 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1552292800130873.4866346045958; Mon, 11 Mar 2019 01:26:40 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6E740307E056; Mon, 11 Mar 2019 08:26:38 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 489A55DA62; Mon, 11 Mar 2019 08:26:38 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id F03E124C18; Mon, 11 Mar 2019 08:26:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x2B8QRUb027397 for ; Mon, 11 Mar 2019 04:26:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6FDFF611C5; Mon, 11 Mar 2019 08:26:27 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-211.ams2.redhat.com [10.36.116.211]) by smtp.corp.redhat.com (Postfix) with ESMTP id B30FA60863; Mon, 11 Mar 2019 08:26:20 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id AA0C517515; Mon, 11 Mar 2019 09:26:19 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 11 Mar 2019 09:26:18 +0100 Message-Id: <20190311082619.17966-5-kraxel@redhat.com> In-Reply-To: <20190311082619.17966-1-kraxel@redhat.com> References: <20190311082619.17966-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: libvir-list@redhat.com, "Dr. David Alan Gilbert" , Gerd Hoffmann Subject: [libvirt] [PULL 4/5] vnc: allow specifying a custom authorization object name X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Mon, 11 Mar 2019 08:26:38 +0000 (UTC) Content-Type: text/plain; charset="utf-8" From: "Daniel P. Berrange" The VNC server has historically had support for ACLs to check both the SASL username and the TLS x509 distinguished name. The VNC server was responsible for creating the initial ACL, and the client app was then responsible for populating it with rules using the HMP 'acl_add' command. This is not satisfactory for a variety of reasons. There is no way to populate the ACLs from the command line, users are forced to use the HMP. With multiple network services all supporting TLS and ACLs now, it is desirable to be able to define a single ACL that is referenced by all services. To address these limitations, two new options are added to the VNC server CLI. The 'tls-authz' option takes the ID of a QAuthZ object to use for checking TLS x509 distinguished names, and the 'sasl-authz' option takes the ID of another object to use for checking SASL usernames. In this example, we setup two authorization rules. The first allows any client with a certificate issued by the 'RedHat' organization in the 'London' locality. The second ACL allows clients with either the 'joe@REDHAT.COM' or 'fred@REDHAT.COM' kerberos usernames. Both checks must pass for the user to be allowed. $QEMU -object tls-creds-x509,id=3Dtls0,dir=3D/home/berrange/qemutls,\ endpoint=3Dserver,verify-peer=3Dyes \ -object authz-simple,id=3Dauthz0,policy=3Ddeny,\ rules.0.match=3DO=3DRedHat,,L=3DLondon,rules.0.policy=3Da= llow \ -object authz-simple,id=3Dauthz1,policy=3Ddeny,\ rules.0.match=3Dfred@REDHAT.COM,rules.0.policy=3Dallow \ rules.0.match=3Djoe@REDHAT.COM,rules.0.policy=3Dallow \ -vnc 0.0.0.0:1,tls-creds=3Dtls0,tls-authz=3Dauthz0, sasl,sasl-authz=3Dauthz1 \ ...other QEMU args... Reviewed-by: Juan Quintela Signed-off-by: Daniel P. Berrange Message-id: 20190227145755.26556-2-berrange@redhat.com Signed-off-by: Gerd Hoffmann --- ui/vnc.c | 58 +++++++++++++++++++++++++++++++++++++------- qemu-deprecated.texi | 5 ++++ qemu-options.hx | 35 ++++++++++++++++++-------- 3 files changed, 79 insertions(+), 19 deletions(-) diff --git a/ui/vnc.c b/ui/vnc.c index 2f2ab62fcf71..2d9e8f43b09b 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -3363,6 +3363,12 @@ static QemuOptsList qemu_vnc_opts =3D { },{ .name =3D "acl", .type =3D QEMU_OPT_BOOL, + },{ + .name =3D "tls-authz", + .type =3D QEMU_OPT_STRING, + },{ + .name =3D "sasl-authz", + .type =3D QEMU_OPT_STRING, },{ .name =3D "lossy", .type =3D QEMU_OPT_BOOL, @@ -3802,6 +3808,8 @@ void vnc_display_open(const char *id, Error **errp) const char *credid; bool sasl =3D false; int acl =3D 0; + const char *tlsauthz; + const char *saslauthz; int lock_key_sync =3D 1; int key_delay_ms; =20 @@ -3873,7 +3881,33 @@ void vnc_display_open(const char *id, Error **errp) goto fail; } } + if (qemu_opt_get(opts, "acl")) { + error_report("The 'acl' option to -vnc is deprecated. " + "Please use the 'tls-authz' and 'sasl-authz' " + "options instead"); + } acl =3D qemu_opt_get_bool(opts, "acl", false); + tlsauthz =3D qemu_opt_get(opts, "tls-authz"); + if (acl && tlsauthz) { + error_setg(errp, "'acl' option is mutually exclusive with the " + "'tls-authz' option"); + goto fail; + } + if (tlsauthz && !vd->tlscreds) { + error_setg(errp, "'tls-authz' provided but TLS is not enabled"); + goto fail; + } + + saslauthz =3D qemu_opt_get(opts, "sasl-authz"); + if (acl && saslauthz) { + error_setg(errp, "'acl' option is mutually exclusive with the " + "'sasl-authz' option"); + goto fail; + } + if (saslauthz && !sasl) { + error_setg(errp, "'sasl-authz' provided but SASL auth is not enabl= ed"); + goto fail; + } =20 share =3D qemu_opt_get(opts, "share"); if (share) { @@ -3903,7 +3937,9 @@ void vnc_display_open(const char *id, Error **errp) vd->non_adaptive =3D true; } =20 - if (acl) { + if (tlsauthz) { + vd->tlsauthzid =3D g_strdup(tlsauthz); + } else if (acl) { if (strcmp(vd->id, "default") =3D=3D 0) { vd->tlsauthzid =3D g_strdup("vnc.x509dname"); } else { @@ -3914,15 +3950,19 @@ void vnc_display_open(const char *id, Error **errp) &error_abort)); } #ifdef CONFIG_VNC_SASL - if (acl && sasl) { - if (strcmp(vd->id, "default") =3D=3D 0) { - vd->sasl.authzid =3D g_strdup("vnc.username"); - } else { - vd->sasl.authzid =3D g_strdup_printf("vnc.%s.username", vd->id= ); + if (sasl) { + if (saslauthz) { + vd->sasl.authzid =3D g_strdup(saslauthz); + } else if (acl) { + if (strcmp(vd->id, "default") =3D=3D 0) { + vd->sasl.authzid =3D g_strdup("vnc.username"); + } else { + vd->sasl.authzid =3D g_strdup_printf("vnc.%s.username", vd= ->id); + } + vd->sasl.authz =3D QAUTHZ(qauthz_list_new(vd->sasl.authzid, + QAUTHZ_LIST_POLICY_DEN= Y, + &error_abort)); } - vd->sasl.authz =3D QAUTHZ(qauthz_list_new(vd->sasl.authzid, - QAUTHZ_LIST_POLICY_DENY, - &error_abort)); } #endif =20 diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi index 45c57952da56..1258da479535 100644 --- a/qemu-deprecated.texi +++ b/qemu-deprecated.texi @@ -60,6 +60,11 @@ Support for invalid topologies will be removed, the user= must ensure topologies described with -smp include all possible cpus, i.e. @math{@var{sockets} * @var{cores} * @var{threads} =3D @var{maxcpus}}. =20 +@subsection -vnc acl (since 4.0.0) + +The @code{acl} option to the @code{-vnc} argument has been replaced +by the @code{tls-authz} and @code{sasl-authz} options. + @section QEMU Machine Protocol (QMP) commands =20 @subsection block-dirty-bitmap-add "autoload" parameter (since 2.12.0) diff --git a/qemu-options.hx b/qemu-options.hx index 1cf9aac1fe35..c74f99b2653a 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -1624,6 +1624,14 @@ will cause the VNC server socket to enable the VeNCr= ypt auth mechanism. The credentials should have been previously created using the @option{-object tls-creds} argument. =20 +@item tls-authz=3D@var{ID} + +Provides the ID of the QAuthZ authorization object against which +the client's x509 distinguished name will validated. This object is +only resolved at time of use, so can be deleted and recreated on the +fly while the VNC server is active. If missing, it will default +to denying access. + @item sasl =20 Require that the client use SASL to authenticate with the VNC server. @@ -1639,18 +1647,25 @@ ensures a data encryption preventing compromise of = authentication credentials. See the @ref{vnc_security} section for details on using SASL authentication. =20 +@item sasl-authz=3D@var{ID} + +Provides the ID of the QAuthZ authorization object against which +the client's SASL username will validated. This object is +only resolved at time of use, so can be deleted and recreated on the +fly while the VNC server is active. If missing, it will default +to denying access. + @item acl =20 -Turn on access control lists for checking of the x509 client certificate -and SASL party. For x509 certs, the ACL check is made against the -certificate's distinguished name. This is something that looks like -@code{C=3DGB,O=3DACME,L=3DBoston,CN=3Dbob}. For SASL party, the ACL check = is -made against the username, which depending on the SASL plugin, may -include a realm component, eg @code{bob} or @code{bob@@EXAMPLE.COM}. -When the @option{acl} flag is set, the initial access list will be -empty, with a @code{deny} policy. Thus no one will be allowed to -use the VNC server until the ACLs have been loaded. This can be -achieved using the @code{acl} monitor command. +Legacy method for enabling authorization of clients against the +x509 distinguished name and SASL username. It results in the creation +of two @code{authz-list} objects with IDs of @code{vnc.username} and +@code{vnc.x509dname}. The rules for these objects must be configured +with the HMP ACL commands. + +This option is deprecated and should no longer be used. The new +@option{sasl-authz} and @option{tls-authz} options are a +replacement. =20 @item lossy =20 --=20 2.18.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sun Apr 28 04:02:08 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 15522928013795.9407698966221005; Mon, 11 Mar 2019 01:26:41 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9C3248762D; Mon, 11 Mar 2019 08:26:39 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6F46D17250; Mon, 11 Mar 2019 08:26:39 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 17F8824C21; Mon, 11 Mar 2019 08:26:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x2B8QV8T027421 for ; Mon, 11 Mar 2019 04:26:31 -0400 Received: by smtp.corp.redhat.com (Postfix) id 239CD60140; Mon, 11 Mar 2019 08:26:31 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-211.ams2.redhat.com [10.36.116.211]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4A3F060123; Mon, 11 Mar 2019 08:26:26 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id B3D3317516; Mon, 11 Mar 2019 09:26:19 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 11 Mar 2019 09:26:19 +0100 Message-Id: <20190311082619.17966-6-kraxel@redhat.com> In-Reply-To: <20190311082619.17966-1-kraxel@redhat.com> References: <20190311082619.17966-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: libvir-list@redhat.com, "Dr. David Alan Gilbert" , Gerd Hoffmann Subject: [libvirt] [PULL 5/5] monitor: deprecate acl_show, acl_reset, acl_policy, acl_add, acl_remove X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 11 Mar 2019 08:26:40 +0000 (UTC) From: Daniel P. Berrang=C3=A9 The various ACL related commands are obsolete now that the QAuthZ framework for authorization is fully integrated throughout QEMU network services. These only ever worked with VNC and were never used by libvirt. Mark it as deprecated with no direct replacement to be provided. Authorization is now provided by using 'object_add' together with the 'tls-authz' or 'sasl-authz' parameters to the VNC server, and equivalent for other network services. Reviewed-by: Juan Quintela Signed-off-by: Daniel P. Berrang=C3=A9 Message-id: 20190227145755.26556-3-berrange@redhat.com Signed-off-by: Gerd Hoffmann --- monitor.c | 23 +++++++++++++++++++++++ qemu-deprecated.texi | 6 ++++++ 2 files changed, 29 insertions(+) diff --git a/monitor.c b/monitor.c index defa129319b0..72061d5baeb4 100644 --- a/monitor.c +++ b/monitor.c @@ -2032,6 +2032,19 @@ static QAuthZList *find_auth(Monitor *mon, const cha= r *name) return QAUTHZ_LIST(obj); } =20 +static bool warn_acl; +static void hmp_warn_acl(void) +{ + if (warn_acl) { + return; + } + error_report("The acl_show, acl_reset, acl_policy, acl_add, acl_remove= " + "commands are deprecated with no replacement. Authorizati= on " + "for VNC should be performed using the pluggable QAuthZ " + "objects"); + warn_acl =3D true; +} + static void hmp_acl_show(Monitor *mon, const QDict *qdict) { const char *aclname =3D qdict_get_str(qdict, "aclname"); @@ -2039,6 +2052,8 @@ static void hmp_acl_show(Monitor *mon, const QDict *q= dict) QAuthZListRuleList *rules; size_t i =3D 0; =20 + hmp_warn_acl(); + if (!auth) { return; } @@ -2062,6 +2077,8 @@ static void hmp_acl_reset(Monitor *mon, const QDict *= qdict) const char *aclname =3D qdict_get_str(qdict, "aclname"); QAuthZList *auth =3D find_auth(mon, aclname); =20 + hmp_warn_acl(); + if (!auth) { return; } @@ -2080,6 +2097,8 @@ static void hmp_acl_policy(Monitor *mon, const QDict = *qdict) int val; Error *err =3D NULL; =20 + hmp_warn_acl(); + if (!auth) { return; } @@ -2124,6 +2143,8 @@ static void hmp_acl_add(Monitor *mon, const QDict *qd= ict) QAuthZListFormat format; size_t i =3D 0; =20 + hmp_warn_acl(); + if (!auth) { return; } @@ -2169,6 +2190,8 @@ static void hmp_acl_remove(Monitor *mon, const QDict = *qdict) QAuthZList *auth =3D find_auth(mon, aclname); ssize_t i =3D 0; =20 + hmp_warn_acl(); + if (!auth) { return; } diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi index 1258da479535..1e15f57e9cc9 100644 --- a/qemu-deprecated.texi +++ b/qemu-deprecated.texi @@ -104,6 +104,12 @@ The @option{[hub_id name]} parameter tuple of the 'hos= tfwd_add' and Use ``device_add'' for hotplugging vCPUs instead of ``cpu-add''. See documentation of ``query-hotpluggable-cpus'' for additional details. =20 +@subsection acl_show, acl_reset, acl_policy, acl_add, acl_remove (since 4.= 0.0) + +The ``acl_show'', ``acl_reset'', ``acl_policy'', ``acl_add'', and +``acl_remove'' commands are deprecated with no replacement. Authorization +for VNC should be performed using the pluggable QAuthZ objects. + @section System emulator devices =20 @subsection bluetooth (since 3.1) --=20 2.18.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list