From nobody Sun May 19 05:00:09 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1628598013271493.8399795622396; Tue, 10 Aug 2021 05:20:13 -0700 (PDT) Received: from localhost ([::1]:42920 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mDQjr-0007ss-Se for importer@patchew.org; Tue, 10 Aug 2021 08:20:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54414) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mDQid-0005py-0j for qemu-devel@nongnu.org; Tue, 10 Aug 2021 08:18:55 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:35572) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mDQib-0008SY-Fp for qemu-devel@nongnu.org; Tue, 10 Aug 2021 08:18:54 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-226-97QHzc0lM5u9C5kGKYrzjA-1; Tue, 10 Aug 2021 08:18:50 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1CD59107B7C9; Tue, 10 Aug 2021 12:18:50 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.193.3]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9725227CB4; Tue, 10 Aug 2021 12:18:41 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 1110A180090A; Tue, 10 Aug 2021 14:18:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628597932; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8r3eYRdG4xCeVqgSnlzgLLnXlLUpiu0JT/71pkLJV9U=; b=MoxLCMuKnjgdsAZB6QYGgclbSEbZoXkyeVjAsuzWXj24nWz1gNRR+rHo8J/De0OQvycg8r 0fDzX7CMUrooJ6Y6D7X9MeAafx1bty+cjU40PmDNXnY2Lmrlz35hFJ+PezEsgXNeHhIfim S4y2jxA04Vq+cqIbNxfmENqBvHcnec8= X-MC-Unique: 97QHzc0lM5u9C5kGKYrzjA-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 1/3] ui/gtk: retry sending VTE console input Date: Tue, 10 Aug 2021 14:18:37 +0200 Message-Id: <20210810121840.2525726-2-kraxel@redhat.com> In-Reply-To: <20210810121840.2525726-1-kraxel@redhat.com> References: <20210810121840.2525726-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.704, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Volker=20R=C3=BCmelin?= , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1628598015256100001 From: Volker R=C3=BCmelin Commit 584af1f1d9 ("ui/gtk: add a keyboard fifo to the VTE consoles") changed the VTE chardev backend code to rely on the chr_accept_input() callback function. The code expects a chr_accept_input() call whenever qemu_chr_be_can_write() bytes were written. It turns out this is wrong. Some chardev frontends only call this callback after can_write was 0. Change the code to send data until the keyboard fifo is empty or qemu_chr_be_can_write() returns 0. Fixes: 584af1f1d9 ("ui/gtk: add a keyboard fifo to the VTE consoles") Signed-off-by: Volker R=C3=BCmelin Reviewed-by: Marc-Andr=C3=A9 Lureau Message-Id: <20210810063257.17411-1-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann --- ui/gtk.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ui/gtk.c b/ui/gtk.c index 974e4dfc0b5b..cfb0728d1fb4 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -1646,16 +1646,14 @@ static void gd_vc_send_chars(VirtualConsole *vc) =20 len =3D qemu_chr_be_can_write(vc->vte.chr); avail =3D fifo8_num_used(&vc->vte.out_fifo); - if (len > avail) { - len =3D avail; - } - while (len > 0) { + while (len > 0 && avail > 0) { const uint8_t *buf; uint32_t size; =20 - buf =3D fifo8_pop_buf(&vc->vte.out_fifo, len, &size); + buf =3D fifo8_pop_buf(&vc->vte.out_fifo, MIN(len, avail), &size); qemu_chr_be_write(vc->vte.chr, (uint8_t *)buf, size); - len -=3D size; + len =3D qemu_chr_be_can_write(vc->vte.chr); + avail -=3D size; } } =20 --=20 2.31.1 From nobody Sun May 19 05:00:09 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1628598136509112.34821207331117; Tue, 10 Aug 2021 05:22:16 -0700 (PDT) Received: from localhost ([::1]:48852 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mDQlr-0003wl-F8 for importer@patchew.org; Tue, 10 Aug 2021 08:22:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54432) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mDQid-0005rQ-QZ for qemu-devel@nongnu.org; Tue, 10 Aug 2021 08:18:55 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:58693) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mDQic-0008UY-A4 for qemu-devel@nongnu.org; Tue, 10 Aug 2021 08:18:55 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-602-FByqVoTBOX-OTbHe85mCug-1; Tue, 10 Aug 2021 08:18:52 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id E2E758799E0 for ; Tue, 10 Aug 2021 12:18:51 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.193.3]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C54535D9C6; Tue, 10 Aug 2021 12:18:47 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 1D412180091B; Tue, 10 Aug 2021 14:18:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628597933; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VrF5GUVBZcVPiyF/VpPpNRjyYFAFB5kO45k7KvRFhmQ=; b=JoyCekM5jmwRrzGQ99TgRtoill2bGEcXo/vuo67hFBRTwl0gpqJ3S+f1OY1m6Vgth9rF4h eUkcmvpLp0Jq0wqLE2DcGU+MlbMNBZzjP3SFrAkELjbCgJK4FZVkvm3F97H0Bh0wwwPjWP Q4vV4tFO9/hQG9W2cqJH8QgFJRwdA9A= X-MC-Unique: FByqVoTBOX-OTbHe85mCug-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 2/3] audio: Never send migration section Date: Tue, 10 Aug 2021 14:18:38 +0200 Message-Id: <20210810121840.2525726-3-kraxel@redhat.com> In-Reply-To: <20210810121840.2525726-1-kraxel@redhat.com> References: <20210810121840.2525726-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.704, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Gerd Hoffmann , "Dr. David Alan Gilbert" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1628598137864100001 From: "Dr. David Alan Gilbert" The audio migration vmstate is empty, and always has been; we can't just remove it though because an old qemu might send it us. Changes with -audiodev now mean it's sometimes created when it didn't used to be, and can confuse migration to old qemu. Change it so that vmstate_audio is never sent; if it's received it should still be accepted, and old qemu's shouldn't be too upset if it's missing. Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Daniel P. Berrang=C3=A9 Tested-by: Daniel P. Berrang=C3=A9 Message-Id: <20210809170956.78536-1-dgilbert@redhat.com> Signed-off-by: Gerd Hoffmann --- audio/audio.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/audio/audio.c b/audio/audio.c index 59453ef85673..54a153c0ef07 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -1622,10 +1622,20 @@ void audio_cleanup(void) } } =20 +static bool vmstate_audio_needed(void *opaque) +{ + /* + * Never needed, this vmstate only exists in case + * an old qemu sends it to us. + */ + return false; +} + static const VMStateDescription vmstate_audio =3D { .name =3D "audio", .version_id =3D 1, .minimum_version_id =3D 1, + .needed =3D vmstate_audio_needed, .fields =3D (VMStateField[]) { VMSTATE_END_OF_LIST() } --=20 2.31.1 From nobody Sun May 19 05:00:09 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1628598222064966.4694342771461; Tue, 10 Aug 2021 05:23:42 -0700 (PDT) Received: from localhost ([::1]:52360 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mDQnF-0006N9-1h for importer@patchew.org; Tue, 10 Aug 2021 08:23:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54436) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mDQie-0005sY-Ek for qemu-devel@nongnu.org; Tue, 10 Aug 2021 08:18:56 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:51213) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mDQid-0008VL-2M for qemu-devel@nongnu.org; Tue, 10 Aug 2021 08:18:56 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-292-fFe_qDwBOyms_CrlpXZG8Q-1; Tue, 10 Aug 2021 08:18:52 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 20F90107B7C8; Tue, 10 Aug 2021 12:18:52 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.193.3]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D1DF581F73; Tue, 10 Aug 2021 12:18:51 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 2831A180092B; Tue, 10 Aug 2021 14:18:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628597934; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SkeA9963fvICt6ND8XDfTgGy1x/kapYUXHTh6Eheow4=; b=btYhsm/nK7dUKozDIVB8LumtD0r5e2fcH03UuDpqdMM7jzlK1Bg4k/9Q3ABidLrbLgXYp9 EaIejLOy3kdvPPaXRabnA1LHwFXuRxK9JuIAz6Ik6v31zJ8u9AYjYha8xTiCZywFqQ8yGI fazCqdGEWU2vqDAmNDFcM+tHjGMbZCo= X-MC-Unique: fFe_qDwBOyms_CrlpXZG8Q-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 3/3] ui/sdl2: Check return value from g_setenv() Date: Tue, 10 Aug 2021 14:18:39 +0200 Message-Id: <20210810121840.2525726-4-kraxel@redhat.com> In-Reply-To: <20210810121840.2525726-1-kraxel@redhat.com> References: <20210810121840.2525726-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.704, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1628598224197100001 Content-Type: text/plain; charset="utf-8" From: Peter Maydell Setting environment variables can fail; check the return value from g_setenv() and bail out if we couldn't set SDL_VIDEODRIVER. Fixes: Coverity 1458798 Signed-off-by: Peter Maydell Message-Id: <20210809161424.32355-1-peter.maydell@linaro.org> Signed-off-by: Gerd Hoffmann --- ui/sdl2.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ui/sdl2.c b/ui/sdl2.c index 36d9010cb6c1..17c0ec30ebff 100644 --- a/ui/sdl2.c +++ b/ui/sdl2.c @@ -817,7 +817,10 @@ static void sdl2_display_init(DisplayState *ds, Displa= yOptions *o) * This is a bit hackish but saves us from bigger problem. * Maybe it's a good idea to fix this in SDL instead. */ - g_setenv("SDL_VIDEODRIVER", "x11", 0); + if (!g_setenv("SDL_VIDEODRIVER", "x11", 0)) { + fprintf(stderr, "Could not set SDL_VIDEODRIVER environment variabl= e\n"); + exit(1); + } #endif =20 if (SDL_Init(SDL_INIT_VIDEO)) { --=20 2.31.1