From nobody Sun Feb 8 19:25:13 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1670412070; cv=none; d=zohomail.com; s=zohoarc; b=Fx0P3u6w/yqSgvpqKYcqfuNqLwKJ/oXe4K5U0E21DCat02K3mulFI4eYA51m/7x3/do3rnS+U1JgGAcY73mBOg+0zmpXQn4Y/1HU67I+S+mDR5VKpOu70CHQJGmVDpgC+zjvxMJFRfHszztFzjKEoa+iAC0A3q2viZBAiyagmkA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1670412070; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Bcae+m2dEhs4NqPJP2xj/qgb1nEN7zxjBDBJHwZ9S18=; b=IRRCAbwfz4WV5m2EPJJaFyhQMEkjgyxVC4jlgXoPgovPeEdf1M6cDpXQaovosAnFgsm/0m/jlXFXwaNhSFrADme6v8b1J6zIhpxm0qUq2SJslBTQDOpVRhNfroWC/ZEHw1rhMVIrKTAseKa1lQcFnN9cfLU3zGBzUrRVdRjXaVA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1670412070071474.71050737009807; Wed, 7 Dec 2022 03:21:10 -0800 (PST) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-649-c2bVsdCCP76_qjzeqCu2UQ-1; Wed, 07 Dec 2022 06:21:05 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3997A3C0ED40; Wed, 7 Dec 2022 11:21:01 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 241CD9E70; Wed, 7 Dec 2022 11:21:01 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 08DDF19465B2; Wed, 7 Dec 2022 11:21:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 5EE461946A66 for ; Wed, 7 Dec 2022 11:20:57 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 4452547505F; Wed, 7 Dec 2022 11:20:57 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id DD66C47505E for ; Wed, 7 Dec 2022 11:20:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670412069; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Bcae+m2dEhs4NqPJP2xj/qgb1nEN7zxjBDBJHwZ9S18=; b=UiG51A1gfytEzNPiNI8ttbARcVVqAaswDileEwTONAU57zRblQGw+nsREI+JvUGOKy/Usf t9X6oixiHDz65Nas9wwub9AnLaDfYLLn6C0MF0H58DjXgn6xLsHTbzuKGUjBBK7BIZYOlt ljIJS681upflM40alRIwrLDCe1Ax0aU= X-MC-Unique: c2bVsdCCP76_qjzeqCu2UQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 4/5] qemu: Prefer PNG for domain screenshots Date: Wed, 7 Dec 2022 12:20:52 +0100 Message-Id: <8aa68499b0257481bf9a65eca0ed7961effd227b.1670411966.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1670412071548100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Historically, QEMU took screenshots in PPM. While this might use to be popular format, as of v7.1.0-rc0~125^2~6 it is possible to take screenshots in PNG. This is more popular and renders almost everywhere, which is not the case for PPM (for instance, modern browsers do not render it). Signed-off-by: Michal Privoznik --- src/qemu/qemu_driver.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index f6683cbb0a..d509582719 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -3291,6 +3291,7 @@ qemuDomainScreenshot(virDomainPtr dom, const char *videoAlias =3D NULL; char *ret =3D NULL; bool unlink_tmp =3D false; + const char *format =3D NULL; =20 virCheckFlags(0, NULL); =20 @@ -3339,6 +3340,10 @@ qemuDomainScreenshot(virDomainPtr dom, } } =20 + if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_SCREENSHOT_FORMAT_PNG)) { + format =3D "png"; + } + tmp =3D g_strdup_printf("%s/qemu.screendump.XXXXXX", priv->libDir); =20 if ((tmp_fd =3D g_mkstemp_full(tmp, O_RDWR | O_CLOEXEC, S_IRUSR | S_IW= USR)) =3D=3D -1) { @@ -3350,7 +3355,7 @@ qemuDomainScreenshot(virDomainPtr dom, qemuSecurityDomainSetPathLabel(driver, vm, tmp, false); =20 qemuDomainObjEnterMonitor(vm); - if (qemuMonitorScreendump(priv->mon, videoAlias, screen, NULL, tmp) < = 0) { + if (qemuMonitorScreendump(priv->mon, videoAlias, screen, format, tmp) = < 0) { qemuDomainObjExitMonitor(vm); goto endjob; } @@ -3367,7 +3372,11 @@ qemuDomainScreenshot(virDomainPtr dom, goto endjob; } =20 - ret =3D g_strdup("image/x-portable-pixmap"); + if (STREQ_NULLABLE(format, "png")) { + ret =3D g_strdup("image/png"); + } else { + ret =3D g_strdup("image/x-portable-pixmap"); + } =20 endjob: VIR_FORCE_CLOSE(tmp_fd); --=20 2.37.4