From patchwork Wed Dec 22 19:17:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 12697189 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2A176C433F5 for ; Wed, 22 Dec 2021 19:21:05 +0000 (UTC) Received: from localhost ([::1]:52928 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n07Ad-0001Em-QW for qemu-devel@archiver.kernel.org; Wed, 22 Dec 2021 14:21:03 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51012) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n077Z-0007YT-MR for qemu-devel@nongnu.org; Wed, 22 Dec 2021 14:17:54 -0500 Received: from mail-eopbgr140119.outbound.protection.outlook.com ([40.107.14.119]:46656 helo=EUR01-VE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n077W-0001Jb-WD for qemu-devel@nongnu.org; Wed, 22 Dec 2021 14:17:52 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bgE2uBUABDgEx6qE+0G2lvLAwQw1sMnOcGJBe7a4mBiRft7Nwkda8Dko8fKZ7+0qD0j0P7oV2wVfmqo4hBpZanvUB7UQDBckCe7+DxflBPT4R+Pu/v7AOVUbb3EZEmT5Y3YpRwm7r/qphJa45gZiilNyqTFAlIPEcE3+Uoh6B+PG8+5ytCqGY59tpfvseUPsOkWcqfemMRSW5OETy8ExGbZ66P1TIs+Z7LkCrGPrVFyQmEIf8clroYrx93cE8Hi11cTuRYVXbSSiw+bekol1lr3aBFV5DUXlwDwDXhQsbVIyaB/0sxDcOEXhMTFOX94f+ZZTIz2LQWdUr0VGou/h7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ECGDfiZFe7GybHSlZNVQZk+rbebvUFGrLrFBLs6UzGY=; b=QnzZ5B1Nv7wzCDebIGwGvSqwN3+vzGBHFltktFqnKy0e5swY6t+aBORI/4ssuPg4vJh2FQ1Ai3GP0uGGy6yvcD0qkCf9TttgiS2toid53IQkdlI/ElSxPiLRhyb1czeoxScmrzlQzF73aEKqS4bxG9S0kD9LrwRFkyN2uUMJUOtdKoWlzd0KculsIR1RR8gU59OXNHKgN6fboR2tPloW0QofHb5RydFuZf5a0rJWez20q65qC60uwBNUAY7x8cwZM3407g+J1HyKWBNfNKtX0yt7+Srm9dav3Wf0QUDm6s7KduoCN0Yyj7SNrUyY5nkty285bZMWMSRUi5gBjDZ7cg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ECGDfiZFe7GybHSlZNVQZk+rbebvUFGrLrFBLs6UzGY=; b=GsijmmGJAcdnBYld9DoFv0SMrasUay58p7gRSSyS+yfHFEZUC7/5caDm6HZxjck0i9kPsgTxVa2PsXB05EYXqWaxtuHdQKfcHDZxb42iLtqCOMZQgWEPReqDtvdqW2rm8mup9nMRw6YaMx2Xzw8lnF074MBjwty12d/E3wJLf2g= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=virtuozzo.com; Received: from AM9PR08MB6737.eurprd08.prod.outlook.com (2603:10a6:20b:304::18) by AM9PR08MB6290.eurprd08.prod.outlook.com (2603:10a6:20b:2d5::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.14; Wed, 22 Dec 2021 19:17:45 +0000 Received: from AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::b118:483a:d003:3112]) by AM9PR08MB6737.eurprd08.prod.outlook.com ([fe80::b118:483a:d003:3112%5]) with mapi id 15.20.4823.019; Wed, 22 Dec 2021 19:17:44 +0000 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Cc: bleal@redhat.com, wainersm@redhat.com, philmd@redhat.com, crosa@redhat.com, armbru@redhat.com, eblake@redhat.com, kraxel@redhat.com, marcandre.lureau@gmail.com, vsementsov@virtuozzo.com Subject: [PATCH v2 0/3] qapi/ui: add change-vnc-listen Date: Wed, 22 Dec 2021 20:17:28 +0100 Message-Id: <20211222191731.467706-1-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.31.1 X-ClientProxiedBy: FR2P281CA0035.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:14::22) To AM9PR08MB6737.eurprd08.prod.outlook.com (2603:10a6:20b:304::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bfc053d4-5588-45b8-43c7-08d9c57fbb75 X-MS-TrafficTypeDiagnostic: AM9PR08MB6290:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mkH4FMrUQBR0p45V339TMGFA9aYCdqNTniYrz9IY167FLQdDyXuTQhyIrIxqKdpyesC9fGww6S35H2qixP5+lwg5cjMNv9hD6Bcte1AVhN2DPNrOFhgUmeSOB1K856xDW+lVi/N6your4wzMKjFmSedYTsjUr716NdY1wiUbAmv+Q0TzVO8iNqHO0B/S3h3VWLLVu+/VNEbyNb3utCZfcmKcasaml7lp6Lnh6yntqFKz/UXvRALAAMBLa4GydVyzhnljCmfWrKKvtGgsTDG81jm0n//qLWJjpXTgkuFNjOYqRWHYS4Qv4sLwyh/xWsVdGfST47R7/O6f3m4Eca86yS/wKLko9pYE4Nek/ecESwssIOxUYLaeXB1+ZyOV6ju67rjFlZMMGmITwKvSuPNWrF0LMeqWmYB9YkbdcXWsToJpbidDlVfy4thI85fOmGS9bsHk+37RWmD+M5neNiOlFqSK6gDGSeq9V3x8QkH4cE4stk1upoea0lht9kyujSWln+ehpitd7RiIBhkBQ2m9QAgNd2d7iAmDi6ntmEWtXP5Fg77q+LDZXecIM0ENooKukwS3pFnXOFIcYg0N0NihkzOJqd0mPfSb5IE5DISgnIa3YTI22pDMbX2n3cnz/YN2TaM9Br1X13J4pcBqsvW3PvaSflLyR2J4dNiUhoHVQKAeYU/xcjw2zHCL05DwBYmlkd8QkYb1hs7+olADCk4moQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM9PR08MB6737.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(316002)(52116002)(38350700002)(38100700002)(6506007)(66476007)(66556008)(2906002)(66946007)(6486002)(8676002)(4326008)(36756003)(2616005)(6916009)(5660300002)(86362001)(107886003)(8936002)(186003)(26005)(1076003)(508600001)(6666004)(83380400001)(6512007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?NyDUcnTqQkffkVAZwJneOoY57J3v?=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?= =?utf-8?q?63auFzRTlvBEDxI3lRI1121ZMXCh+8ONOQ1fa7p6YC3UrV9IHLghW+rdWYPu+Nvyw?= =?utf-8?q?ODVjHtd3z+OhSolI1sGlRLi8c6VQYD74sWqTqCLhM+o9n9qebWLYS1M88iEZALVOf?= =?utf-8?q?KkvM068EV/GXXlrevePdCnYLyquQS3jmGYPyeV6caFdApzlxMNP6tgFas4CK4vdAj?= =?utf-8?q?oXCC6vBv77nulCxEX9sPBR1gqoxeQn8L3TEhWDruyvbuLGmLaCDqyS7L4p0tGooQN?= =?utf-8?q?kLxMK8A/IqK/v/Ozkx9nbXVcsIctCtHT7CkDZzDKGm43QEiyXPK+3TB8nLFphB+9R?= =?utf-8?q?sqZ8TsjF1FIKViyofHSbI4qG2DKACpslUt3NfrKnIy53H7QXBwnEVzzJf5aocxzga?= =?utf-8?q?SshJnEEDSWZryJ9DbhiVWtgscz1BsI4FkReENpf/xd1oWmmLYq+fHy9KX1pQSAAcI?= =?utf-8?q?/I1JWWOeCjXmK4XvYfWLrsWQ/9ZiRz2TAqE+LV92RtC2jE3VjS1B0picuhxDYn1Tv?= =?utf-8?q?f6B27jcmOi9AEQ9GfeYmV/UANBk7720KTsl+zRke6S/Ikje54jUS7CODeJKCRt/kJ?= =?utf-8?q?AdInGNUL56knir+Yv+aWwqK0hnDQFpiJMmRhdZm4PtP8gdqCoSp1m6tEdx+PWwJ8w?= =?utf-8?q?qCUXDp6M9k+hez034vXQwo9iqn0IlF0faU/LAFoC79+IKuiyDIutkIg5V2R7aR/I8?= =?utf-8?q?WruZZenPKPijeQL4RJnkYWpEsAUhdIP6w=3D=3D?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: bfc053d4-5588-45b8-43c7-08d9c57fbb75 X-MS-Exchange-CrossTenant-AuthSource: AM9PR08MB6737.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Dec 2021 19:17:44.8365 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: RSPz2Kce8cC3b1ZbBoUmHCXB7llhLH+SK/oOSKTFOpIAnfc3fxkXleD63lzWKA2LLhBTGf8vg81yAYlQc2+SHS66CeVZlLAfQEWWh/2KU7I= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB6290 Received-SPF: pass client-ip=40.107.14.119; envelope-from=vsementsov@virtuozzo.com; helo=EUR01-VE1-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Hi all! v2: 01, 03: add Mark-Andre's r-bs 02: add a bit of documentation and "'if': 'CONFIG_VNC'", still, keep Mark-Adnre's r-b here too Recently our customer requested a possibility to change VNC listen port dynamically. Happily in Rhel7-based Qemu we already have this possibility: through deprecated "change" qmp command. But since 6.0 "change" qmp command was removed, with recommendation to use change-vnc-password or blockdev-change-medium instead. Of course, neither of them allow change VNC listen port. So, let's reimplement the possibility. Note: now, reconnecting may trigger existing deadlock, as I described in my message "Re: [PULL 09/11] ui/vnc: clipboard support": <973ddebe-14a9-4ba7-c389-7a97d6017237@virtuozzo.com> Simple hack helps, but I'm not sure it's safe itself: diff --git a/ui/vnc.c b/ui/vnc.c index 69bbf3b6f6..8c6b378e2e 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -1354,12 +1354,12 @@ void vnc_disconnect_finish(VncState *vs) /* last client gone */ vnc_update_server_surface(vs->vd); } + vnc_unlock_output(vs); + if (vs->cbpeer.update.notify) { qemu_clipboard_peer_unregister(&vs->cbpeer); } - vnc_unlock_output(vs); - qemu_mutex_destroy(&vs->output_mutex); if (vs->bh != NULL) { qemu_bh_delete(vs->bh); Vladimir Sementsov-Ogievskiy (3): ui/vnc: refactor arrays of addresses to SocketAddressList qapi/ui: introduce change-vnc-listen avocado/vnc: add test_change_listen docs/about/removed-features.rst | 3 +- qapi/ui.json | 19 ++++ ui/vnc.c | 155 ++++++++++++++++---------------- tests/avocado/vnc.py | 10 +++ 4 files changed, 108 insertions(+), 79 deletions(-)