From nobody Sat May 4 16:57:55 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.zoho.com; dkim=fail spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1494331307387306.64635935754177; Tue, 9 May 2017 05:01:47 -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 0C05E7F342; Tue, 9 May 2017 12:01:40 +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 A1B2518228; Tue, 9 May 2017 12:01: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 1D0A31841B20; Tue, 9 May 2017 12:00:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v49Bsbeb002588 for ; Tue, 9 May 2017 07:54:37 -0400 Received: by smtp.corp.redhat.com (Postfix) id 47E99783BD; Tue, 9 May 2017 11:54:37 +0000 (UTC) Received: from mx1.redhat.com (ext-mx04.extmail.prod.ext.phx2.redhat.com [10.5.110.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 40DDF783B5 for ; Tue, 9 May 2017 11:54:34 +0000 (UTC) Received: from mail-wr0-f196.google.com (mail-wr0-f196.google.com [209.85.128.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E0EBA8047C for ; Tue, 9 May 2017 11:54:32 +0000 (UTC) Received: by mail-wr0-f196.google.com with SMTP id 6so13059929wrb.1 for ; Tue, 09 May 2017 04:54:32 -0700 (PDT) Received: from localhost.localdomain ([95.104.128.3]) by smtp.gmail.com with ESMTPSA id q123sm2055743ljb.18.2017.05.09.04.54.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 May 2017 04:54:30 -0700 (PDT) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0C05E7F342 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 0C05E7F342 Authentication-Results: mx1.redhat.com; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="M3ZTwXVD" DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E0EBA8047C Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=bogorodskiy@gmail.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com E0EBA8047C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=33cPdIkgZYjIc0uqj/bkVuNsnkLAM4G1fiON1Fx6mTo=; b=M3ZTwXVDoHyvTCIFe+sp7t2YNX2fD3aAi2i0CcwnA/VRm76KAfJh2yDa3KUSVa4Ig2 ul5Di0/2TdGrVre2rEWEIRaGbjizEe5/q17zm+zjxM5OXS6KOjb2/Z4nh9Ls1sguMuFz utiHTfrvDfH++zFozmLJNgEXn/N6MRXNEsigTnKHTRd5vywhxZnC7QGVKh8dRdLy84KJ Tl1NnOP2u5ab7uKKp4TgYJ8MlnRW4YwS5Q2tjDJjAveKHiYp7/zhO4zSRpKwaI+s5FsZ LFe0xkVzu/H7FYth4a71TqTzh1bc1snJH5QOCixF00Rd0VHGAPt6dX2eGRWbsexkK2Wi qlsA== 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; bh=33cPdIkgZYjIc0uqj/bkVuNsnkLAM4G1fiON1Fx6mTo=; b=KO+hp9e84obB0Hg0aoT9KBRmbEpMxW291tP5xal0Vh4lHWCIz1rkVY1KR/o65F0pVX QYRK0HRTbUEcGPKMjHgDNq73+zTWHw1skSnqqQBIPGUiDrvRPTKbLPzZ4Vb+caVsLuVU PiZpYvyd1ZCUn5fru0WHp/a5u0OXw0vY0DYJ9qfFWZN39KD61eBhyjAgilIS1dZPuDkN +JjpXY9AdmP+bGzXVbThCaRs8ms41C6ajD0qvp80q4kjnbhDYEdS5qoJkIFnVFGgCoq5 Ae4S5xy7/N4+hIxgwHzKfw4cSSdVJRsihva6a0wlBfhvL6CTR90tGYWCMDpsgkNQBa0k hQmA== X-Gm-Message-State: AODbwcCEWFbTOq+HBrwZvPqqq6J9BcICw53vkG18hmAMeQT9dAX1jtKN eOyrS6oVF2H6ZCn3 X-Received: by 10.46.32.203 with SMTP id g72mr3352746lji.32.1494330871283; Tue, 09 May 2017 04:54:31 -0700 (PDT) From: Roman Bogorodskiy To: libvir-list@redhat.com Date: Tue, 9 May 2017 15:54:22 +0400 Message-Id: <20170509115422.52951-1-bogorodskiy@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 09 May 2017 11:54:33 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 09 May 2017 11:54:33 +0000 (UTC) for IP:'209.85.128.196' DOMAIN:'mail-wr0-f196.google.com' HELO:'mail-wr0-f196.google.com' FROM:'bogorodskiy@gmail.com' RCPT:'' X-RedHat-Spam-Score: -1.61 (BAYES_50, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, RCVD_IN_SORBS_SPAM, SPF_PASS) 209.85.128.196 mail-wr0-f196.google.com 209.85.128.196 mail-wr0-f196.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.28 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Cc: Roman Bogorodskiy Subject: [libvirt] [PATCH] bhyve: add support for video device configuration 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.26]); Tue, 09 May 2017 12:01:42 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Connect domain XML configuration (introduced in a previous patch) to bhyve command generation. Unfortunately, this option was documented just recently and at the time of writing official online manpages didn't have it updated, so for now one can refer to: https://github.com/freebsd/freebsd/blob/master/usr.sbin/bhyve/bhyve.8#L327 for the detailed description of the possible vga configuration options. Also, add some tests for this new feature. Signed-off-by: Roman Bogorodskiy --- src/bhyve/bhyve_command.c | 4 ++ .../bhyvexml2argv-vnc-vgaconf.args | 12 ++++++ .../bhyvexml2argv-vnc-vgaconf.ldargs | 1 + .../bhyvexml2argv-vnc-vgaconf.xml | 31 ++++++++++++++++ tests/bhyvexml2argvtest.c | 1 + .../bhyvexml2xmlout-vnc-vgaconf.xml | 43 ++++++++++++++++++= ++++ tests/bhyvexml2xmltest.c | 1 + 7 files changed, 93 insertions(+) create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-vnc-vgaconf.args create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-vnc-vgaconf.ldargs create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-vnc-vgaconf.xml create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc-vgaconf.x= ml diff --git a/src/bhyve/bhyve_command.c b/src/bhyve/bhyve_command.c index eae5cb3ca..f70e3bc60 100644 --- a/src/bhyve/bhyve_command.c +++ b/src/bhyve/bhyve_command.c @@ -408,6 +408,10 @@ bhyveBuildGraphicsArgStr(const virDomainDef *def ATTRI= BUTE_UNUSED, _("Unsupported listen type")); } =20 + if (video->driver) + virBufferAsprintf(&opt, ",vga=3D%s", + virDomainVideoVgaconfTypeToString(video->driver-= >vgaconf)); + virCommandAddArg(cmd, "-s"); virCommandAddArgBuffer(cmd, &opt); return 0; diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-vgaconf.args b/tests= /bhyvexml2argvdata/bhyvexml2argv-vnc-vgaconf.args new file mode 100644 index 000000000..70347ee0b --- /dev/null +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-vgaconf.args @@ -0,0 +1,12 @@ +/usr/sbin/bhyve \ +-c 1 \ +-m 214 \ +-u \ +-H \ +-P \ +-s 0:0,hostbridge \ +-l bootrom,/path/to/test.fd \ +-s 2:0,ahci,hd:/tmp/freebsd.img \ +-s 3:0,virtio-net,faketapdev,mac=3D52:54:00:00:00:00 \ +-s 4:0,fbuf,tcp=3D127.0.0.1:5904,vga=3Doff \ +-s 1,lpc bhyve diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-vgaconf.ldargs b/tes= ts/bhyvexml2argvdata/bhyvexml2argv-vnc-vgaconf.ldargs new file mode 100644 index 000000000..421376db9 --- /dev/null +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-vgaconf.ldargs @@ -0,0 +1 @@ +dummy diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-vgaconf.xml b/tests/= bhyvexml2argvdata/bhyvexml2argv-vnc-vgaconf.xml new file mode 100644 index 000000000..f1bcd1bde --- /dev/null +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-vgaconf.xml @@ -0,0 +1,31 @@ + + bhyve + df3be7e7-a104-11e3-aeb0-50e5492bd3dc + 219136 + 1 + + hvm + /path/to/test.fd + + + + + + +
+ + + + +
+ + + + + + + diff --git a/tests/bhyvexml2argvtest.c b/tests/bhyvexml2argvtest.c index c8f8c685a..a369a447a 100644 --- a/tests/bhyvexml2argvtest.c +++ b/tests/bhyvexml2argvtest.c @@ -193,6 +193,7 @@ mymain(void) DO_TEST("net-e1000"); DO_TEST("uefi"); DO_TEST("vnc"); + DO_TEST("vnc-vgaconf"); =20 /* Address allocation tests */ DO_TEST("addr-single-sata-disk"); diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc-vgaconf.xml b/te= sts/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc-vgaconf.xml new file mode 100644 index 000000000..6cc1aa088 --- /dev/null +++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc-vgaconf.xml @@ -0,0 +1,43 @@ + + bhyve + df3be7e7-a104-11e3-aeb0-50e5492bd3dc + 219136 + 219136 + 1 + + hvm + /path/to/test.fd + + + + destroy + restart + destroy + + + + + +
+ + + +
+ + + + + +
+ + + + +