From nobody Mon Feb 9 17:23:53 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1600777776; cv=none; d=zohomail.com; s=zohoarc; b=H/0vc5OmmBsNtlEKzRn41n/NvFWRmrKjiPdTMo32M7q+35nM0W00HJIinlslmJpweUkKT/KGwZ61pYUYWhD2gJRmgOL2Ma9KixnJoSbOFgXr7IxkIHJpIcsPMIpRGV93+7/OfWRmWKTsc1qq3ahx7qFicoTxxR8XpziCxGCUOjk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600777776; h=Content-Type:Content-Transfer-Encoding:Cc: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=5mm8dJMrQHLexaJPwMCZHNYcPzdmH++9UAIvj20ctjI=; b=Bo1EiNgil4Gxqwd/Xg/Hkar0QI/KQgPgQy2SeXpRh5U9DA7D/7njFH2KgR0SGRRMH4VGn/lX3JmkjTSq+ki9D6NF/JmqiWXrA80UiOmWRnECN0MmK9ZotmiOZbYF9i8BLjEEbm2PLRmg/Cdb6HvgbjrUIn8dpZBqsXNW2d8i8Xw= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1600777776593820.3869248416853; Tue, 22 Sep 2020 05:29:36 -0700 (PDT) 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-398-yW7AtRFrP3imTFHn4Ysrpg-1; Tue, 22 Sep 2020 08:29:32 -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 CC340807341; Tue, 22 Sep 2020 12:29:24 +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 9EF0D7367E; Tue, 22 Sep 2020 12:29:24 +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 67E74922EB; Tue, 22 Sep 2020 12:29:24 +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 08MCTAjg017266 for ; Tue, 22 Sep 2020 08:29:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id B5C452166B28; Tue, 22 Sep 2020 12:29:10 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AFE632156A34 for ; Tue, 22 Sep 2020 12:29:08 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5CF3118AE957 for ; Tue, 22 Sep 2020 12:29:08 +0000 (UTC) Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-524-z-UQSFr3NeScEQOcog7VqQ-1; Tue, 22 Sep 2020 08:29:06 -0400 Received: by mail-lf1-f46.google.com with SMTP id z19so17836258lfr.4 for ; Tue, 22 Sep 2020 05:29:05 -0700 (PDT) Received: from kloomba.my.domain ([5.227.242.255]) by smtp.gmail.com with ESMTPSA id y26sm3715539ljy.88.2020.09.22.05.29.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Sep 2020 05:29:03 -0700 (PDT) X-MC-Unique: yW7AtRFrP3imTFHn4Ysrpg-1 X-MC-Unique: z-UQSFr3NeScEQOcog7VqQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5mm8dJMrQHLexaJPwMCZHNYcPzdmH++9UAIvj20ctjI=; b=RR7pH47iDQs+0VjAnYjtnjiA07bVKVYhKsp4J/431TZffQmGQIOUY97h8KGT1jChj/ pMEdE2bLXhoiWR7GXOKRdkFprLCTOwhCWi1chCzR9ymOhsvS2JF1mMlkk5DQy/LIjb5B sqMHlpvHB7AKVBsWQIU9SIeyNSuWKdL0nAyufiENUYOnOeUSHowLIqdWzTXB3PUL+klm RauDCoxNwxSnuKct160MDRWSN7+T8iHjCxEztmhHdFDDNtB/eqxbkmnf7IqQth/yBFIg En8oLF1YqNXMR1C9XPRElA6OLDrdofmNigtUApgj9+WO0Yh+SAbzt9KPTVoWdflpwilw kMjQ== X-Gm-Message-State: AOAM5329tKCrKlZTn6njoJC2Yl27HKP/gWP/rC+7CHQXg28NaYh6DTpT fdsSZdrdjA54Kjf+waomi90zTXTyYYHazDs/ X-Google-Smtp-Source: ABdhPJxhUOKZZs0LSfmQd+0C9pfhsq6EK1IBSCxjbQkrkhZjboPOfd6Fcpq4AXK+ECciIoue2xN95A== X-Received: by 2002:a19:3f91:: with SMTP id m139mr1476711lfa.416.1600777743847; Tue, 22 Sep 2020 05:29:03 -0700 (PDT) From: Roman Bogorodskiy To: libvir-list@redhat.com Subject: [PATCH v2 2/4] bhyve: add support for setting fbuf resolution Date: Tue, 22 Sep 2020 16:28:49 +0400 Message-Id: <20200922122851.70947-3-bogorodskiy@gmail.com> In-Reply-To: <20200922122851.70947-1-bogorodskiy@gmail.com> References: <20200922122851.70947-1-bogorodskiy@gmail.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false; X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Cc: Fabian Freyer , Roman Bogorodskiy 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Fabian Freyer The resolution of the VNC framebuffer can now be set via the resolution definition introduced in 5.9.0. Also, add "gop" to the list of model types the sub-element is valid for. Signed-off-by: Fabian Freyer Signed-off-by: Roman Bogorodskiy Reviewed-by: Daniel P. Berrang=C3=A9 --- NEWS.rst | 5 +++ docs/formatdomain.rst | 3 +- src/bhyve/bhyve_command.c | 3 ++ src/bhyve/bhyve_parse_command.c | 20 ++++++++++++ .../bhyveargv2xml-vnc-resolution.args | 10 ++++++ .../bhyveargv2xml-vnc-resolution.xml | 24 ++++++++++++++ tests/bhyveargv2xmltest.c | 1 + .../bhyvexml2argv-vnc-resolution.args | 10 ++++++ .../bhyvexml2argv-vnc-resolution.ldargs | 1 + .../bhyvexml2argv-vnc-resolution.xml | 20 ++++++++++++ tests/bhyvexml2argvtest.c | 1 + .../bhyvexml2xmlout-vnc-resolution.xml | 31 +++++++++++++++++++ tests/bhyvexml2xmltest.c | 1 + 13 files changed, 129 insertions(+), 1 deletion(-) create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-vnc-resolution.ar= gs create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-vnc-resolution.xml create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-vnc-resolution.ar= gs create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-vnc-resolution.ld= args create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-vnc-resolution.xml create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc-resolutio= n.xml diff --git a/NEWS.rst b/NEWS.rst index 685c5e2225..bb48f5bd43 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -20,6 +20,11 @@ v6.8.0 (unreleased) attribute of the device's ```` element can be used to disable = the filtering and allow all guest writes to the configuration space. =20 + * bhyve: Support setting the framebuffer resolution + + Libvirt can now set the framebuffer's "w" and "h" parameters + using the ``resolution`` element. + * **Improvements** =20 * qemu: Allow migration over UNIX sockets diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index d5930a4ac1..888db5ea29 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -5822,7 +5822,8 @@ A video device. :since:`Since 5.9.0` , the ``model`` element may also have an optional ``resolution`` sub-element. The ``resolution`` element has attributes `= `x`` and ``y`` to set the minimum resolution for the video device. This - sub-element is valid for model types "vga", "qxl", "bochs", and "virtio= ". + sub-element is valid for model types "vga", "qxl", "bochs", "gop", + and "virtio". =20 ``acceleration`` Configure if video acceleration should be enabled. diff --git a/src/bhyve/bhyve_command.c b/src/bhyve/bhyve_command.c index 4df5baabdf..176a339d5a 100644 --- a/src/bhyve/bhyve_command.c +++ b/src/bhyve/bhyve_command.c @@ -468,6 +468,9 @@ bhyveBuildGraphicsArgStr(const virDomainDef *def, return -1; } =20 + if (video->res) + virBufferAsprintf(&opt, ",w=3D%d,h=3D%d", video->res->x, video->re= s->y); + if (video->driver) virBufferAsprintf(&opt, ",vga=3D%s", virDomainVideoVGAConfTypeToString(video->driver-= >vgaconf)); diff --git a/src/bhyve/bhyve_parse_command.c b/src/bhyve/bhyve_parse_comman= d.c index 388c565317..c6abdfacf3 100644 --- a/src/bhyve/bhyve_parse_command.c +++ b/src/bhyve/bhyve_parse_command.c @@ -621,6 +621,26 @@ bhyveParsePCIFbuf(virDomainDefPtr def, if (virStrToLong_i(param, NULL, 10, &graphics->data.vnc.port)) goto error; } + + if (STRPREFIX(param, "w=3D")) { + param +=3D strlen("w=3D"); + + if (video->res =3D=3D NULL) + video->res =3D g_new0(virDomainVideoResolutionDef, 1); + + if (virStrToLong_uip(param, NULL, 10, &video->res->x)) + goto error; + } + + if (STRPREFIX(param, "h=3D")) { + param +=3D strlen("h=3D"); + + if (video->res =3D=3D NULL) + video->res =3D g_new0(virDomainVideoResolutionDef, 1); + + if (virStrToLong_uip(param, NULL, 10, &video->res->y)) + goto error; + } } =20 cleanup: diff --git a/tests/bhyveargv2xmldata/bhyveargv2xml-vnc-resolution.args b/te= sts/bhyveargv2xmldata/bhyveargv2xml-vnc-resolution.args new file mode 100644 index 0000000000..e5e2c0f2e8 --- /dev/null +++ b/tests/bhyveargv2xmldata/bhyveargv2xml-vnc-resolution.args @@ -0,0 +1,10 @@ +/usr/sbin/bhyve \ +-c 1 \ +-m 214 \ +-u \ +-H \ +-P \ +-s 0:0,hostbridge \ +-l bootrom,/path/to/test.fd \ +-s 2:0,fbuf,tcp=3D127.0.0.1:5904,w=3D1920,h=3D1080 \ +-s 1,lpc bhyve diff --git a/tests/bhyveargv2xmldata/bhyveargv2xml-vnc-resolution.xml b/tes= ts/bhyveargv2xmldata/bhyveargv2xml-vnc-resolution.xml new file mode 100644 index 0000000000..f8fa0ed1ce --- /dev/null +++ b/tests/bhyveargv2xmldata/bhyveargv2xml-vnc-resolution.xml @@ -0,0 +1,24 @@ + + bhyve + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 1 + + hvm + + + destroy + destroy + destroy + + + + + + + diff --git a/tests/bhyveargv2xmltest.c b/tests/bhyveargv2xmltest.c index 0c0383f593..4bf39d50dc 100644 --- a/tests/bhyveargv2xmltest.c +++ b/tests/bhyveargv2xmltest.c @@ -186,6 +186,7 @@ mymain(void) DO_TEST("vnc-vga-on"); DO_TEST("vnc-vga-off"); DO_TEST("vnc-vga-io"); + DO_TEST("vnc-resolution"); =20 virObjectUnref(driver.caps); virObjectUnref(driver.xmlopt); diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-resolution.args b/te= sts/bhyvexml2argvdata/bhyvexml2argv-vnc-resolution.args new file mode 100644 index 0000000000..5e54da6ed7 --- /dev/null +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-resolution.args @@ -0,0 +1,10 @@ +/usr/sbin/bhyve \ +-c 1 \ +-m 214 \ +-u \ +-H \ +-P \ +-s 0:0,hostbridge \ +-l bootrom,/path/to/test.fd \ +-s 1:0,lpc \ +-s 2:0,fbuf,tcp=3D127.0.0.1:5904,w=3D1920,h=3D1080 bhyve diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-resolution.ldargs b/= tests/bhyvexml2argvdata/bhyvexml2argv-vnc-resolution.ldargs new file mode 100644 index 0000000000..421376db9e --- /dev/null +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-resolution.ldargs @@ -0,0 +1 @@ +dummy diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-resolution.xml b/tes= ts/bhyvexml2argvdata/bhyvexml2argv-vnc-resolution.xml new file mode 100644 index 0000000000..637a121fb7 --- /dev/null +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-resolution.xml @@ -0,0 +1,20 @@ + + bhyve + df3be7e7-a104-11e3-aeb0-50e5492bd3dc + 219136 + 1 + + hvm + /path/to/test.fd + + + + + + + + diff --git a/tests/bhyvexml2argvtest.c b/tests/bhyvexml2argvtest.c index 2167cd6310..d4c4275702 100644 --- a/tests/bhyvexml2argvtest.c +++ b/tests/bhyvexml2argvtest.c @@ -197,6 +197,7 @@ mymain(void) DO_TEST("vnc-vgaconf-off"); DO_TEST("vnc-vgaconf-io"); DO_TEST("vnc-autoport"); + DO_TEST("vnc-resolution"); DO_TEST("cputopology"); DO_TEST_FAILURE("cputopology-nvcpu-mismatch"); DO_TEST("commandline"); diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc-resolution.xml b= /tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc-resolution.xml new file mode 100644 index 0000000000..79843531da --- /dev/null +++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc-resolution.xml @@ -0,0 +1,31 @@ + + bhyve + df3be7e7-a104-11e3-aeb0-50e5492bd3dc + 219136 + 219136 + 1 + + hvm + /path/to/test.fd + + + + destroy + restart + destroy + + + +
+ + + + +