From nobody Fri Apr 26 00:17:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.25 as permitted sender) client-ip=209.132.183.25; envelope-from=libvir-list-bounces@redhat.com; helo=mx4-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.25 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) by mx.zohomail.com with SMTPS id 1486912597737298.4302727683564; Sun, 12 Feb 2017 07:16:37 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v1CFD36W027398; Sun, 12 Feb 2017 10:13:03 -0500 Received: from smtp.corp.redhat.com (int-mx16.intmail.prod.int.phx2.redhat.com [10.5.11.28]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v1CFCxpG024754 for ; Sun, 12 Feb 2017 10:12:59 -0500 Received: by smtp.corp.redhat.com (Postfix) id BCB022F6374; Sun, 12 Feb 2017 15:12:59 +0000 (UTC) Received: from mx1.redhat.com (ext-mx02.extmail.prod.ext.phx2.redhat.com [10.5.110.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B67B02D5DE for ; Sun, 12 Feb 2017 15:12:59 +0000 (UTC) Received: from mail-lf0-f65.google.com (mail-lf0-f65.google.com [209.85.215.65]) (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 9B59D7E9EA for ; Sun, 12 Feb 2017 15:12:58 +0000 (UTC) Received: by mail-lf0-f65.google.com with SMTP id q89so6567477lfi.1 for ; Sun, 12 Feb 2017 07:12:57 -0800 (PST) Received: from kloomba.my.domain ([95.104.139.40]) by smtp.gmail.com with ESMTPSA id h9sm1414489ljb.51.2017.02.12.07.12.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 Feb 2017 07:12:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=DjvZee8uMkBhV95367MDRxUFelyYu/Z90DHm+lp0dA0=; b=BUagrI1WPBs30OiQfwXtY1OGDndxswX3ICeFh3lAbi7XeFTYEIJxNLA1yxBG60A7y/ yGsMUr0Gwro+Oo5aYmST8r3eeK6+H5lk+CZ41jG9L90NrrNUmUFMn8XcfmFAnFaLk13q 3d1VvQ/1U1vTZTHhQyQDLZYGmwrZUe2rAuQKjP5oRz44ZrEZ1b4CPlysNUaIOXHVPFn6 AM8XyHqZO5CfnIqC3trXp/IemCK3laTcQ1FLhkpfrbH1Tb9KhW2Wh51EVMaF9O/xh/ft YGLb/2cF2xy0RUenT8jFGwvLUAPHUNe2SOsM5rofLxWcsrhDBnDevotGW9o3zL6zrEf1 ZMSQ== 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; bh=DjvZee8uMkBhV95367MDRxUFelyYu/Z90DHm+lp0dA0=; b=NrHTU4FBXbEcEpnqe9UgodNg+QrkmijIGqfVEATn0OHPnvm9cOD0v/4XYMs0rYaY74 2wBBLM8dJtxQ5Tw1IxFPqLBADS1P3JLOJVgnhFuBLO9OxWuUeRHT/c3xN4sByBxx9Vlk Ud9TcWjIQvhFOCd+FXtOkiKWelOsCqitm0jKw9LK7+JeQZaVJMrHAVE1RkTb8FWFU2hX gM75VENECdqgtNkzYgc/NRIRbv0eHA7eysTPNszgi5NMjznKvIi/2sbeQc+U2NHSvV0p tmHOONUbCLbJzkpWRZlZO3QmrYFjak9vkTMMwzdq8LH+SbaseO875vcoa4194hNFJXa7 ZpZA== X-Gm-Message-State: AMke39nrepsl/kf/cVM43oNG/OEb0nUQIRgeMwO+gZrjyUMPPZ5MEgCkrL9Kkbg0t0Mnsg== X-Received: by 10.46.9.23 with SMTP id 23mr1588365ljj.134.1486912375866; Sun, 12 Feb 2017 07:12:55 -0800 (PST) From: Roman Bogorodskiy To: libvir-list@redhat.com Date: Sun, 12 Feb 2017 19:12:29 +0400 Message-Id: <20170212151234.25936-2-bogorodskiy@gmail.com> In-Reply-To: <20170212151234.25936-1-bogorodskiy@gmail.com> References: <20170212151234.25936-1-bogorodskiy@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Sun, 12 Feb 2017 15:12:59 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Sun, 12 Feb 2017 15:12:59 +0000 (UTC) for IP:'209.85.215.65' DOMAIN:'mail-lf0-f65.google.com' HELO:'mail-lf0-f65.google.com' FROM:'bogorodskiy@gmail.com' RCPT:'' X-RedHat-Spam-Score: 1.17 * (BAYES_50, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_SPAM, SPF_PASS) 209.85.215.65 mail-lf0-f65.google.com 209.85.215.65 mail-lf0-f65.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.26 X-Scanned-By: MIMEDefang 2.74 on 10.5.11.28 X-loop: libvir-list@redhat.com Cc: Fabian Freyer Subject: [libvirt] [PATCH 1/6] bhyve: virBhyveProbeCaps: BHYVE_CAP_LPC_BOOTROM 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-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Fabian Freyer Implement the BHACE_CAP_LPC_BOOTROM capability by checking the stderr output of 'bhyve -l bootrom'. If the bootrom option is unsupported, this will contain the following output: bhyve: invalid lpc device configuration 'bootrom' On newer bhyve versions that do support specifying a bootrom image, the standard help will be printed. --- src/bhyve/bhyve_capabilities.c | 25 +++++++++++++++++++++++++ src/bhyve/bhyve_capabilities.h | 1 + 2 files changed, 26 insertions(+) diff --git a/src/bhyve/bhyve_capabilities.c b/src/bhyve/bhyve_capabilities.c index 1dc0593af..13b4835a8 100644 --- a/src/bhyve/bhyve_capabilities.c +++ b/src/bhyve/bhyve_capabilities.c @@ -239,6 +239,28 @@ bhyveProbeCapsNetE1000(unsigned int *caps, char *binar= y) return ret; } =20 +static int +bhyveProbeCapsLPC_Bootrom(unsigned int *caps, char *binary) +{ + char *error; + virCommandPtr cmd =3D NULL; + int ret =3D -1, exit; + + cmd =3D virCommandNew(binary); + virCommandAddArgList(cmd, "-l", "bootrom", NULL); + virCommandSetErrorBuffer(cmd, &error); + if (virCommandRun(cmd, &exit) < 0) + goto cleanup; + + if (strstr(error, "bhyve: invalid lpc device configuration 'bootrom'")= =3D=3D NULL) + *caps |=3D BHYVE_CAP_LPC_BOOTROM; + + cleanup: + VIR_FREE(error); + virCommandFree(cmd); + return ret; +} + int virBhyveProbeCaps(unsigned int *caps) { @@ -260,6 +282,9 @@ virBhyveProbeCaps(unsigned int *caps) if ((ret =3D bhyveProbeCapsNetE1000(caps, binary))) goto out; =20 + if ((ret =3D bhyveProbeCapsLPC_Bootrom(caps, binary))) + goto out; + out: VIR_FREE(binary); return ret; diff --git a/src/bhyve/bhyve_capabilities.h b/src/bhyve/bhyve_capabilities.h index 690feadb8..746c77181 100644 --- a/src/bhyve/bhyve_capabilities.h +++ b/src/bhyve/bhyve_capabilities.h @@ -40,6 +40,7 @@ typedef enum { BHYVE_CAP_RTC_UTC =3D 1 << 0, BHYVE_CAP_AHCI32SLOT =3D 1 << 1, BHYVE_CAP_NET_E1000 =3D 1 << 2, + BHYVE_CAP_LPC_BOOTROM =3D 1 << 3, } virBhyveCapsFlags; =20 int virBhyveProbeGrubCaps(virBhyveGrubCapsFlags *caps); --=20 2.11.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 00:17:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.37 as permitted sender) client-ip=209.132.183.37; envelope-from=libvir-list-bounces@redhat.com; helo=mx5-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.37 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx5-phx2.redhat.com (mx5-phx2.redhat.com [209.132.183.37]) by mx.zohomail.com with SMTPS id 1486912602836371.4707913210101; Sun, 12 Feb 2017 07:16:42 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx5-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1CFD24V059109; Sun, 12 Feb 2017 10:13:02 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v1CFD1in024764 for ; Sun, 12 Feb 2017 10:13:01 -0500 Received: from mx1.redhat.com (ext-mx09.extmail.prod.ext.phx2.redhat.com [10.5.110.38]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1CFD1S5012985 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Sun, 12 Feb 2017 10:13:01 -0500 Received: from mail-lf0-f66.google.com (mail-lf0-f66.google.com [209.85.215.66]) (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 D82494E4D1 for ; Sun, 12 Feb 2017 15:12:59 +0000 (UTC) Received: by mail-lf0-f66.google.com with SMTP id q89so6567498lfi.1 for ; Sun, 12 Feb 2017 07:12:58 -0800 (PST) Received: from kloomba.my.domain ([95.104.139.40]) by smtp.gmail.com with ESMTPSA id h9sm1414489ljb.51.2017.02.12.07.12.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 Feb 2017 07:12:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Z6uoxWHrC6ylE+Uxi0sc2GBF+a1ph1jtnvMdge2kAds=; b=d//kZ1+RSoMory6QehIkq4YzmlE28FefUlrBUPP48J1RXIG5H36MLYDk2rW85aV3e2 hxeE1qafLkoZLrX+2pPdst2+Hump2ns7l0qk6wksz9Pgy8e6oT9iJFvgPLmceQQQ6ZjR vl06tG1MvwBYa9/z4VH+LzQA9LaQYyRf3CG9C+FYO2CF/keUHBH+vBY1pD6pC/LXDyzT 4tJMzeFy9Y927TLZZySruHrGr3m+kkJCEbT7apFJp3JYV8ktDthCQy8f8EAhHHiSImwF Qcv77L0BDu+SnMvp45Yjv4RjDlDthMKzLgSidBML8E+aPjHpSbzXxnhzRahvLdi9xhA1 h+Ew== 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; bh=Z6uoxWHrC6ylE+Uxi0sc2GBF+a1ph1jtnvMdge2kAds=; b=CZmJ62wi4cwk9vm/viE4j9QzfebgUkEYybqp0eLqgU6I3qHnzGksQgqpWf9WxwmrN+ 4Hle17r7FsvKYEuezS+LHpTY2oS6R0T+bmN3OPF7q2zdL9ZJivjtKEpzDqToBYmcYIgn /P4yljc/bVDsGwaWt0VEW02OTQyn49cYmlQgJZukn6D8sm3hIhIwHfedpcBx/3NSD+3T OosBGPHM5Uy0JgTEx8+CnhansFX5AQq3eglGjsD6vK8uhA65pNgt8NwpVUlcxzPpbXXP RCvZl4JCjtFijWO1Ae9GruWLgZfGJF+RAo8cJ2hUSso0W/8+YFWK5oKkIG3Ev5ZHZ1IR vWrw== X-Gm-Message-State: AMke39lqKAf3Qh18UAk/ktu5XirGbLRslmJhHuakOM8J3R/U1wNFvfBKx/B2VXq+jkDEMA== X-Received: by 10.46.80.89 with SMTP id v25mr1548904ljd.109.1486912377084; Sun, 12 Feb 2017 07:12:57 -0800 (PST) From: Roman Bogorodskiy To: libvir-list@redhat.com Date: Sun, 12 Feb 2017 19:12:30 +0400 Message-Id: <20170212151234.25936-3-bogorodskiy@gmail.com> In-Reply-To: <20170212151234.25936-1-bogorodskiy@gmail.com> References: <20170212151234.25936-1-bogorodskiy@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Sun, 12 Feb 2017 15:13:00 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Sun, 12 Feb 2017 15:13:00 +0000 (UTC) for IP:'209.85.215.66' DOMAIN:'mail-lf0-f66.google.com' HELO:'mail-lf0-f66.google.com' FROM:'bogorodskiy@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.67 (BAYES_50, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_PASS) 209.85.215.66 mail-lf0-f66.google.com 209.85.215.66 mail-lf0-f66.google.com X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Scanned-By: MIMEDefang 2.78 on 10.5.110.38 X-loop: libvir-list@redhat.com Cc: Fabian Freyer , Roman Bogorodskiy Subject: [libvirt] [PATCH 2/6] bhyve: add support for booting from UEFI 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-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Fabian Freyer Allow to boot using UEFI rather than using an external boot loader such as bhyveload or grub-bhyve. Also, make LPC PCI-ISA bridge handling more flexible as now it's needed not only for serial ports, but for bootrom as well. Signed-off-by: Roman Bogorodskiy --- src/bhyve/bhyve_command.c | 30 +++++++++++++++++++++++++- src/bhyve/bhyve_driver.c | 27 +++++++++++++++++++---- src/bhyve/bhyve_process.c | 55 +++++++++++++++++++++++++------------------= ---- 3 files changed, 81 insertions(+), 31 deletions(-) diff --git a/src/bhyve/bhyve_command.c b/src/bhyve/bhyve_command.c index e7131625c..450800920 100644 --- a/src/bhyve/bhyve_command.c +++ b/src/bhyve/bhyve_command.c @@ -163,7 +163,6 @@ bhyveBuildConsoleArgStr(const virDomainDef *def, virCom= mandPtr cmd) return -1; } =20 - virCommandAddArgList(cmd, "-s", "1,lpc", NULL); virCommandAddArg(cmd, "-l"); virCommandAddArgFormat(cmd, "com%d,%s", chr->target.port + 1, chr->source->data.file.pa= th); @@ -283,6 +282,14 @@ bhyveBuildVirtIODiskArgStr(const virDomainDef *def ATT= RIBUTE_UNUSED, return 0; } =20 +static int +bhyveBuildLPCArgStr(const virDomainDef *def ATTRIBUTE_UNUSED, + virCommandPtr cmd) +{ + virCommandAddArgList(cmd, "-s", "1,lpc", NULL); + return 0; +} + virCommandPtr virBhyveProcessBuildBhyveCmd(virConnectPtr conn, virDomainDefPtr def, bool dryRun) @@ -296,6 +303,7 @@ virBhyveProcessBuildBhyveCmd(virConnectPtr conn, * vm0 */ size_t i; + bool add_lpc =3D false; =20 virCommandPtr cmd =3D virCommandNew(BHYVE); =20 @@ -350,6 +358,21 @@ virBhyveProcessBuildBhyveCmd(virConnectPtr conn, virCommandAddArg(cmd, "-P"); /* vmexit from guest on pause */ =20 virCommandAddArgList(cmd, "-s", "0:0,hostbridge", NULL); + + if (def->os.bootloader =3D=3D NULL && + def->os.loader) { + if ((bhyveDriverGetCaps(conn) & BHYVE_CAP_LPC_BOOTROM)) { + virCommandAddArg(cmd, "-l"); + virCommandAddArgFormat(cmd, "bootrom,%s", def->os.loader->path= ); + add_lpc =3D true; + } else { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Installed bhyve binary does not support " + "UEFI loader")); + goto error; + } + } + /* Devices */ for (i =3D 0; i < def->ncontrollers; i++) { virDomainControllerDefPtr controller =3D def->controllers[i]; @@ -389,8 +412,13 @@ virBhyveProcessBuildBhyveCmd(virConnectPtr conn, goto error; } } + + if (add_lpc || def->nserials) + bhyveBuildLPCArgStr(def, cmd); + if (bhyveBuildConsoleArgStr(def, cmd) < 0) goto error; + virCommandAddArg(cmd, def->name); =20 return cmd; diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c index f4ccef32b..0f9961ae0 100644 --- a/src/bhyve/bhyve_driver.c +++ b/src/bhyve/bhyve_driver.c @@ -734,15 +734,34 @@ bhyveConnectDomainXMLToNative(virConnectPtr conn, if (bhyveDomainAssignAddresses(def, NULL) < 0) goto cleanup; =20 - if (!(loadcmd =3D virBhyveProcessBuildLoadCmd(conn, def, "= ", + if (def->os.bootloader =3D=3D NULL && + def->os.loader) { + + if ((def->os.loader->readonly !=3D VIR_TRISTATE_BOOL_YES) + || (def->os.loader->type !=3D VIR_DOMAIN_LOADER_TYPE_PFLASH)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Only read-only pflash is supported.")); + goto cleanup; + } + + if ((bhyveDriverGetCaps(conn) & BHYVE_CAP_LPC_BOOTROM) =3D=3D 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Installed bhyve binary does not support " + "bootrom")); + goto cleanup; + } + } else { + if (!(loadcmd =3D virBhyveProcessBuildLoadCmd(conn, def, "", NULL))) - goto cleanup; + goto cleanup; + + virBufferAdd(&buf, virCommandToString(loadcmd), -1); + virBufferAddChar(&buf, '\n'); + } =20 if (!(cmd =3D virBhyveProcessBuildBhyveCmd(conn, def, true))) goto cleanup; =20 - virBufferAdd(&buf, virCommandToString(loadcmd), -1); - virBufferAddChar(&buf, '\n'); virBufferAdd(&buf, virCommandToString(cmd), -1); =20 if (virBufferCheckError(&buf) < 0) diff --git a/src/bhyve/bhyve_process.c b/src/bhyve/bhyve_process.c index 9d8097676..a97e300ff 100644 --- a/src/bhyve/bhyve_process.c +++ b/src/bhyve/bhyve_process.c @@ -165,38 +165,41 @@ virBhyveProcessStart(virConnectPtr conn, virCommandSetPidFile(cmd, privconn->pidfile); virCommandDaemonize(cmd); =20 - /* Now bhyve command is constructed, meaning the - * domain is ready to be started, so we can build - * and execute bhyveload command */ - rc =3D virBhyveFormatDevMapFile(vm->def->name, &devmap_file); - if (rc < 0) - goto cleanup; + if (vm->def->os.loader =3D=3D NULL) { + /* Now bhyve command is constructed, meaning the + * domain is ready to be started, so we can build + * and execute bhyveload command */ =20 - if (!(load_cmd =3D virBhyveProcessBuildLoadCmd(conn, vm->def, devmap_f= ile, - &devicemap))) - goto cleanup; - virCommandSetOutputFD(load_cmd, &logfd); - virCommandSetErrorFD(load_cmd, &logfd); + rc =3D virBhyveFormatDevMapFile(vm->def->name, &devmap_file); + if (rc < 0) + goto cleanup; =20 - if (devicemap !=3D NULL) { - rc =3D virFileWriteStr(devmap_file, devicemap, 0644); - if (rc) { - virReportSystemError(errno, - _("Cannot write device.map '%s'"), - devmap_file); + if (!(load_cmd =3D virBhyveProcessBuildLoadCmd(conn, vm->def, devm= ap_file, + &devicemap))) goto cleanup; + virCommandSetOutputFD(load_cmd, &logfd); + virCommandSetErrorFD(load_cmd, &logfd); + + if (devicemap !=3D NULL) { + rc =3D virFileWriteStr(devmap_file, devicemap, 0644); + if (rc) { + virReportSystemError(errno, + _("Cannot write device.map '%s'"), + devmap_file); + goto cleanup; + } } - } =20 - /* Log generated command line */ - virCommandWriteArgLog(load_cmd, logfd); - if ((pos =3D lseek(logfd, 0, SEEK_END)) < 0) - VIR_WARN("Unable to seek to end of logfile: %s", - virStrerror(errno, ebuf, sizeof(ebuf))); + /* Log generated command line */ + virCommandWriteArgLog(load_cmd, logfd); + if ((pos =3D lseek(logfd, 0, SEEK_END)) < 0) + VIR_WARN("Unable to seek to end of logfile: %s", + virStrerror(errno, ebuf, sizeof(ebuf))); =20 - VIR_DEBUG("Loading domain '%s'", vm->def->name); - if (virCommandRun(load_cmd, NULL) < 0) - goto cleanup; + VIR_DEBUG("Loading domain '%s'", vm->def->name); + if (virCommandRun(load_cmd, NULL) < 0) + goto cleanup; + } =20 /* Now we can start the domain */ VIR_DEBUG("Starting domain '%s'", vm->def->name); --=20 2.11.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 00:17:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.25 as permitted sender) client-ip=209.132.183.25; envelope-from=libvir-list-bounces@redhat.com; helo=mx4-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.25 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) by mx.zohomail.com with SMTPS id 1486912691343112.35334736400432; Sun, 12 Feb 2017 07:18:11 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v1CFDuva027433; Sun, 12 Feb 2017 10:13:56 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v1CFD2Sg024769 for ; Sun, 12 Feb 2017 10:13:02 -0500 Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.31]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1CFD2sj022905 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Sun, 12 Feb 2017 10:13:02 -0500 Received: from mail-lf0-f67.google.com (mail-lf0-f67.google.com [209.85.215.67]) (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 E5CF8C00B8ED for ; Sun, 12 Feb 2017 15:13:00 +0000 (UTC) Received: by mail-lf0-f67.google.com with SMTP id h65so6539094lfi.3 for ; Sun, 12 Feb 2017 07:12:59 -0800 (PST) Received: from kloomba.my.domain ([95.104.139.40]) by smtp.gmail.com with ESMTPSA id h9sm1414489ljb.51.2017.02.12.07.12.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 Feb 2017 07:12:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=mq2q1CsL0I7O0agB6mzXCEmk67OY4lpzhH0qblOug2k=; b=Ez3rf34u6giWQ5t6QKAOGs7MiLQDVw1HQZsYw8wyLRWWDsyphWVwO1zMpbRGZnjMFt z1D5Shr1wDIFwYL+KIjsrUep6RlPIWnJTuffu+5+l06glg4RbuNXNyFNbQpNFIDvmxy5 i/Re/+qDrwDUnOuwaZIJW5V8FHKZLEzVJcKoh+X0n2QgNy+lsVepAHYXLcOMwjx1hZIj wy2Q3bMe2Wn4+E3v880toWfRkJRVPGjupgSKhsH92ff9/7c/vx4gdaI4IJDFxtmeBt57 iFQXDSjItV45dlBN4seTtQuAUv1p23NNToxYJohBjx6ioPS8jkuDWyFyolYXCeGB8k+l uTew== 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; bh=mq2q1CsL0I7O0agB6mzXCEmk67OY4lpzhH0qblOug2k=; b=ShC6d6Jp3C6NDIyEmVrxHqzM48jWy/IcAYHJh5UmR5nz1t/KNZlbmffXIod3VdoMA1 H+PAbB7kSBYoIODr77x10JAlRWJVdNGJCixqwtSvdMeWxdMYj3vGABXKNxA7MDfJ83oX FXSp8eZDk2/vju98xyo+/Kibc1foLYuxXUFwdUyRd/t6lgDx45xTNSzG8ececMYP7TRS pflMHo9y6jtm8hEC9Qj9UjLiy3M4DGIJgypn1X4TYxy8miBdAUBXOmilyUfkkxsrW4vX OM6bUGOXmQtSYja3eImgRGTERK6qTDKt6VN2VcMjnSijnFJgqo1b/6MW6vIGJbWWIU3f vaaA== X-Gm-Message-State: AMke39mjarzokOrOXWfzs11aryc8OfhNUO1J6/o/X4Ah/7QeTVdTXi2blQAsx75H9i0snw== X-Received: by 10.46.33.75 with SMTP id h72mr5937665ljh.37.1486912378336; Sun, 12 Feb 2017 07:12:58 -0800 (PST) From: Roman Bogorodskiy To: libvir-list@redhat.com Date: Sun, 12 Feb 2017 19:12:31 +0400 Message-Id: <20170212151234.25936-4-bogorodskiy@gmail.com> In-Reply-To: <20170212151234.25936-1-bogorodskiy@gmail.com> References: <20170212151234.25936-1-bogorodskiy@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Sun, 12 Feb 2017 15:13:01 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Sun, 12 Feb 2017 15:13:01 +0000 (UTC) for IP:'209.85.215.67' DOMAIN:'mail-lf0-f67.google.com' HELO:'mail-lf0-f67.google.com' FROM:'bogorodskiy@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.67 (BAYES_50, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_PASS) 209.85.215.67 mail-lf0-f67.google.com 209.85.215.67 mail-lf0-f67.google.com X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Scanned-By: MIMEDefang 2.78 on 10.5.110.31 X-loop: libvir-list@redhat.com Cc: Fabian Freyer , Roman Bogorodskiy Subject: [libvirt] [PATCH 3/6] bhyve: test cases for UEFI bhyvexml2argvtest 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-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Fabian Freyer Signed-off-by: Roman Bogorodskiy --- tests/bhyvexml2argvdata/bhyvexml2argv-uefi.args | 11 +++++++++++ tests/bhyvexml2argvdata/bhyvexml2argv-uefi.ldargs | 1 + tests/bhyvexml2argvdata/bhyvexml2argv-uefi.xml | 23 +++++++++++++++++++= ++++ tests/bhyvexml2argvtest.c | 13 +++++++++++-- 4 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-uefi.args create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-uefi.ldargs create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-uefi.xml diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-uefi.args b/tests/bhyvex= ml2argvdata/bhyvexml2argv-uefi.args new file mode 100644 index 000000000..8ff8673ed --- /dev/null +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-uefi.args @@ -0,0 +1,11 @@ +/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 1,lpc bhyve diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-uefi.ldargs b/tests/bhyv= exml2argvdata/bhyvexml2argv-uefi.ldargs new file mode 100644 index 000000000..421376db9 --- /dev/null +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-uefi.ldargs @@ -0,0 +1 @@ +dummy diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-uefi.xml b/tests/bhyvexm= l2argvdata/bhyvexml2argv-uefi.xml new file mode 100644 index 000000000..0b7d6bd27 --- /dev/null +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-uefi.xml @@ -0,0 +1,23 @@ + + bhyve + df3be7e7-a104-11e3-aeb0-50e5492bd3dc + 219136 + 1 + + hvm + /path/to/test.fd + + + + + + +
+ + + + +
+ + + diff --git a/tests/bhyvexml2argvtest.c b/tests/bhyvexml2argvtest.c index fb404f9fb..8567ceeae 100644 --- a/tests/bhyvexml2argvtest.c +++ b/tests/bhyvexml2argvtest.c @@ -52,9 +52,13 @@ static int testCompareXMLToArgvFiles(const char *xml, conn->privateData =3D &driver; =20 cmd =3D virBhyveProcessBuildBhyveCmd(conn, vmdef, false); - ldcmd =3D virBhyveProcessBuildLoadCmd(conn, vmdef, "", + if (!vmdef->os.loader) + ldcmd =3D virBhyveProcessBuildLoadCmd(conn, vmdef, "", &actualdm); =20 + if ((ldcmd =3D=3D NULL) && (vmdef->os.loader)) + ldcmd =3D virCommandNew("dummy"); + if ((cmd =3D=3D NULL) || (ldcmd =3D=3D NULL)) { if (flags & FLAG_EXPECT_FAILURE) { ret =3D 0; @@ -162,7 +166,8 @@ mymain(void) DO_TEST_FULL(name, FLAG_EXPECT_PARSE_ERROR) =20 driver.grubcaps =3D BHYVE_GRUB_CAP_CONSDEV; - driver.bhyvecaps =3D BHYVE_CAP_RTC_UTC | BHYVE_CAP_AHCI32SLOT | BHYVE_= CAP_NET_E1000; + driver.bhyvecaps =3D BHYVE_CAP_RTC_UTC | BHYVE_CAP_AHCI32SLOT | \ + BHYVE_CAP_NET_E1000 | BHYVE_CAP_LPC_BOOTROM; =20 DO_TEST("base"); DO_TEST("acpiapic"); @@ -186,6 +191,7 @@ mymain(void) DO_TEST("serial-grub"); DO_TEST("localtime"); DO_TEST("net-e1000"); + DO_TEST("uefi"); =20 /* Address allocation tests */ DO_TEST("addr-single-sata-disk"); @@ -208,6 +214,9 @@ mymain(void) =20 DO_TEST_FAILURE("net-e1000"); =20 + driver.bhyvecaps &=3D ~BHYVE_CAP_LPC_BOOTROM; + DO_TEST_FAILURE("uefi"); + virObjectUnref(driver.caps); virObjectUnref(driver.xmlopt); =20 --=20 2.11.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 00:17:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.25 as permitted sender) client-ip=209.132.183.25; envelope-from=libvir-list-bounces@redhat.com; helo=mx4-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.25 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) by mx.zohomail.com with SMTPS id 148691262709418.234947785131112; Sun, 12 Feb 2017 07:17:07 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v1CFDu9N027432; Sun, 12 Feb 2017 10:13:56 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v1CFD33g024777 for ; Sun, 12 Feb 2017 10:13:03 -0500 Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.31]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1CFD3U2026998 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Sun, 12 Feb 2017 10:13:03 -0500 Received: from mail-lf0-f66.google.com (mail-lf0-f66.google.com [209.85.215.66]) (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 07392C0A805A for ; Sun, 12 Feb 2017 15:13:02 +0000 (UTC) Received: by mail-lf0-f66.google.com with SMTP id h65so6539112lfi.3 for ; Sun, 12 Feb 2017 07:13:00 -0800 (PST) Received: from kloomba.my.domain ([95.104.139.40]) by smtp.gmail.com with ESMTPSA id h9sm1414489ljb.51.2017.02.12.07.12.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 Feb 2017 07:12:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=HVydG2lsef1va8kqjORbfSP0Tst/kEs64mAE9DSaGsk=; b=SMyJK3GdFHUjK4eAtLTrojf4vLxP6QoKvgO2Q7XhOjoLSm1ffI4WrBsFF/rDhYZAfB m19UJZ34evslMz/kh0J6ovfqdv2fMguMBAd73LuqrCHdaRGlYGasut7AzubGkvXWzL5e zmstUAldsdEwO8Hv0jV2xbWzkwK6P6OqM4j07MvG/z5QBbUYt/UOiFe+WgiboLtzj9lR v2IXdn4NdB+2/uPCkeP2DShmijWBVLpPG27DFC732UrWnxnBgT+qp6GmTGrZPCo7pSpT WCsOHCOOSvysuwBgomDd/HY5EJindrSwz6DP4VxaUncybrBfN56EKyT4u7kGO8b/Dfuy kCWQ== 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; bh=HVydG2lsef1va8kqjORbfSP0Tst/kEs64mAE9DSaGsk=; b=rr7zakC2aRMbP5g+3BCFEnOABpTw7C0DOvHNO3fjhnubdLcuRAgmpwMsfVD27fGhsT giBst5WQ3Rn7QMpedShSpd4QWqjKKR4HOyDGbLlCvN9IGiZzeRvumg7hvNkSGGDj4HGs s78VCyfwJxR/JPaCU2TctkYY9wQfUA7Oz1X4Wyj8FCismrGfEo0i8Sn4RVkxEsGmfoIO heHNdwKFzffhyTQ8lvTrp/k3X4ys0EyG0qeDHDqrvQ6xg7bOcKUBg5EsiqwOTNHyg5gb vuU77t8a44cpQD7MWxeO1w/2vS5fPsMp9jdzDGIomhxNKzUp3JO1vlxOCrRIKBU2l1SS DMEg== X-Gm-Message-State: AMke39n2yyi757IkJksSRE+oAELE9VSwAiif0/TAb6Cd3bUt9+iGuaqbR8XYYIN8i+26Eg== X-Received: by 10.46.88.7 with SMTP id m7mr1805496ljb.58.1486912379527; Sun, 12 Feb 2017 07:12:59 -0800 (PST) From: Roman Bogorodskiy To: libvir-list@redhat.com Date: Sun, 12 Feb 2017 19:12:32 +0400 Message-Id: <20170212151234.25936-5-bogorodskiy@gmail.com> In-Reply-To: <20170212151234.25936-1-bogorodskiy@gmail.com> References: <20170212151234.25936-1-bogorodskiy@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Sun, 12 Feb 2017 15:13:02 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Sun, 12 Feb 2017 15:13:02 +0000 (UTC) for IP:'209.85.215.66' DOMAIN:'mail-lf0-f66.google.com' HELO:'mail-lf0-f66.google.com' FROM:'bogorodskiy@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.67 (BAYES_50, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_PASS) 209.85.215.66 mail-lf0-f66.google.com 209.85.215.66 mail-lf0-f66.google.com X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Scanned-By: MIMEDefang 2.78 on 10.5.110.31 X-loop: libvir-list@redhat.com Cc: Fabian Freyer , Roman Bogorodskiy Subject: [libvirt] [PATCH 4/6] bhyve: enumerate UEFI firmwares 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-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Fabian Freyer Signed-off-by: Roman Bogorodskiy --- src/bhyve/bhyve_capabilities.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/bhyve/bhyve_capabilities.c b/src/bhyve/bhyve_capabilities.c index 13b4835a8..9dec66b11 100644 --- a/src/bhyve/bhyve_capabilities.c +++ b/src/bhyve/bhyve_capabilities.c @@ -22,6 +22,9 @@ */ #include #include +#include +#include +#include =20 #include "viralloc.h" #include "virfile.h" @@ -114,11 +117,35 @@ virBhyveDomainCapsBuild(const char *emulatorbin, virDomainVirtType virttype) { virDomainCapsPtr caps =3D NULL; + DIR *dir; + struct dirent *entry; + const char *firmware_dir =3D "/usr/local/share/uefi-firmware"; + size_t firmwares_alloc =3D 0; =20 if (!(caps =3D virDomainCapsNew(emulatorbin, machine, arch, virttype))) goto cleanup; =20 caps->os.supported =3D true; + caps->os.loader.supported =3D true; + VIR_DOMAIN_CAPS_ENUM_SET(caps->os.loader.type, + VIR_DOMAIN_LOADER_TYPE_PFLASH); + VIR_DOMAIN_CAPS_ENUM_SET(caps->os.loader.readonly, + VIR_TRISTATE_BOOL_YES); + + if (virDirOpenIfExists(&dir, firmware_dir) > 0) { + while ((virDirRead(dir, &entry, firmware_dir)) > 0) { + if (VIR_RESIZE_N(caps->os.loader.values.values, + firmwares_alloc, caps->os.loader.values.nvalues, 2) < 0) + goto cleanup; + + if (virAsprintf( + &caps->os.loader.values.values[caps->os.loader.values.= nvalues], + "%s/%s", firmware_dir, entry->d_name) < 0) + goto cleanup; + + caps->os.loader.values.nvalues++; + } + } caps->disk.supported =3D true; VIR_DOMAIN_CAPS_ENUM_SET(caps->disk.diskDevice, VIR_DOMAIN_DISK_DEVICE_DISK, @@ -129,6 +156,7 @@ virBhyveDomainCapsBuild(const char *emulatorbin, VIR_DOMAIN_DISK_BUS_VIRTIO); =20 cleanup: + VIR_DIR_CLOSE(dir); return caps; } =20 --=20 2.11.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 00:17:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.39 as permitted sender) client-ip=209.132.183.39; envelope-from=libvir-list-bounces@redhat.com; helo=mx6-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.39 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx6-phx2.redhat.com (mx6-phx2.redhat.com [209.132.183.39]) by mx.zohomail.com with SMTPS id 1486912704137252.34484660999829; Sun, 12 Feb 2017 07:18:24 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx6-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1CFDwgH007221; Sun, 12 Feb 2017 10:13:58 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v1CFD4wJ024789 for ; Sun, 12 Feb 2017 10:13:04 -0500 Received: from mx1.redhat.com (ext-mx03.extmail.prod.ext.phx2.redhat.com [10.5.110.27]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1CFD4Ue013017 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Sun, 12 Feb 2017 10:13:04 -0500 Received: from mail-lf0-f66.google.com (mail-lf0-f66.google.com [209.85.215.66]) (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 58BC283F38 for ; Sun, 12 Feb 2017 15:13:03 +0000 (UTC) Received: by mail-lf0-f66.google.com with SMTP id q89so6567548lfi.1 for ; Sun, 12 Feb 2017 07:13:02 -0800 (PST) Received: from kloomba.my.domain ([95.104.139.40]) by smtp.gmail.com with ESMTPSA id h9sm1414489ljb.51.2017.02.12.07.12.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 Feb 2017 07:13:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ic4MWW3LlpqKFtJUxJMj2FQuW7bNDo1twxaMWbkEQv8=; b=Rl1ze7wt/V3VcXNdtfwzy7kHdmDaFmwbFXD/Uwa8ZdJ0OqGLLaFR1noLEMBI0e+sEo o6fxwfQqDr9FVSkC2F5mAR+3tEHoui/N4HnCW/YO0qmvgF9eSdjkfzL6ZPfEK/Rm6C8v n6x24/LxFTZlMkYdoexZ54wmBX8IcR6hgqfW4qA9NmAvoujvoZ6ETS612BMIbUPOrEfy 9LGXTLppVAVx5b9kRkKSH1dHF0PQPzDxxOS+8svulqRPzfeVXiDixcSlQW7nA+gK4Zpp 4x2AqNTzfRRKYXz3TwnZGIE+5coBSeebTdImlTsdM67br/wPO7OaGkF29SrAYvvqg1U2 Chgw== 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; bh=ic4MWW3LlpqKFtJUxJMj2FQuW7bNDo1twxaMWbkEQv8=; b=G2k2UyAuQg8DmygDcp+C94YnWLfzXHRJ3sru2aVI0mB5oPOJiLPkIk6Be/hvMvwhVV j/RC0x/S4KE+RqDy7WakWzedjMP0ZZsv2FOiqG49eEl/e2DmEfjgQhcDIPrAT3sXEo0m TS6T1LpBxIG0kPxQv8HHvMb9CVKJjNoVDZ2DJytXqgyhCOWEqD2fc93+1XHjLLLiRLTB BkreY6F940M2MLx6Tyt/ZGhk3vSFqD3nWb3SIvK6em94VEyXX6KYG/3p3LbAHF0+3HTg 4fsHOeigoCAiXS0+JtHrmJsvKUd7bXbhNKIfP6zz7jDPf3cAnaYF0pV8WVXxgDANuM2V njzA== X-Gm-Message-State: AMke39nxD+oP8yeeahAc4w9+/kTqU6GcrMzi3AURkPlAuxP2ibG0Qt4pE39yqkLzNyRLFA== X-Received: by 10.46.9.134 with SMTP id 128mr1363227ljj.133.1486912380645; Sun, 12 Feb 2017 07:13:00 -0800 (PST) From: Roman Bogorodskiy To: libvir-list@redhat.com Date: Sun, 12 Feb 2017 19:12:33 +0400 Message-Id: <20170212151234.25936-6-bogorodskiy@gmail.com> In-Reply-To: <20170212151234.25936-1-bogorodskiy@gmail.com> References: <20170212151234.25936-1-bogorodskiy@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Sun, 12 Feb 2017 15:13:03 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Sun, 12 Feb 2017 15:13:03 +0000 (UTC) for IP:'209.85.215.66' DOMAIN:'mail-lf0-f66.google.com' HELO:'mail-lf0-f66.google.com' FROM:'bogorodskiy@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.67 (BAYES_50, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_PASS) 209.85.215.66 mail-lf0-f66.google.com 209.85.215.66 mail-lf0-f66.google.com X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Scanned-By: MIMEDefang 2.78 on 10.5.110.27 X-loop: libvir-list@redhat.com Cc: Fabian Freyer , Roman Bogorodskiy Subject: [libvirt] [PATCH 5/6] bhyve: add video support 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-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Fabian Freyer bhyve supports 'gop' video device that allows clients to connect to VMs using VNC clients. This commit adds support for that to the bhyve driver: - Introducr 'gop' video device type - Add capabilities probing for the 'fbuf' device that's responsible for graphics - Update command builder routines to let users configure domain's VNC via gop graphics. Signed-off-by: Roman Bogorodskiy --- docs/formatdomain.html.in | 3 +- docs/schemas/domaincommon.rng | 1 + po/POTFILES.in | 1 + src/bhyve/bhyve_capabilities.c | 40 +++++++++++++++ src/bhyve/bhyve_capabilities.h | 1 + src/bhyve/bhyve_command.c | 100 ++++++++++++++++++++++++++++++++= ++++ src/bhyve/bhyve_device.c | 11 ++++ src/conf/domain_conf.c | 5 +- src/conf/domain_conf.h | 1 + src/qemu/qemu_command.c | 9 ++-- src/qemu/qemu_domain_address.c | 1 + tests/domaincapsschemadata/full.xml | 1 + 12 files changed, 169 insertions(+), 5 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 0a115f5dc..b853a7245 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -5812,8 +5812,9 @@ qemu-kvm -net nic,model=3D? /dev/null

The model element has a mandatory type attribute which takes the value "vga", "cirrus", "vmvga", "xen", - "vbox", "qxl" (since 0.8.6) or + "vbox", "qxl" (since 0.8.6), "virtio" (since 1.3.0) + or "gop" (since 3.1.0) depending on the hypervisor features available.

diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index d715bff29..3e3793ea0 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -3152,6 +3152,7 @@ xen vbox virtio + gop diff --git a/po/POTFILES.in b/po/POTFILES.in index 365ea662f..c6d350da7 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -12,6 +12,7 @@ gnulib/lib/getopt.c gnulib/lib/regcomp.c src/access/viraccessdriverpolkit.c src/access/viraccessmanager.c +src/bhyve/bhyve_capabilities.c src/bhyve/bhyve_command.c src/bhyve/bhyve_device.c src/bhyve/bhyve_domain.c diff --git a/src/bhyve/bhyve_capabilities.c b/src/bhyve/bhyve_capabilities.c index 9dec66b11..5539d2978 100644 --- a/src/bhyve/bhyve_capabilities.c +++ b/src/bhyve/bhyve_capabilities.c @@ -117,6 +117,7 @@ virBhyveDomainCapsBuild(const char *emulatorbin, virDomainVirtType virttype) { virDomainCapsPtr caps =3D NULL; + unsigned int bhyve_caps =3D 0; DIR *dir; struct dirent *entry; const char *firmware_dir =3D "/usr/local/share/uefi-firmware"; @@ -125,6 +126,12 @@ virBhyveDomainCapsBuild(const char *emulatorbin, if (!(caps =3D virDomainCapsNew(emulatorbin, machine, arch, virttype))) goto cleanup; =20 + if (virBhyveProbeCaps(&bhyve_caps)) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("failed probing capabilities")); + goto cleanup; + } + caps->os.supported =3D true; caps->os.loader.supported =3D true; VIR_DOMAIN_CAPS_ENUM_SET(caps->os.loader.type, @@ -155,6 +162,12 @@ virBhyveDomainCapsBuild(const char *emulatorbin, VIR_DOMAIN_DISK_BUS_SATA, VIR_DOMAIN_DISK_BUS_VIRTIO); =20 + if (bhyve_caps & BHYVE_CAP_FBUF) { + caps->graphics.supported =3D true; + caps->video.supported =3D true; + VIR_DOMAIN_CAPS_ENUM_SET(caps->graphics.type, VIR_DOMAIN_GRAPHICS_= TYPE_VNC); + VIR_DOMAIN_CAPS_ENUM_SET(caps->video.modelType, VIR_DOMAIN_VIDEO_T= YPE_GOP); + } cleanup: VIR_DIR_CLOSE(dir); return caps; @@ -289,6 +302,30 @@ bhyveProbeCapsLPC_Bootrom(unsigned int *caps, char *bi= nary) return ret; } =20 + +static int +bhyveProbeCapsFramebuffer(unsigned int *caps, char *binary) +{ + char *error; + virCommandPtr cmd =3D NULL; + int ret =3D -1, exit; + + cmd =3D virCommandNew(binary); + virCommandAddArgList(cmd, "-s", "0,fbuf", NULL); + virCommandSetErrorBuffer(cmd, &error); + if (virCommandRun(cmd, &exit) < 0) + goto cleanup; + + if (strstr(error, "pci slot 0:0: unknown device \"fbuf\"") =3D=3D NULL) + *caps |=3D BHYVE_CAP_FBUF; + + ret =3D 0; + cleanup: + VIR_FREE(error); + virCommandFree(cmd); + return ret; +} + int virBhyveProbeCaps(unsigned int *caps) { @@ -313,6 +350,9 @@ virBhyveProbeCaps(unsigned int *caps) if ((ret =3D bhyveProbeCapsLPC_Bootrom(caps, binary))) goto out; =20 + if ((ret =3D bhyveProbeCapsFramebuffer(caps, binary))) + goto out; + out: VIR_FREE(binary); return ret; diff --git a/src/bhyve/bhyve_capabilities.h b/src/bhyve/bhyve_capabilities.h index 746c77181..8fb97d730 100644 --- a/src/bhyve/bhyve_capabilities.h +++ b/src/bhyve/bhyve_capabilities.h @@ -41,6 +41,7 @@ typedef enum { BHYVE_CAP_AHCI32SLOT =3D 1 << 1, BHYVE_CAP_NET_E1000 =3D 1 << 2, BHYVE_CAP_LPC_BOOTROM =3D 1 << 3, + BHYVE_CAP_FBUF =3D 1 << 4, } virBhyveCapsFlags; =20 int virBhyveProbeGrubCaps(virBhyveGrubCapsFlags *caps); diff --git a/src/bhyve/bhyve_command.c b/src/bhyve/bhyve_command.c index 450800920..ec7a71572 100644 --- a/src/bhyve/bhyve_command.c +++ b/src/bhyve/bhyve_command.c @@ -290,6 +290,94 @@ bhyveBuildLPCArgStr(const virDomainDef *def ATTRIBUTE_= UNUSED, return 0; } =20 +static int +bhyveBuildGraphicsArgStr(const virDomainDef *def ATTRIBUTE_UNUSED, + virDomainGraphicsDefPtr graphics, + virDomainVideoDefPtr video, + virConnectPtr conn, + virCommandPtr cmd) +{ + virBuffer opt =3D VIR_BUFFER_INITIALIZER; + virDomainGraphicsListenDefPtr glisten =3D NULL; + bool escapeAddr; + + if (!(bhyveDriverGetCaps(conn) & BHYVE_CAP_LPC_BOOTROM) || + def->os.bootloader || + !def->os.loader) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Graphics are only supported" + " when booting using UEFI")); + return -1; + } + + if (!(bhyveDriverGetCaps(conn) & BHYVE_CAP_FBUF)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Bhyve version does not support framebuffer")); + return -1; + } + + if (graphics->type !=3D VIR_DOMAIN_GRAPHICS_TYPE_VNC) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Only VNC supported")); + return -1; + } + + if (!(glisten =3D virDomainGraphicsGetListen(graphics, 0))) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("Missing listen element")); + goto error; + } + + virBufferAsprintf(&opt, "%d:%d,fbuf", video->info.addr.pci.slot, video= ->info.addr.pci.function); + + switch (glisten->type) { + case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_ADDRESS: + case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NETWORK: + virBufferAddLit(&opt, ",tcp=3D"); + + if (!graphics->data.vnc.autoport && + (graphics->data.vnc.port < 5900 || + graphics->data.vnc.port > 65535)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("vnc port must be in range [5900,65535]")); + goto error; + } + + if (graphics->data.vnc.auth.passwd) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("vnc password auth not supported")); + goto error; + } else { + /* Bhyve doesn't support VNC Auth yet, so print a warning abo= ut + * unauthenticated VNC sessions */ + VIR_WARN("%s", _("Security warning: currently VNC auth is not" + " supported.")); + } + + if (glisten->address) { + escapeAddr =3D strchr(glisten->address, ':') !=3D NULL; + if (escapeAddr) + virBufferAsprintf(&opt, "[%s]", glisten->address); + else + virBufferAdd(&opt, glisten->address, -1); + } + + virBufferAsprintf(&opt, ":%d", graphics->data.vnc.port); + break; + default: + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Unsupported listen type")); + } + + virCommandAddArg(cmd, "-s"); + virCommandAddArgBuffer(cmd, &opt); + return 0; + + error: + virBufferFreeAndReset(&opt); + return -1; +} + virCommandPtr virBhyveProcessBuildBhyveCmd(virConnectPtr conn, virDomainDefPtr def, bool dryRun) @@ -413,6 +501,18 @@ virBhyveProcessBuildBhyveCmd(virConnectPtr conn, } } =20 + if (def->ngraphics && def->nvideos) { + if (def->ngraphics =3D=3D 1 && def->nvideos =3D=3D 1) { + if (bhyveBuildGraphicsArgStr(def, def->graphics[0], def->video= s[0], conn, cmd) < 0) + goto error; + add_lpc =3D true; + } else { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Multiple graphics devices are not supported"= )); + goto error; + } + } + if (add_lpc || def->nserials) bhyveBuildLPCArgStr(def, cmd); =20 diff --git a/src/bhyve/bhyve_device.c b/src/bhyve/bhyve_device.c index 55ce631ec..a3a263b7e 100644 --- a/src/bhyve/bhyve_device.c +++ b/src/bhyve/bhyve_device.c @@ -145,6 +145,17 @@ bhyveAssignDevicePCISlots(virDomainDefPtr def, goto error; } =20 + for (i =3D 0; i < def->nvideos; i++) { + if (!virDeviceInfoPCIAddressWanted(&def->videos[i]->info)) + continue; + if (virDomainPCIAddressReserveNextAddr(addrs, + &def->videos[i]->info, + VIR_PCI_CONNECT_TYPE_PCI_DE= VICE, + -1) < 0) + goto error; + } + + return 0; =20 error: diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 1bc72a4e9..77fe87582 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -545,7 +545,8 @@ VIR_ENUM_IMPL(virDomainVideo, VIR_DOMAIN_VIDEO_TYPE_LAS= T, "vbox", "qxl", "parallels", - "virtio") + "virtio", + "gop") =20 VIR_ENUM_IMPL(virDomainInput, VIR_DOMAIN_INPUT_TYPE_LAST, "mouse", @@ -13018,6 +13019,8 @@ virDomainVideoDefaultType(const virDomainDef *def) return VIR_DOMAIN_VIDEO_TYPE_VGA; else return VIR_DOMAIN_VIDEO_TYPE_PARALLELS; + case VIR_DOMAIN_VIRT_BHYVE: + return VIR_DOMAIN_VIDEO_TYPE_GOP; default: return -1; } diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index dd79206f6..0876eabbf 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1335,6 +1335,7 @@ typedef enum { VIR_DOMAIN_VIDEO_TYPE_QXL, VIR_DOMAIN_VIDEO_TYPE_PARALLELS, /* pseudo device for VNC in container= s */ VIR_DOMAIN_VIDEO_TYPE_VIRTIO, + VIR_DOMAIN_VIDEO_TYPE_GOP, =20 VIR_DOMAIN_VIDEO_TYPE_LAST } virDomainVideoType; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index c00a47a91..aabdcdcee 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -100,7 +100,8 @@ VIR_ENUM_IMPL(qemuVideo, VIR_DOMAIN_VIDEO_TYPE_LAST, "", /* don't support vbox */ "qxl", "", /* don't support parallels */ - "" /* no need for virtio */); + "", /* no need for virtio */ + "" /* don't support gop */); =20 VIR_ENUM_DECL(qemuDeviceVideo) =20 @@ -112,7 +113,8 @@ VIR_ENUM_IMPL(qemuDeviceVideo, VIR_DOMAIN_VIDEO_TYPE_LA= ST, "", /* don't support vbox */ "qxl-vga", "", /* don't support parallels */ - "virtio-vga"); + "virtio-vga", + "" /* don't support gop */); =20 VIR_ENUM_DECL(qemuDeviceVideoSecondary) =20 @@ -124,7 +126,8 @@ VIR_ENUM_IMPL(qemuDeviceVideoSecondary, VIR_DOMAIN_VIDE= O_TYPE_LAST, "", /* don't support vbox */ "qxl", "", /* don't support parallels */ - "virtio-gpu-pci"); + "virtio-gpu-pci", + "" /* don't support gop */); =20 VIR_ENUM_DECL(qemuSoundCodec) =20 diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index 70482f224..e22adacb2 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -741,6 +741,7 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDevic= eDefPtr dev, case VIR_DOMAIN_VIDEO_TYPE_PARALLELS: return pciFlags; =20 + case VIR_DOMAIN_VIDEO_TYPE_GOP: case VIR_DOMAIN_VIDEO_TYPE_LAST: return 0; } diff --git a/tests/domaincapsschemadata/full.xml b/tests/domaincapsschemada= ta/full.xml index 6abd4995a..6a676253c 100644 --- a/tests/domaincapsschemadata/full.xml +++ b/tests/domaincapsschemadata/full.xml @@ -70,6 +70,7 @@ qxl parallels virtio + gop --=20 2.11.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri Apr 26 00:17:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.25 as permitted sender) client-ip=209.132.183.25; envelope-from=libvir-list-bounces@redhat.com; helo=mx4-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.25 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) by mx.zohomail.com with SMTPS id 1486912632234390.428727730201; Sun, 12 Feb 2017 07:17:12 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v1CFDwVD027455; Sun, 12 Feb 2017 10:13:58 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v1CFD54g024795 for ; Sun, 12 Feb 2017 10:13:05 -0500 Received: from mx1.redhat.com (ext-mx06.extmail.prod.ext.phx2.redhat.com [10.5.110.30]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1CFD5qI024093 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Sun, 12 Feb 2017 10:13:05 -0500 Received: from mail-lf0-f65.google.com (mail-lf0-f65.google.com [209.85.215.65]) (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 454CB3B709 for ; Sun, 12 Feb 2017 15:13:04 +0000 (UTC) Received: by mail-lf0-f65.google.com with SMTP id v186so6560553lfa.2 for ; Sun, 12 Feb 2017 07:13:03 -0800 (PST) Received: from kloomba.my.domain ([95.104.139.40]) by smtp.gmail.com with ESMTPSA id h9sm1414489ljb.51.2017.02.12.07.13.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 Feb 2017 07:13:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=lOuLtjTk+SVcERLjRC2COZJTabsOBjrcC0eW38+CLSI=; b=PGDgZNMyKnrYH7oDK7sAyPZwekLRKcJLBQwmBGAW/ByserF5983fZBfUKGVX4uvBy6 awhqzAyx1qVO7zygZN5o/8VWvK/JG+RVtbN4TJFag9DbrF+cdhKbD1Uznft4sTZjMDe3 RH3yzUdi20W9OIhvWTAGR8Ca2b48GFy/yYBH+8AIjK69EGaKHCdROF0sHDhfl9WjRFaf F9yxyTLj2MUYiCW1d4Vy8bV+SimFfyWlJkFZtjhdYj/ML2mBvsm2HIQLtPL8kIuKBCb+ u3KPE9aO4+nfqE911dwZPxODtbpA/hLTNwn2F+hXB5lbRh+lSE47mVgJW37RIEFhzK4S pwnQ== 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; bh=lOuLtjTk+SVcERLjRC2COZJTabsOBjrcC0eW38+CLSI=; b=QFtgneh+Tu2grFI0yR1pMG1oJ8RgcnIAxJW5SHtNN4qleZfrELw3eNxbVAg3TZjOMa 6xly5FfUmDITN0OU53R+6fLcsageDaSU1Eur1L1t/faO+T1mKH9isT+IB6AEno1kcEfG 4I3lLXpEUd1yjkDsZrcWO12duPiRCTdg9bD5MHG9WkvnxTmFG1I/SCGMfILICjuvgZ+/ BjJxVP2Q1b6jx/OKEaJcQR8Jo9siYbbKbuBdLj5b3EWfaZPWQthb6AefdLZE3plt+sar +SP44W1358T2TFygr0QmA5SxIDwyyWFkAVzBqhvRfxXNuD3wwt0+ysxurMJR8f3m0/ce ns3Q== X-Gm-Message-State: AMke39mhUxA9QLe90efUa+uR9P16nnTwdd45r9sXnREwF1jrSWj+pgu4TFgvsP0nTtNu9Q== X-Received: by 10.46.80.29 with SMTP id e29mr1567647ljb.121.1486912381747; Sun, 12 Feb 2017 07:13:01 -0800 (PST) From: Roman Bogorodskiy To: libvir-list@redhat.com Date: Sun, 12 Feb 2017 19:12:34 +0400 Message-Id: <20170212151234.25936-7-bogorodskiy@gmail.com> In-Reply-To: <20170212151234.25936-1-bogorodskiy@gmail.com> References: <20170212151234.25936-1-bogorodskiy@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Sun, 12 Feb 2017 15:13:04 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Sun, 12 Feb 2017 15:13:04 +0000 (UTC) for IP:'209.85.215.65' DOMAIN:'mail-lf0-f65.google.com' HELO:'mail-lf0-f65.google.com' FROM:'bogorodskiy@gmail.com' RCPT:'' X-RedHat-Spam-Score: 1.17 * (BAYES_50, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_SPAM, SPF_PASS) 209.85.215.65 mail-lf0-f65.google.com 209.85.215.65 mail-lf0-f65.google.com X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Scanned-By: MIMEDefang 2.78 on 10.5.110.30 X-loop: libvir-list@redhat.com Cc: Roman Bogorodskiy Subject: [libvirt] [PATCH 6/6] bhyve: test cases for VNC 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-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Roman Bogorodskiy --- tests/bhyvexml2argvdata/bhyvexml2argv-vnc.args | 12 +++++++++++ tests/bhyvexml2argvdata/bhyvexml2argv-vnc.ldargs | 1 + tests/bhyvexml2argvdata/bhyvexml2argv-vnc.xml | 26 ++++++++++++++++++++= ++++ tests/bhyvexml2argvtest.c | 7 ++++++- 4 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-vnc.args create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-vnc.ldargs create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-vnc.xml diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-vnc.args b/tests/bhyvexm= l2argvdata/bhyvexml2argv-vnc.args new file mode 100644 index 000000000..90889b8f3 --- /dev/null +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-vnc.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 \ +-s 1,lpc bhyve diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-vnc.ldargs b/tests/bhyve= xml2argvdata/bhyvexml2argv-vnc.ldargs new file mode 100644 index 000000000..421376db9 --- /dev/null +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-vnc.ldargs @@ -0,0 +1 @@ +dummy diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-vnc.xml b/tests/bhyvexml= 2argvdata/bhyvexml2argv-vnc.xml new file mode 100644 index 000000000..9bef80bb4 --- /dev/null +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-vnc.xml @@ -0,0 +1,26 @@ + + bhyve + df3be7e7-a104-11e3-aeb0-50e5492bd3dc + 219136 + 1 + + hvm + /path/to/test.fd + + + + + + +

+ + + + +
+ + + + + + diff --git a/tests/bhyvexml2argvtest.c b/tests/bhyvexml2argvtest.c index 8567ceeae..9089807c6 100644 --- a/tests/bhyvexml2argvtest.c +++ b/tests/bhyvexml2argvtest.c @@ -167,7 +167,8 @@ mymain(void) =20 driver.grubcaps =3D BHYVE_GRUB_CAP_CONSDEV; driver.bhyvecaps =3D BHYVE_CAP_RTC_UTC | BHYVE_CAP_AHCI32SLOT | \ - BHYVE_CAP_NET_E1000 | BHYVE_CAP_LPC_BOOTROM; + BHYVE_CAP_NET_E1000 | BHYVE_CAP_LPC_BOOTROM | \ + BHYVE_CAP_FBUF; =20 DO_TEST("base"); DO_TEST("acpiapic"); @@ -192,6 +193,7 @@ mymain(void) DO_TEST("localtime"); DO_TEST("net-e1000"); DO_TEST("uefi"); + DO_TEST("vnc"); =20 /* Address allocation tests */ DO_TEST("addr-single-sata-disk"); @@ -217,6 +219,9 @@ mymain(void) driver.bhyvecaps &=3D ~BHYVE_CAP_LPC_BOOTROM; DO_TEST_FAILURE("uefi"); =20 + driver.bhyvecaps &=3D ~BHYVE_CAP_FBUF; + DO_TEST_FAILURE("vnc"); + virObjectUnref(driver.caps); virObjectUnref(driver.xmlopt); =20 --=20 2.11.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list