From nobody Sun Feb 8 22:18:23 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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.133.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=1670412065; cv=none; d=zohomail.com; s=zohoarc; b=JqOnN+QoiAj+bdm8JOUNPhcVmHNvid3l9D8gm6UVsUIt0+T5h/XQaPsBCFxgiTfA45Sv4p1I8sICYYzv8eIFzifV4njo4AkUKoGlw28knJxjQb84xQPFi5VYHvdToS0FHakWuLmp3OKRWKbdaVpQq3UltUADarj9peq6yBGOw5w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1670412065; 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=QOTucSY4hU+fGbMXsT8+Zewy53/e5QEBB0DC+LReLJQ=; b=JwrdgCLNDaJT7xY9rGpXGOPJ1vw5AZQY5t4idf2B6Jl2g0G1IoVeWK3kZOVfIUhoYoJLTWarZPTOLT965Szdfzeelbs99PRAdY7quD78IZqL1nsrjmZ676x4NC8zTv44K4ur84TBHxIy7oO9+inYVtEq6Ao1u1ozAm0j2QapnAY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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.133.124]) by mx.zohomail.com with SMTPS id 1670412065945189.8157619579274; Wed, 7 Dec 2022 03:21:05 -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-110-uX8hIHhLMGemUPa91dV2IQ-1; Wed, 07 Dec 2022 06:21:03 -0500 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B56351C0757F; Wed, 7 Dec 2022 11:20:58 +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 998A6492B04; Wed, 7 Dec 2022 11:20:58 +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 BA08319465B9; Wed, 7 Dec 2022 11:20:57 +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 BDCA419465B1 for ; Wed, 7 Dec 2022 11:20:56 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id A462B47505E; Wed, 7 Dec 2022 11:20:56 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 49D5447505F 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=1670412065; 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=QOTucSY4hU+fGbMXsT8+Zewy53/e5QEBB0DC+LReLJQ=; b=PqtK3J9rGQR2n/xRYbtB3Y5+HmQrL1xMiviD7yEkMvqmW6oCl4Mpwowx0YWkn7uqLfFTso GBOnUVXEcIVAVikBRz6NzjYxh/lEhnXpcg2tm/Ldi9J7lygBYK6xG+WDwNlKiUqsSDTMKV x3YeinO5JzGV1nJUSJXLcsUzdOKd4Ek= X-MC-Unique: uX8hIHhLMGemUPa91dV2IQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 3/5] qemu_monitor: Extend qemuMonitorScreendump() for @format Date: Wed, 7 Dec 2022 12:20:51 +0100 Message-Id: <3bf4477273a2eac4ef854486c471013ef0d61f06.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.10 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: 1670412067504100002 Content-Type: text/plain; charset="utf-8"; x-default="true" The 'screendump' command has new argument 'format'. Let's expose this on our QMP level so that callers can specify the format, if they wish so. Signed-off-by: Michal Privoznik --- src/qemu/qemu_driver.c | 2 +- src/qemu/qemu_monitor.c | 7 ++++--- src/qemu/qemu_monitor.h | 1 + src/qemu/qemu_monitor_json.c | 2 ++ src/qemu/qemu_monitor_json.h | 1 + tests/qemumonitorjsontest.c | 2 +- 6 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 25a1f6e0fd..f6683cbb0a 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -3350,7 +3350,7 @@ qemuDomainScreenshot(virDomainPtr dom, qemuSecurityDomainSetPathLabel(driver, vm, tmp, false); =20 qemuDomainObjEnterMonitor(vm); - if (qemuMonitorScreendump(priv->mon, videoAlias, screen, tmp) < 0) { + if (qemuMonitorScreendump(priv->mon, videoAlias, screen, NULL, tmp) < = 0) { qemuDomainObjExitMonitor(vm); goto endjob; } diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index e697ef2518..734364e070 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -2853,14 +2853,15 @@ int qemuMonitorScreendump(qemuMonitor *mon, const char *device, unsigned int head, + const char *format, const char *file) { - VIR_DEBUG("device=3D%s head=3D%u file=3D%s", - device, head, file); + VIR_DEBUG("device=3D%s head=3D%u format=3D%s file=3D%s", + device, head, NULLSTR(format), file); =20 QEMU_CHECK_MONITOR(mon); =20 - return qemuMonitorJSONScreendump(mon, device, head, file); + return qemuMonitorJSONScreendump(mon, device, head, format, file); } =20 =20 diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index c690fc3655..906a919f52 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -987,6 +987,7 @@ int qemuMonitorInjectNMI(qemuMonitor *mon); int qemuMonitorScreendump(qemuMonitor *mon, const char *device, unsigned int head, + const char *format, const char *file); =20 int qemuMonitorSendKey(qemuMonitor *mon, diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 39f313c2af..9822097bd7 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -4151,6 +4151,7 @@ int qemuMonitorJSONSendKey(qemuMonitor *mon, int qemuMonitorJSONScreendump(qemuMonitor *mon, const char *device, unsigned int head, + const char *format, const char *file) { g_autoptr(virJSONValue) cmd =3D NULL; @@ -4160,6 +4161,7 @@ int qemuMonitorJSONScreendump(qemuMonitor *mon, "s:filename", file, "S:device", device, "p:head", head, + "S:format", format, NULL); =20 if (!cmd) diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index 93789480c5..484cb09830 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -337,6 +337,7 @@ int qemuMonitorJSONScreendump(qemuMonitor *mon, const char *device, unsigned int head, + const char *format, const char *file); =20 int diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 238c6c1813..59f7322711 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -1212,7 +1212,7 @@ GEN_TEST_FUNC(qemuMonitorJSONDelDevice, "ide0") GEN_TEST_FUNC(qemuMonitorJSONBlockdevMirror, "jobname", true, "vdb", "targ= etnode", 1024, 1234, 31234, true, true) GEN_TEST_FUNC(qemuMonitorJSONBlockStream, "vdb", "jobname", "backingnode",= "backingfilename", 1024) GEN_TEST_FUNC(qemuMonitorJSONBlockCommit, "vdb", "jobname", "topnode", "ba= senode", "backingfilename", 1024) -GEN_TEST_FUNC(qemuMonitorJSONScreendump, "devicename", 1, "/foo/bar") +GEN_TEST_FUNC(qemuMonitorJSONScreendump, "devicename", 1, NULL, "/foo/bar") GEN_TEST_FUNC(qemuMonitorJSONOpenGraphics, "spice", "spicefd", false) GEN_TEST_FUNC(qemuMonitorJSONNBDServerAdd, "vda", "export", true, "bitmap") GEN_TEST_FUNC(qemuMonitorJSONDetachCharDev, "serial1") --=20 2.37.4