From nobody Mon Apr 29 05:10:30 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 1535360014449157.9540163598905; Mon, 27 Aug 2018 01:53:34 -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 E4D8683F51; Mon, 27 Aug 2018 08:53:31 +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 A9D0B5C89C; Mon, 27 Aug 2018 08:53:31 +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 4FAEE180610F; Mon, 27 Aug 2018 08:53:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7R8rPOW006651 for ; Mon, 27 Aug 2018 04:53:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6F79B2157F45; Mon, 27 Aug 2018 08:53:25 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-117-138.ams2.redhat.com [10.36.117.138]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8C5502166B41; Mon, 27 Aug 2018 08:53:21 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id DEB37204A8; Mon, 27 Aug 2018 10:53:20 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 27 Aug 2018 10:53:09 +0200 Message-Id: <20180827085320.9732-2-kraxel@redhat.com> In-Reply-To: <20180827085320.9732-1-kraxel@redhat.com> References: <20180827085320.9732-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Cc: libvir-list@redhat.com, Thomas Huth , Gerd Hoffmann Subject: [libvirt] [PULL 01/12] ui/sdl2: Remove the obsolete SDL_INIT_NOPARACHUTE flag 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 27 Aug 2018 08:53:32 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Thomas Huth SDL_INIT_NOPARACHUTE is not used in SDL2 anymore, and the define is just a dummy (see https://wiki.libsdl.org/MigrationGuide#Some_general_truths for example). So we can remove it and get rid of the "flags" variable nowadays. Signed-off-by: Thomas Huth Message-id: 1533721602-15763-1-git-send-email-thuth@redhat.com Signed-off-by: Gerd Hoffmann --- ui/sdl2.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ui/sdl2.c b/ui/sdl2.c index 76e59427cc..755a7134ff 100644 --- a/ui/sdl2.c +++ b/ui/sdl2.c @@ -761,7 +761,6 @@ static void sdl2_display_early_init(DisplayOptions *o) =20 static void sdl2_display_init(DisplayState *ds, DisplayOptions *o) { - int flags; uint8_t data =3D 0; char *filename; int i; @@ -782,8 +781,7 @@ static void sdl2_display_init(DisplayState *ds, Display= Options *o) setenv("SDL_VIDEODRIVER", "x11", 0); #endif =20 - flags =3D SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE; - if (SDL_Init(flags)) { + if (SDL_Init(SDL_INIT_VIDEO)) { fprintf(stderr, "Could not initialize SDL(%s) - exiting\n", SDL_GetError()); exit(1); --=20 2.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 05:10:30 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 1535360021138169.4135363420212; Mon, 27 Aug 2018 01:53:41 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5AD8D30842A8; Mon, 27 Aug 2018 08:53:39 +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 24DC6A5DC9; Mon, 27 Aug 2018 08:53: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 78BF0181A130; Mon, 27 Aug 2018 08:53:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7R8rR4I006667 for ; Mon, 27 Aug 2018 04:53:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2DBAFA9E60; Mon, 27 Aug 2018 08:53:27 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-117-138.ams2.redhat.com [10.36.117.138]) by smtp.corp.redhat.com (Postfix) with ESMTP id AB01C10879B; Mon, 27 Aug 2018 08:53:21 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 0A534204AE; Mon, 27 Aug 2018 10:53:21 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 27 Aug 2018 10:53:10 +0200 Message-Id: <20180827085320.9732-3-kraxel@redhat.com> In-Reply-To: <20180827085320.9732-1-kraxel@redhat.com> References: <20180827085320.9732-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: libvir-list@redhat.com, qemu-stable@nongnu.org, Gerd Hoffmann , Peter Wu Subject: [libvirt] [PULL 02/12] vnc: fix memleak of the "vnc-worker-output" 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: , 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.84 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Mon, 27 Aug 2018 08:53:39 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 From: Peter Wu Fixes repeated memory leaks of 18 bytes when using VNC: Direct leak of 831024 byte(s) in 46168 object(s) allocated from: ... #4 0x7f6d2f919bdd in g_strdup_vprintf glib/gstrfuncs.c:514 #5 0x56085cdcf660 in buffer_init util/buffer.c:59 #6 0x56085ca6a7ec in vnc_async_encoding_start ui/vnc-jobs.c:177 #7 0x56085ca6b815 in vnc_worker_thread_loop ui/vnc-jobs.c:240 Fixes: 543b95801f98 ("vnc: attach names to buffers") Cc: Gerd Hoffmann CC: qemu-stable@nongnu.org Signed-off-by: Peter Wu Reviewed-by: Marc-Andr=C3=A9 Lureau Message-id: 20180807221830.3844-1-peter@lekensteyn.nl Signed-off-by: Gerd Hoffmann --- ui/vnc-jobs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/vnc-jobs.c b/ui/vnc-jobs.c index b0b15d42a8..929391f85d 100644 --- a/ui/vnc-jobs.c +++ b/ui/vnc-jobs.c @@ -193,6 +193,7 @@ static void vnc_async_encoding_start(VncState *orig, Vn= cState *local) =20 static void vnc_async_encoding_end(VncState *orig, VncState *local) { + buffer_free(&local->output); orig->tight =3D local->tight; orig->zlib =3D local->zlib; orig->hextile =3D local->hextile; @@ -278,7 +279,7 @@ static int vnc_worker_thread_loop(VncJobQueue *queue) /* Copy persistent encoding data */ vnc_async_encoding_end(job->vs, &vs); =20 - qemu_bh_schedule(job->vs->bh); + qemu_bh_schedule(job->vs->bh); } else { buffer_reset(&vs.output); /* Copy persistent encoding data */ --=20 2.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 05:10:30 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 1535360022738797.7675180743165; Mon, 27 Aug 2018 01:53:42 -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 D2138A705; Mon, 27 Aug 2018 08:53:40 +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 9E41D5D9CC; Mon, 27 Aug 2018 08:53:40 +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 5579C4A46C; Mon, 27 Aug 2018 08:53:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7R8rR9k006677 for ; Mon, 27 Aug 2018 04:53:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id 613FD2166BA8; Mon, 27 Aug 2018 08:53:27 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-117-138.ams2.redhat.com [10.36.117.138]) by smtp.corp.redhat.com (Postfix) with ESMTP id A2FC02166BA1; Mon, 27 Aug 2018 08:53:21 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 2640F204B5; Mon, 27 Aug 2018 10:53:21 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 27 Aug 2018 10:53:11 +0200 Message-Id: <20180827085320.9732-4-kraxel@redhat.com> In-Reply-To: <20180827085320.9732-1-kraxel@redhat.com> References: <20180827085320.9732-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Cc: libvir-list@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Subject: [libvirt] [PULL 03/12] ui: use enum to string helpers 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 27 Aug 2018 08:53:41 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 From: Marc-Andr=C3=A9 Lureau Minor code simplification. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Markus Armbruster Message-id: 20180801092508.4927-1-marcandre.lureau@redhat.com Signed-off-by: Gerd Hoffmann --- qemu-keymap.c | 2 +- ui/console.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/qemu-keymap.c b/qemu-keymap.c index 6216371aa1..4d00468747 100644 --- a/qemu-keymap.c +++ b/qemu-keymap.c @@ -84,7 +84,7 @@ static void walk_map(struct xkb_keymap *map, xkb_keycode_= t code, void *data) } fprintf(outfile, "# evdev %d (0x%x), QKeyCode \"%s\", number 0x%x\n", evdev, evdev, - QKeyCode_lookup.array[qcode], + QKeyCode_str(qcode), qcode_to_number(qcode)); =20 /* diff --git a/ui/console.c b/ui/console.c index bc58458ee8..3a285bae00 100644 --- a/ui/console.c +++ b/ui/console.c @@ -2319,7 +2319,7 @@ bool qemu_display_find_default(DisplayOptions *opts) =20 for (i =3D 0; i < ARRAY_SIZE(prio); i++) { if (dpys[prio[i]] =3D=3D NULL) { - ui_module_load_one(DisplayType_lookup.array[prio[i]]); + ui_module_load_one(DisplayType_str(prio[i])); } if (dpys[prio[i]] =3D=3D NULL) { continue; @@ -2337,11 +2337,11 @@ void qemu_display_early_init(DisplayOptions *opts) return; } if (dpys[opts->type] =3D=3D NULL) { - ui_module_load_one(DisplayType_lookup.array[opts->type]); + ui_module_load_one(DisplayType_str(opts->type)); } if (dpys[opts->type] =3D=3D NULL) { error_report("Display '%s' is not available.", - DisplayType_lookup.array[opts->type]); + DisplayType_str(opts->type)); exit(1); } if (dpys[opts->type]->early_init) { --=20 2.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 05:10:30 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 1535360011101346.42753843263426; Mon, 27 Aug 2018 01:53:31 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BBEFE300192A; Mon, 27 Aug 2018 08:53:28 +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 55249A5DC4; Mon, 27 Aug 2018 08:53: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 B46FA4BB75; Mon, 27 Aug 2018 08:53:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7R8rPL6006656 for ; Mon, 27 Aug 2018 04:53:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id AC5152027056; Mon, 27 Aug 2018 08:53:25 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-117-138.ams2.redhat.com [10.36.117.138]) by smtp.corp.redhat.com (Postfix) with ESMTP id C5672202704E; Mon, 27 Aug 2018 08:53:21 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 4256A204B8; Mon, 27 Aug 2018 10:53:21 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 27 Aug 2018 10:53:12 +0200 Message-Id: <20180827085320.9732-5-kraxel@redhat.com> In-Reply-To: <20180827085320.9732-1-kraxel@redhat.com> References: <20180827085320.9732-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Cc: libvir-list@redhat.com, Gerd Hoffmann , Tao Wu Subject: [libvirt] [PULL 04/12] sdl2: redraw correctly when scanout_mode enabled. 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.84 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Mon, 27 Aug 2018 08:53:29 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Tao Wu When scanout_mode enabled, surface is out of sync with actual screen. In such case, we just call sdl2_gl_scanout_flush to do redraw. This fixes bug reported in https://lists.freedesktop.org/archives/virglrenderer-devel/2018-July/001330= .html Signed-off-by: Tao Wu Message-id: 20180726225900.180698-1-lepton@google.com Signed-off-by: Gerd Hoffmann --- ui/sdl2-gl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ui/sdl2-gl.c b/ui/sdl2-gl.c index 83b71853d1..1bf4542d8d 100644 --- a/ui/sdl2-gl.c +++ b/ui/sdl2-gl.c @@ -124,6 +124,11 @@ void sdl2_gl_redraw(struct sdl2_console *scon) { assert(scon->opengl); =20 + if (scon->scanout_mode) { + /* sdl2_gl_scanout_flush actually only care about + * the first argument. */ + return sdl2_gl_scanout_flush(&scon->dcl, 0, 0, 0, 0); + } if (scon->surface) { sdl2_gl_render_surface(scon); } --=20 2.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 05:10:30 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 1535360039760127.40780564862803; Mon, 27 Aug 2018 01:53:59 -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 19F1530842AD; Mon, 27 Aug 2018 08:53:58 +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 D9BEB19CBC; Mon, 27 Aug 2018 08:53:57 +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 902B94A475; Mon, 27 Aug 2018 08:53:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7R8rTfB006710 for ; Mon, 27 Aug 2018 04:53:30 -0400 Received: by smtp.corp.redhat.com (Postfix) id D4F2010EE824; Mon, 27 Aug 2018 08:53:29 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-117-138.ams2.redhat.com [10.36.117.138]) by smtp.corp.redhat.com (Postfix) with ESMTP id 031861134CCA; Mon, 27 Aug 2018 08:53:26 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 5D15931E30; Mon, 27 Aug 2018 10:53:21 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 27 Aug 2018 10:53:13 +0200 Message-Id: <20180827085320.9732-6-kraxel@redhat.com> In-Reply-To: <20180827085320.9732-1-kraxel@redhat.com> References: <20180827085320.9732-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Cc: libvir-list@redhat.com, Gerd Hoffmann Subject: [libvirt] [PULL 05/12] doc: switch to modern syntax for VNC TLS setup 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Mon, 27 Aug 2018 08:53:58 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 From: Daniel P. Berrang=C3=A9 The use of 'tls', 'x509' and 'x509verify' properties is the deprecated backcompat syntax, replaced by use of TLS creds objects. Signed-off-by: Daniel P. Berrang=C3=A9 Message-id: 20180725092751.21767-2-berrange@redhat.com Signed-off-by: Gerd Hoffmann --- qemu-doc.texi | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/qemu-doc.texi b/qemu-doc.texi index f74542a0e9..7bd449f398 100644 --- a/qemu-doc.texi +++ b/qemu-doc.texi @@ -1103,7 +1103,9 @@ support provides a secure session, but no authenticat= ion. This allows any client to connect, and provides an encrypted session. =20 @example -qemu-system-i386 [...OPTIONS...] -vnc :1,tls,x509=3D/etc/pki/qemu -monitor= stdio +qemu-system-i386 [...OPTIONS...] \ + -object tls-creds-x509,id=3Dtls0,dir=3D/etc/pki/qemu,endpoint=3Dserver,v= erify-peer=3Dno \ + -vnc :1,tls-creds=3Dtls0 -monitor stdio @end example =20 In the above example @code{/etc/pki/qemu} should contain at least three fi= les, @@ -1118,10 +1120,14 @@ only be readable by the user owning it. Certificates can also provide a means to authenticate the client connectin= g. The server will request that the client provide a certificate, which it wi= ll then validate against the CA certificate. This is a good choice if deployi= ng -in an environment with a private internal certificate authority. +in an environment with a private internal certificate authority. It uses t= he +same syntax as previously, but with @code{verify-peer} set to @code{yes} +instead. =20 @example -qemu-system-i386 [...OPTIONS...] -vnc :1,tls,x509verify=3D/etc/pki/qemu -m= onitor stdio +qemu-system-i386 [...OPTIONS...] \ + -object tls-creds-x509,id=3Dtls0,dir=3D/etc/pki/qemu,endpoint=3Dserver,v= erify-peer=3Dyes \ + -vnc :1,tls-creds=3Dtls0 -monitor stdio @end example =20 =20 @@ -1132,7 +1138,9 @@ Finally, the previous method can be combined with VNC= password authentication to provide two layers of authentication for clients. =20 @example -qemu-system-i386 [...OPTIONS...] -vnc :1,password,tls,x509verify=3D/etc/pk= i/qemu -monitor stdio +qemu-system-i386 [...OPTIONS...] \ + -object tls-creds-x509,id=3Dtls0,dir=3D/etc/pki/qemu,endpoint=3Dserver,v= erify-peer=3Dyes \ + -vnc :1,tls-creds=3Dtls0,password -monitor stdio (qemu) change vnc password Password: ******** (qemu) @@ -1169,7 +1177,9 @@ credentials. This can be enabled, by combining the 's= asl' option with the aforementioned TLS + x509 options: =20 @example -qemu-system-i386 [...OPTIONS...] -vnc :1,tls,x509,sasl -monitor stdio +qemu-system-i386 [...OPTIONS...] \ + -object tls-creds-x509,id=3Dtls0,dir=3D/etc/pki/qemu,endpoint=3Dserver,v= erify-peer=3Dyes \ + -vnc :1,tls-creds=3Dtls0,sasl -monitor stdio @end example =20 @node vnc_setup_sasl --=20 2.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 05:10:30 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 1535360027119932.5609400100486; Mon, 27 Aug 2018 01:53:47 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1FC484E4EE; Mon, 27 Aug 2018 08:53:45 +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 DFEAEA5DC7; Mon, 27 Aug 2018 08:53:44 +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 906034A472; Mon, 27 Aug 2018 08:53:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7R8rRCs006682 for ; Mon, 27 Aug 2018 04:53:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7C3441CC19F; Mon, 27 Aug 2018 08:53:27 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-117-138.ams2.redhat.com [10.36.117.138]) by smtp.corp.redhat.com (Postfix) with ESMTP id 00F771CC4F6; Mon, 27 Aug 2018 08:53:26 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 96D7031E34; Mon, 27 Aug 2018 10:53:21 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 27 Aug 2018 10:53:14 +0200 Message-Id: <20180827085320.9732-7-kraxel@redhat.com> In-Reply-To: <20180827085320.9732-1-kraxel@redhat.com> References: <20180827085320.9732-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: libvir-list@redhat.com, Gerd Hoffmann Subject: [libvirt] [PULL 06/12] vnc: remove support for deprecated tls, x509, x509verify options 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.84 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 27 Aug 2018 08:53:45 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 From: Daniel P. Berrang=C3=A9 The 'tls-creds' option accepts the name of a TLS credentials object. This replaced the usage of 'tls', 'x509' and 'x509verify' options in 2.5.0. These deprecated options were grandfathered in when the deprecation policy was introduded in 2.10.0, so can now finally be removed. Signed-off-by: Daniel P. Berrang=C3=A9 Message-id: 20180725092751.21767-3-berrange@redhat.com Signed-off-by: Gerd Hoffmann --- ui/vnc.c | 91 ------------------------------------------------= ---- qemu-deprecated.texi | 20 ------------ qemu-options.hx | 43 ------------------------- 3 files changed, 154 deletions(-) diff --git a/ui/vnc.c b/ui/vnc.c index 359693238b..fd929b0957 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -3345,10 +3345,6 @@ static QemuOptsList qemu_vnc_opts =3D { .name =3D "tls-creds", .type =3D QEMU_OPT_STRING, },{ - /* Deprecated in favour of tls-creds */ - .name =3D "x509", - .type =3D QEMU_OPT_STRING, - },{ .name =3D "share", .type =3D QEMU_OPT_STRING, },{ @@ -3385,14 +3381,6 @@ static QemuOptsList qemu_vnc_opts =3D { .name =3D "sasl", .type =3D QEMU_OPT_BOOL, },{ - /* Deprecated in favour of tls-creds */ - .name =3D "tls", - .type =3D QEMU_OPT_BOOL, - },{ - /* Deprecated in favour of tls-creds */ - .name =3D "x509verify", - .type =3D QEMU_OPT_STRING, - },{ .name =3D "acl", .type =3D QEMU_OPT_BOOL, },{ @@ -3519,51 +3507,6 @@ vnc_display_setup_auth(int *auth, } =20 =20 -/* - * Handle back compat with old CLI syntax by creating some - * suitable QCryptoTLSCreds objects - */ -static QCryptoTLSCreds * -vnc_display_create_creds(bool x509, - bool x509verify, - const char *dir, - const char *id, - Error **errp) -{ - gchar *credsid =3D g_strdup_printf("tlsvnc%s", id); - Object *parent =3D object_get_objects_root(); - Object *creds; - Error *err =3D NULL; - - if (x509) { - creds =3D object_new_with_props(TYPE_QCRYPTO_TLS_CREDS_X509, - parent, - credsid, - &err, - "endpoint", "server", - "dir", dir, - "verify-peer", x509verify ? "yes" : = "no", - NULL); - } else { - creds =3D object_new_with_props(TYPE_QCRYPTO_TLS_CREDS_ANON, - parent, - credsid, - &err, - "endpoint", "server", - NULL); - } - - g_free(credsid); - - if (err) { - error_propagate(errp, err); - return NULL; - } - - return QCRYPTO_TLS_CREDS(creds); -} - - static int vnc_display_get_address(const char *addrstr, bool websocket, bool reverse, @@ -3930,15 +3873,6 @@ void vnc_display_open(const char *id, Error **errp) credid =3D qemu_opt_get(opts, "tls-creds"); if (credid) { Object *creds; - if (qemu_opt_get(opts, "tls") || - qemu_opt_get(opts, "x509") || - qemu_opt_get(opts, "x509verify")) { - error_setg(errp, - "'tls-creds' parameter is mutually exclusive with " - "'tls', 'x509' and 'x509verify' parameters"); - goto fail; - } - creds =3D object_resolve_path_component( object_get_objects_root(), credid); if (!creds) { @@ -3961,31 +3895,6 @@ void vnc_display_open(const char *id, Error **errp) "Expecting TLS credentials with a server endpoint"); goto fail; } - } else { - const char *path; - bool tls =3D false, x509 =3D false, x509verify =3D false; - tls =3D qemu_opt_get_bool(opts, "tls", false); - if (tls) { - path =3D qemu_opt_get(opts, "x509"); - - if (path) { - x509 =3D true; - } else { - path =3D qemu_opt_get(opts, "x509verify"); - if (path) { - x509 =3D true; - x509verify =3D true; - } - } - vd->tlscreds =3D vnc_display_create_creds(x509, - x509verify, - path, - vd->id, - errp); - if (!vd->tlscreds) { - goto fail; - } - } } acl =3D qemu_opt_get_bool(opts, "acl", false); =20 diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi index 87212b62f2..1b9c007f12 100644 --- a/qemu-deprecated.texi +++ b/qemu-deprecated.texi @@ -40,26 +40,6 @@ which is the default. The ``-no-kvm'' argument is now a synonym for setting ``-machine accel=3Dtcg''. =20 -@subsection -vnc tls (since 2.5.0) - -The ``-vnc tls'' argument is now a synonym for setting -``-object tls-creds-anon,id=3Dtls0'' combined with -``-vnc tls-creds=3Dtls0' - -@subsection -vnc x509 (since 2.5.0) - -The ``-vnc x509=3D/path/to/certs'' argument is now a -synonym for setting -``-object tls-creds-x509,dir=3D/path/to/certs,id=3Dtls0,verify-peer=3Dno'' -combined with ``-vnc tls-creds=3Dtls0' - -@subsection -vnc x509verify (since 2.5.0) - -The ``-vnc x509verify=3D/path/to/certs'' argument is now a -synonym for setting -``-object tls-creds-x509,dir=3D/path/to/certs,id=3Dtls0,verify-peer=3Dyes'' -combined with ``-vnc tls-creds=3Dtls0' - @subsection -tftp (since 2.6.0) =20 The ``-tftp /some/dir'' argument is replaced by either diff --git a/qemu-options.hx b/qemu-options.hx index 5515dfaba5..2417154a70 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -1632,49 +1632,6 @@ 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 -The @option{tls-creds} parameter obsoletes the @option{tls}, -@option{x509}, and @option{x509verify} options, and as such -it is not permitted to set both new and old type options at -the same time. - -@item tls - -Require that client use TLS when communicating with the VNC server. This -uses anonymous TLS credentials so is susceptible to a man-in-the-middle -attack. It is recommended that this option be combined with either the -@option{x509} or @option{x509verify} options. - -This option is now deprecated in favor of using the @option{tls-creds} -argument. - -@item x509=3D@var{/path/to/certificate/dir} - -Valid if @option{tls} is specified. Require that x509 credentials are used -for negotiating the TLS session. The server will send its x509 certificate -to the client. It is recommended that a password be set on the VNC server -to provide authentication of the client when this is used. The path follow= ing -this option specifies where the x509 certificates are to be loaded from. -See the @ref{vnc_security} section for details on generating certificates. - -This option is now deprecated in favour of using the @option{tls-creds} -argument. - -@item x509verify=3D@var{/path/to/certificate/dir} - -Valid if @option{tls} is specified. Require that x509 credentials are used -for negotiating the TLS session. The server will send its x509 certificate -to the client, and request that the client send its own x509 certificate. -The server will validate the client's certificate against the CA certifica= te, -and reject clients when validation fails. If the certificate authority is -trusted, this is a sufficient authentication mechanism. You may still wish -to set a password on the VNC server as a second authentication layer. The -path following this option specifies where the x509 certificates are to -be loaded from. See the @ref{vnc_security} section for details on generati= ng -certificates. - -This option is now deprecated in favour of using the @option{tls-creds} -argument. - @item sasl =20 Require that the client use SASL to authenticate with the VNC server. --=20 2.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 05:10:30 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 1535360011865884.0177123701285; Mon, 27 Aug 2018 01:53:31 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 66472C047B63; Mon, 27 Aug 2018 08:53:29 +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 D6F3317B35; Mon, 27 Aug 2018 08:53: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 9217F4A460; Mon, 27 Aug 2018 08:53:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7R8rQgD006661 for ; Mon, 27 Aug 2018 04:53:26 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8F4C22157F45; Mon, 27 Aug 2018 08:53:26 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-117-138.ams2.redhat.com [10.36.117.138]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4371E2166B41; Mon, 27 Aug 2018 08:53:26 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id A9AD531E35; Mon, 27 Aug 2018 10:53:21 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 27 Aug 2018 10:53:15 +0200 Message-Id: <20180827085320.9732-8-kraxel@redhat.com> In-Reply-To: <20180827085320.9732-1-kraxel@redhat.com> References: <20180827085320.9732-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Cc: libvir-list@redhat.com, Paolo Bonzini , Gerd Hoffmann Subject: [libvirt] [PULL 07/12] spice-display: access ptr_x/ptr_y under Mutex 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.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 27 Aug 2018 08:53:30 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 From: Paolo Bonzini The OpenGL-enabled SPICE code was not accessing the cursor position under the SimpleSpiceDisplay lock. Fix this. Signed-off-by: Paolo Bonzini Reviewed-by: Marc-Andr=C3=A9 Lureau Message-id: 20180720063109.4631-2-pbonzini@redhat.com Signed-off-by: Gerd Hoffmann --- ui/spice-display.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ui/spice-display.c b/ui/spice-display.c index fe734821dd..46df673cd7 100644 --- a/ui/spice-display.c +++ b/ui/spice-display.c @@ -976,8 +976,10 @@ static void qemu_spice_gl_cursor_position(DisplayChang= eListener *dcl, { SimpleSpiceDisplay *ssd =3D container_of(dcl, SimpleSpiceDisplay, dcl); =20 + qemu_mutex_lock(&ssd->lock); ssd->ptr_x =3D pos_x; ssd->ptr_y =3D pos_y; + qemu_mutex_unlock(&ssd->lock); } =20 static void qemu_spice_gl_release_dmabuf(DisplayChangeListener *dcl, @@ -1055,10 +1057,15 @@ static void qemu_spice_gl_update(DisplayChangeListe= ner *dcl, } =20 if (render_cursor) { + int x, y; + qemu_mutex_lock(&ssd->lock); + x =3D ssd->ptr_x; + y =3D ssd->ptr_y; + qemu_mutex_unlock(&ssd->lock); egl_texture_blit(ssd->gls, &ssd->blit_fb, &ssd->guest_fb, !y_0_top); egl_texture_blend(ssd->gls, &ssd->blit_fb, &ssd->cursor_fb, - !y_0_top, ssd->ptr_x, ssd->ptr_y); + !y_0_top, x, y); glFlush(); } =20 --=20 2.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 05:10:30 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 1535360031520636.9834009607056; Mon, 27 Aug 2018 01:53:51 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4ED8430E6842; Mon, 27 Aug 2018 08:53:49 +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 172FDA5DC6; Mon, 27 Aug 2018 08:53:49 +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 BCCA8181A13A; Mon, 27 Aug 2018 08:53:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7R8rUv1006711 for ; Mon, 27 Aug 2018 04:53:30 -0400 Received: by smtp.corp.redhat.com (Postfix) id E36A910EE827; Mon, 27 Aug 2018 08:53:29 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-117-138.ams2.redhat.com [10.36.117.138]) by smtp.corp.redhat.com (Postfix) with ESMTP id 409CD1102E28; Mon, 27 Aug 2018 08:53:26 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id C17AE31E36; Mon, 27 Aug 2018 10:53:21 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 27 Aug 2018 10:53:16 +0200 Message-Id: <20180827085320.9732-9-kraxel@redhat.com> In-Reply-To: <20180827085320.9732-1-kraxel@redhat.com> References: <20180827085320.9732-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Cc: libvir-list@redhat.com, Paolo Bonzini , Gerd Hoffmann Subject: [libvirt] [PULL 08/12] spice-display: fix qemu_spice_cursor_refresh_bh locking 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.84 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Mon, 27 Aug 2018 08:53:50 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 From: Paolo Bonzini spice-display should not call the ui/console.c functions dpy_cursor_define and dpy_moues_set with the SimpleSpiceDisplay lock taken. That will cause a deadlock, because the DisplayChangeListener callbacks will take the lock again. It is also in general a bad idea to invoke generic callbacks with a lock taken, because it can cause AB-BA deadlocks in the long run. The only thing that requires care is that the cursor may disappear as soon as the mutex is released, so you need an extra cursor_get/cursor_put pair. Signed-off-by: Paolo Bonzini Reviewed-by: Marc-Andr=C3=A9 Lureau Message-id: 20180720063109.4631-3-pbonzini@redhat.com [ kraxel: fix dpy_cursor_define() call ] Signed-off-by: Gerd Hoffmann --- ui/spice-display.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/ui/spice-display.c b/ui/spice-display.c index 46df673cd7..7b230987dc 100644 --- a/ui/spice-display.c +++ b/ui/spice-display.c @@ -450,29 +450,35 @@ void qemu_spice_display_switch(SimpleSpiceDisplay *ss= d, qemu_mutex_unlock(&ssd->lock); } =20 -static void qemu_spice_cursor_refresh_unlocked(SimpleSpiceDisplay *ssd) +void qemu_spice_cursor_refresh_bh(void *opaque) { + SimpleSpiceDisplay *ssd =3D opaque; + + qemu_mutex_lock(&ssd->lock); if (ssd->cursor) { + QEMUCursor *c =3D ssd->cursor; assert(ssd->dcl.con); - dpy_cursor_define(ssd->dcl.con, ssd->cursor); + cursor_get(c); + qemu_mutex_unlock(&ssd->lock); + dpy_cursor_define(ssd->dcl.con, c); + qemu_mutex_lock(&ssd->lock); + cursor_put(c); } + if (ssd->mouse_x !=3D -1 && ssd->mouse_y !=3D -1) { + int x, y; assert(ssd->dcl.con); - dpy_mouse_set(ssd->dcl.con, ssd->mouse_x, ssd->mouse_y, 1); + x =3D ssd->mouse_x; + y =3D ssd->mouse_y; ssd->mouse_x =3D -1; ssd->mouse_y =3D -1; + qemu_mutex_unlock(&ssd->lock); + dpy_mouse_set(ssd->dcl.con, x, y, 1); + } else { + qemu_mutex_unlock(&ssd->lock); } } =20 -void qemu_spice_cursor_refresh_bh(void *opaque) -{ - SimpleSpiceDisplay *ssd =3D opaque; - - qemu_mutex_lock(&ssd->lock); - qemu_spice_cursor_refresh_unlocked(ssd); - qemu_mutex_unlock(&ssd->lock); -} - void qemu_spice_display_refresh(SimpleSpiceDisplay *ssd) { graphic_hw_update(ssd->dcl.con); --=20 2.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 05:10:30 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 1535360021204473.53187833489244; Mon, 27 Aug 2018 01:53:41 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CC731308A954; Mon, 27 Aug 2018 08:53:38 +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 54C6C17DCA; Mon, 27 Aug 2018 08:53: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 5F7E2181A12F; Mon, 27 Aug 2018 08:53:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7R8rRQL006666 for ; Mon, 27 Aug 2018 04:53:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id 190B82157F49; Mon, 27 Aug 2018 08:53:27 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-117-138.ams2.redhat.com [10.36.117.138]) by smtp.corp.redhat.com (Postfix) with ESMTP id D0A542166B41; Mon, 27 Aug 2018 08:53:26 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id D5DDE31E37; Mon, 27 Aug 2018 10:53:21 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 27 Aug 2018 10:53:17 +0200 Message-Id: <20180827085320.9732-10-kraxel@redhat.com> In-Reply-To: <20180827085320.9732-1-kraxel@redhat.com> References: <20180827085320.9732-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Cc: libvir-list@redhat.com, Thomas Huth , Gerd Hoffmann Subject: [libvirt] [PULL 09/12] ui/sdl2: Fix broken -full-screen CLI option 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Mon, 27 Aug 2018 08:53:39 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Thomas Huth We've got to set the gui_fullscreen variable before creating the SDL2 window, otherwise the initial window will not be created in fullscreen mode. Buglink: https://bugs.launchpad.net/bugs/1780812 Signed-off-by: Thomas Huth Message-id: 1531161850-6860-1-git-send-email-thuth@redhat.com Signed-off-by: Gerd Hoffmann --- ui/sdl2.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ui/sdl2.c b/ui/sdl2.c index 755a7134ff..0a9a18a964 100644 --- a/ui/sdl2.c +++ b/ui/sdl2.c @@ -790,6 +790,8 @@ static void sdl2_display_init(DisplayState *ds, Display= Options *o) memset(&info, 0, sizeof(info)); SDL_VERSION(&info.version); =20 + gui_fullscreen =3D o->has_full_screen && o->full_screen; + for (i =3D 0;; i++) { QemuConsole *con =3D qemu_console_lookup_by_index(i); if (!con) { @@ -842,17 +844,14 @@ static void sdl2_display_init(DisplayState *ds, Displ= ayOptions *o) g_free(filename); } =20 - if (sdl2_console->opts->has_full_screen && - sdl2_console->opts->full_screen) { - gui_fullscreen =3D 1; + gui_grab =3D 0; + if (gui_fullscreen) { sdl_grab_start(0); } =20 mouse_mode_notifier.notify =3D sdl_mouse_mode_change; qemu_add_mouse_mode_change_notifier(&mouse_mode_notifier); =20 - gui_grab =3D 0; - sdl_cursor_hidden =3D SDL_CreateCursor(&data, &data, 8, 1, 0, 0); sdl_cursor_normal =3D SDL_GetCursor(); =20 --=20 2.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 05:10:30 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 1535360030497183.79933833128075; Mon, 27 Aug 2018 01:53:50 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C98DB4E4CB; Mon, 27 Aug 2018 08:53:48 +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 9327517DCA; Mon, 27 Aug 2018 08:53:48 +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 2FFD04A474; Mon, 27 Aug 2018 08:53:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7R8rRGg006683 for ; Mon, 27 Aug 2018 04:53:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8A03B2027056; Mon, 27 Aug 2018 08:53:27 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-117-138.ams2.redhat.com [10.36.117.138]) by smtp.corp.redhat.com (Postfix) with ESMTP id 481E6202704E; Mon, 27 Aug 2018 08:53:27 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 07C4231E42; Mon, 27 Aug 2018 10:53:22 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 27 Aug 2018 10:53:18 +0200 Message-Id: <20180827085320.9732-11-kraxel@redhat.com> In-Reply-To: <20180827085320.9732-1-kraxel@redhat.com> References: <20180827085320.9732-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Cc: libvir-list@redhat.com, Gerd Hoffmann , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [libvirt] [PULL 10/12] ui/vnc: Remove useless parenthesis around DIV_ROUND_UP macro 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 27 Aug 2018 08:53:49 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 From: Philippe Mathieu-Daud=C3=A9 Patch created mechanically by rerunning: $ spatch --sp-file scripts/coccinelle/round.cocci \ --macro-file scripts/cocci-macro-file.h \ --dir . --in-place Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20180704153919.12432-7-f4bug@amsat.org> Signed-off-by: Gerd Hoffmann --- ui/vnc-enc-tight.c | 2 +- ui/vnc.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ui/vnc-enc-tight.c b/ui/vnc-enc-tight.c index f38aceb4da..0b4a5ac71f 100644 --- a/ui/vnc-enc-tight.c +++ b/ui/vnc-enc-tight.c @@ -979,7 +979,7 @@ static int send_mono_rect(VncState *vs, int x, int y, } #endif =20 - bytes =3D (DIV_ROUND_UP(w, 8)) * h; + bytes =3D DIV_ROUND_UP(w, 8) * h; =20 vnc_write_u8(vs, (stream | VNC_TIGHT_EXPLICIT_FILTER) << 4); vnc_write_u8(vs, VNC_TIGHT_FILTER_PALETTE); diff --git a/ui/vnc.c b/ui/vnc.c index fd929b0957..ccb1335d86 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -2967,7 +2967,8 @@ static int vnc_refresh_server_surface(VncDisplay *vd) PIXMAN_FORMAT_BPP(pixman_image_get_format(vd->guest.fb)); guest_row0 =3D (uint8_t *)pixman_image_get_data(vd->guest.fb); guest_stride =3D pixman_image_get_stride(vd->guest.fb); - guest_ll =3D pixman_image_get_width(vd->guest.fb) * (DIV_ROUND_UP(= guest_bpp, 8)); + guest_ll =3D pixman_image_get_width(vd->guest.fb) + * DIV_ROUND_UP(guest_bpp, 8); } line_bytes =3D MIN(server_stride, guest_ll); =20 --=20 2.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 05:10:30 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 1535360035155922.6839404434646; Mon, 27 Aug 2018 01:53:55 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7447C128D; Mon, 27 Aug 2018 08:53:53 +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 34A29A5DC9; Mon, 27 Aug 2018 08:53:53 +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 9612D181A12D; Mon, 27 Aug 2018 08:53:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7R8rR4d006696 for ; Mon, 27 Aug 2018 04:53:28 -0400 Received: by smtp.corp.redhat.com (Postfix) id D17C62166B41; Mon, 27 Aug 2018 08:53:27 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-117-138.ams2.redhat.com [10.36.117.138]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7A84E2157F45; Mon, 27 Aug 2018 08:53:27 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 24AD393CF1; Mon, 27 Aug 2018 10:53:22 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 27 Aug 2018 10:53:19 +0200 Message-Id: <20180827085320.9732-12-kraxel@redhat.com> In-Reply-To: <20180827085320.9732-1-kraxel@redhat.com> References: <20180827085320.9732-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Cc: libvir-list@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Subject: [libvirt] [PULL 11/12] dmabuf: add y0_top, pass it to spice 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.84 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 27 Aug 2018 08:53:54 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 From: Marc-Andr=C3=A9 Lureau Some scanouts during boot are top-down without it. y0_top is set from VHOST_USER_GPU_DMABUF_SCANOUT code path in the last patch of this series. In current QEMU code base, only vfio/display uses dmabuf API. But the VFIO query interface doesn't provide or need that detail so far. Signed-off-by: Marc-Andr=C3=A9 Lureau Message-Id: <20180713130916.4153-5-marcandre.lureau@redhat.com> Signed-off-by: Gerd Hoffmann --- include/ui/console.h | 1 + ui/spice-display.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/ui/console.h b/include/ui/console.h index 981b519dde..fb969caf70 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -186,6 +186,7 @@ struct QemuDmaBuf { uint32_t stride; uint32_t fourcc; uint32_t texture; + bool y0_top; }; =20 typedef struct DisplayChangeListenerOps { diff --git a/ui/spice-display.c b/ui/spice-display.c index 7b230987dc..2f8adb6b9f 100644 --- a/ui/spice-display.c +++ b/ui/spice-display.c @@ -1056,7 +1056,8 @@ static void qemu_spice_gl_update(DisplayChangeListene= r *dcl, /* note: spice server will close the fd, so hand over a dup */ spice_qxl_gl_scanout(&ssd->qxl, dup(dmabuf->fd), dmabuf->width, dmabuf->height, - dmabuf->stride, dmabuf->fourcc, false); + dmabuf->stride, dmabuf->fourcc, + dmabuf->y0_top); } qemu_spice_gl_monitor_config(ssd, 0, 0, dmabuf->width, dmabuf->hei= ght); ssd->guest_dmabuf_refresh =3D false; --=20 2.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 05:10:30 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 1535360044244460.4701050858671; Mon, 27 Aug 2018 01:54:04 -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 289A930820E1; Mon, 27 Aug 2018 08:54:02 +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 E69445E1A4; Mon, 27 Aug 2018 08:54:01 +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 8351D4A46E; Mon, 27 Aug 2018 08:54:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7R8rV2J006725 for ; Mon, 27 Aug 2018 04:53:31 -0400 Received: by smtp.corp.redhat.com (Postfix) id E983310879B; Mon, 27 Aug 2018 08:53:30 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-117-138.ams2.redhat.com [10.36.117.138]) by smtp.corp.redhat.com (Postfix) with ESMTP id C07CDA9E52; Mon, 27 Aug 2018 08:53:27 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 4387393CF2; Mon, 27 Aug 2018 10:53:22 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 27 Aug 2018 10:53:20 +0200 Message-Id: <20180827085320.9732-13-kraxel@redhat.com> In-Reply-To: <20180827085320.9732-1-kraxel@redhat.com> References: <20180827085320.9732-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: libvir-list@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Subject: [libvirt] [PULL 12/12] util: promote qemu_egl_rendernode_open() to libqemuutil 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.47]); Mon, 27 Aug 2018 08:54:02 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 From: Marc-Andr=C3=A9 Lureau vhost-user-gpu will share the same code to open a DRM node. Signed-off-by: Marc-Andr=C3=A9 Lureau Message-Id: <20180713130916.4153-20-marcandre.lureau@redhat.com> [ kraxel: buildfix: util/drm.o must be CONFIG_OPENGL not CONFIG_LINUX ] Signed-off-by: Gerd Hoffmann --- include/qemu/drm.h | 6 +++++ ui/egl-helpers.c | 51 ++--------------------------------------- util/drm.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++= ++++ MAINTAINERS | 1 + util/Makefile.objs | 1 + 5 files changed, 76 insertions(+), 49 deletions(-) create mode 100644 include/qemu/drm.h create mode 100644 util/drm.c diff --git a/include/qemu/drm.h b/include/qemu/drm.h new file mode 100644 index 0000000000..4c3e622f5c --- /dev/null +++ b/include/qemu/drm.h @@ -0,0 +1,6 @@ +#ifndef QEMU_DRM_H_ +#define QEMU_DRM_H_ + +int qemu_drm_rendernode_open(const char *rendernode); + +#endif diff --git a/ui/egl-helpers.c b/ui/egl-helpers.c index 71b6a97bd1..4f475142fc 100644 --- a/ui/egl-helpers.c +++ b/ui/egl-helpers.c @@ -15,9 +15,7 @@ * License along with this library; if not, see . */ #include "qemu/osdep.h" -#include -#include - +#include "qemu/drm.h" #include "qemu/error-report.h" #include "ui/console.h" #include "ui/egl-helpers.h" @@ -147,57 +145,12 @@ int qemu_egl_rn_fd; struct gbm_device *qemu_egl_rn_gbm_dev; EGLContext qemu_egl_rn_ctx; =20 -static int qemu_egl_rendernode_open(const char *rendernode) -{ - DIR *dir; - struct dirent *e; - int r, fd; - char *p; - - if (rendernode) { - return open(rendernode, O_RDWR | O_CLOEXEC | O_NOCTTY | O_NONBLOCK= ); - } - - dir =3D opendir("/dev/dri"); - if (!dir) { - return -1; - } - - fd =3D -1; - while ((e =3D readdir(dir))) { - if (e->d_type !=3D DT_CHR) { - continue; - } - - if (strncmp(e->d_name, "renderD", 7)) { - continue; - } - - p =3D g_strdup_printf("/dev/dri/%s", e->d_name); - - r =3D open(p, O_RDWR | O_CLOEXEC | O_NOCTTY | O_NONBLOCK); - if (r < 0) { - g_free(p); - continue; - } - fd =3D r; - g_free(p); - break; - } - - closedir(dir); - if (fd < 0) { - return -1; - } - return fd; -} - int egl_rendernode_init(const char *rendernode, DisplayGLMode mode) { qemu_egl_rn_fd =3D -1; int rc; =20 - qemu_egl_rn_fd =3D qemu_egl_rendernode_open(rendernode); + qemu_egl_rn_fd =3D qemu_drm_rendernode_open(rendernode); if (qemu_egl_rn_fd =3D=3D -1) { error_report("egl: no drm render node available"); goto err; diff --git a/util/drm.c b/util/drm.c new file mode 100644 index 0000000000..a23ff24538 --- /dev/null +++ b/util/drm.c @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2015-2016 Gerd Hoffmann + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see . + */ +#include "qemu/osdep.h" +#include "qemu/drm.h" + +#include +#include + +int qemu_drm_rendernode_open(const char *rendernode) +{ + DIR *dir; + struct dirent *e; + int r, fd; + char *p; + + if (rendernode) { + return open(rendernode, O_RDWR | O_CLOEXEC | O_NOCTTY | O_NONBLOCK= ); + } + + dir =3D opendir("/dev/dri"); + if (!dir) { + return -1; + } + + fd =3D -1; + while ((e =3D readdir(dir))) { + if (e->d_type !=3D DT_CHR) { + continue; + } + + if (strncmp(e->d_name, "renderD", 7)) { + continue; + } + + p =3D g_strdup_printf("/dev/dri/%s", e->d_name); + + r =3D open(p, O_RDWR | O_CLOEXEC | O_NOCTTY | O_NONBLOCK); + if (r < 0) { + g_free(p); + continue; + } + fd =3D r; + g_free(p); + break; + } + + closedir(dir); + if (fd < 0) { + return -1; + } + return fd; +} diff --git a/MAINTAINERS b/MAINTAINERS index 6902a568f4..282d6a8ae5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1566,6 +1566,7 @@ S: Odd Fixes F: ui/ F: include/ui/ F: qapi/ui.json +F: util/drm.c =20 Cocoa graphics M: Peter Maydell diff --git a/util/Makefile.objs b/util/Makefile.objs index e1c3fed4dc..4726d262d8 100644 --- a/util/Makefile.objs +++ b/util/Makefile.objs @@ -49,3 +49,4 @@ util-obj-y +=3D stats64.o util-obj-y +=3D systemd.o util-obj-y +=3D iova-tree.o util-obj-$(CONFIG_LINUX) +=3D vfio-helpers.o +util-obj-$(CONFIG_OPENGL) +=3D drm.o --=20 2.9.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list