Re: [PATCH] bhyve: add support

2021-03-15 Thread Pavel Hrdina
On Sat, Feb 27, 2021 at 08:34:08AM +0400, Roman Bogorodskiy wrote:
> Implement "" support for bhyve driver.
> As there are not really lot of options, try to find
> "BHYVE_UEFI.fd" firmware which is installed by the
> sysutils/uefi-edk2-bhyve FreeBSD port.
> 
> If not found, just use the first found firmware
> in the firmwares directory (which is configurable via
> config file).
> 
> Signed-off-by: Roman Bogorodskiy 
> ---
> Not extremely happy about the LIBVIRT_BHYVE_FIRMWARE_DIR_OVERRIDE knob,
> but not sure how to test this otherwise.

Agreed, that should not be part of the production code.

You can use tests/bhyvexml2argvmock.c which is already used for that
test where you would provide your custom implementation of opendir()
system call. The implementation should check if it tries to access the
default firmware dir and change it to location in our tests and all
other paths simply pass to the real opendir().

Look into tests/virpcimock.c, but the addition for your use-case should
look something like this:


diff --git a/tests/bhyvexml2argvmock.c b/tests/bhyvexml2argvmock.c
index 25b97f5e04..1c2b1f8876 100644
--- a/tests/bhyvexml2argvmock.c
+++ b/tests/bhyvexml2argvmock.c
@@ -4,10 +4,34 @@
 #include "virstring.h"
 #include "virnetdev.h"
 #include "virnetdevtap.h"
+#include "virmock.h"
 #include "internal.h"

 #define VIR_FROM_THIS VIR_FROM_BHYVE

+#define DEFAULT_FIRMWARE_DIR_TEMPLATE DATADIR "/uefi-firmware"
+#define FAKE_FIRMWARE_DIR_TEMPLATE abs_builddir "/bhyvefakefirmwaredir-XX"
+
+static int (*real_opendir)(const char *name);
+
+static void
+init_syms(void)
+{
+VIR_MOCK_REAL_INIT(opendir);
+}
+
+DIR *
+opendir(const char *path)
+{
+init_syms();
+
+if (STRPREFIX(path, DEFAULT_FIRMWARE_DIR_TEMPLATE)) {
+return real_opendir(FAKE_FIRMWARE_DIR_TEMPLATE);
+} else {
+return real_opendir(path);
+}
+}
+
 void virMacAddrGenerate(const unsigned char prefix[VIR_MAC_PREFIX_BUFLEN],
 virMacAddrPtr addr)
 {


I did not test it :)

Pavel


signature.asc
Description: PGP signature


Re: [PATCH] bhyve: add support

2021-03-15 Thread Michal Privoznik

On 2/27/21 5:34 AM, Roman Bogorodskiy wrote:

Implement "" support for bhyve driver.
As there are not really lot of options, try to find
"BHYVE_UEFI.fd" firmware which is installed by the
sysutils/uefi-edk2-bhyve FreeBSD port.

If not found, just use the first found firmware
in the firmwares directory (which is configurable via
config file).

Signed-off-by: Roman Bogorodskiy 
---
Not extremely happy about the LIBVIRT_BHYVE_FIRMWARE_DIR_OVERRIDE knob,
but not sure how to test this otherwise.

  po/POTFILES.in|  1 +
  src/bhyve/bhyve_domain.c  |  5 +
  src/bhyve/bhyve_firmware.c| 91 +++
  src/bhyve/bhyve_firmware.h| 30 ++
  src/bhyve/bhyve_process.c | 15 +++
  src/bhyve/bhyve_process.h |  5 +
  src/bhyve/meson.build |  1 +
  .../bhyvexml2argv-firmware-efi.args   | 11 +++
  .../bhyvexml2argv-firmware-efi.ldargs |  1 +
  .../bhyvexml2argv-firmware-efi.xml| 22 +
  tests/bhyvexml2argvtest.c | 83 ++---
  11 files changed, 254 insertions(+), 11 deletions(-)
  create mode 100644 src/bhyve/bhyve_firmware.c
  create mode 100644 src/bhyve/bhyve_firmware.h
  create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-firmware-efi.args
  create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-firmware-efi.ldargs
  create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-firmware-efi.xml

diff --git a/po/POTFILES.in b/po/POTFILES.in
index 80c5f145be..413783ee35 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -14,6 +14,7 @@
  @SRCDIR@src/bhyve/bhyve_command.c
  @SRCDIR@src/bhyve/bhyve_domain.c
  @SRCDIR@src/bhyve/bhyve_driver.c
+@SRCDIR@src/bhyve/bhyve_firmware.c
  @SRCDIR@src/bhyve/bhyve_monitor.c
  @SRCDIR@src/bhyve/bhyve_parse_command.c
  @SRCDIR@src/bhyve/bhyve_process.c
diff --git a/src/bhyve/bhyve_domain.c b/src/bhyve/bhyve_domain.c
index 8fbc554a0a..209e4d3905 100644
--- a/src/bhyve/bhyve_domain.c
+++ b/src/bhyve/bhyve_domain.c
@@ -64,6 +64,9 @@ bhyveDomainDefNeedsISAController(virDomainDefPtr def)
  if (def->os.bootloader == NULL && def->os.loader)
  return true;
  
+if (def->os.firmware == VIR_DOMAIN_OS_DEF_FIRMWARE_EFI)

+return true;
+
  if (def->nserials || def->nconsoles)
  return true;
  
@@ -230,6 +233,8 @@ virDomainDefParserConfig virBhyveDriverDomainDefParserConfig = {

  .domainPostParseCallback = bhyveDomainDefPostParse,
  .assignAddressesCallback = bhyveDomainDefAssignAddresses,
  .deviceValidateCallback = bhyveDomainDeviceDefValidate,
+
+.features = VIR_DOMAIN_DEF_FEATURE_FW_AUTOSELECT,
  };
  
  static void

diff --git a/src/bhyve/bhyve_firmware.c b/src/bhyve/bhyve_firmware.c
new file mode 100644
index 00..ccc3a5ffc8
--- /dev/null
+++ b/src/bhyve/bhyve_firmware.c
@@ -0,0 +1,91 @@
+/*
+ * bhyve_firmware.c: bhyve firmware management
+ *
+ * Copyright (C) 2021 Roman Bogorodskiy
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library.  If not, see
+ * .
+ *
+ */
+
+#include 
+#include 
+
+#include "viralloc.h"
+#include "virlog.h"
+#include "virfile.h"
+#include "bhyve_conf.h"
+#include "bhyve_firmware.h"
+
+#define VIR_FROM_THIS   VIR_FROM_BHYVE
+
+VIR_LOG_INIT("bhyve.bhyve_firmware");
+
+
+#define BHYVE_DEFAULT_FIRMWARE  "BHYVE_UEFI.fd"
+
+int
+bhyveFirmwareFillDomain(bhyveConnPtr driver,
+virDomainDefPtr def,
+unsigned int flags)
+{
+g_autoptr(DIR) dir = NULL;
+virBhyveDriverConfigPtr cfg = virBhyveDriverGetConfig(driver);


virBhyveDriverGetConfig() returns a reference, thus needs to be coupled 
with virObjectUnref(cfg); otherwise .. [1]



+const char *firmware_dir_cfg = cfg->firmwareDir;
+const char *firmware_dir_env = NULL, *firmware_dir = NULL;


One variable per line, please. It turned out to be useful (although in 
this specific case it's not using virXXXPtr type so doesn't matter):


https://listman.redhat.com/archives/libvir-list/2021-March/msg00542.html


+struct dirent *entry;
+char *matching_firmware = NULL;
+char *first_found = NULL;
+
+virCheckFlags(0, -1);


1: .. @cfg is leaked here .. [2]


+
+if (def->os.firmware == VIR_DOMAIN_OS_DEF_FIRMWARE_NONE)
+return 0;


2: .. or here. You get the idea. 

[PATCH] bhyve: add support

2021-02-26 Thread Roman Bogorodskiy
Implement "" support for bhyve driver.
As there are not really lot of options, try to find
"BHYVE_UEFI.fd" firmware which is installed by the
sysutils/uefi-edk2-bhyve FreeBSD port.

If not found, just use the first found firmware
in the firmwares directory (which is configurable via
config file).

Signed-off-by: Roman Bogorodskiy 
---
Not extremely happy about the LIBVIRT_BHYVE_FIRMWARE_DIR_OVERRIDE knob,
but not sure how to test this otherwise.

 po/POTFILES.in|  1 +
 src/bhyve/bhyve_domain.c  |  5 +
 src/bhyve/bhyve_firmware.c| 91 +++
 src/bhyve/bhyve_firmware.h| 30 ++
 src/bhyve/bhyve_process.c | 15 +++
 src/bhyve/bhyve_process.h |  5 +
 src/bhyve/meson.build |  1 +
 .../bhyvexml2argv-firmware-efi.args   | 11 +++
 .../bhyvexml2argv-firmware-efi.ldargs |  1 +
 .../bhyvexml2argv-firmware-efi.xml| 22 +
 tests/bhyvexml2argvtest.c | 83 ++---
 11 files changed, 254 insertions(+), 11 deletions(-)
 create mode 100644 src/bhyve/bhyve_firmware.c
 create mode 100644 src/bhyve/bhyve_firmware.h
 create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-firmware-efi.args
 create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-firmware-efi.ldargs
 create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-firmware-efi.xml

diff --git a/po/POTFILES.in b/po/POTFILES.in
index 80c5f145be..413783ee35 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -14,6 +14,7 @@
 @SRCDIR@src/bhyve/bhyve_command.c
 @SRCDIR@src/bhyve/bhyve_domain.c
 @SRCDIR@src/bhyve/bhyve_driver.c
+@SRCDIR@src/bhyve/bhyve_firmware.c
 @SRCDIR@src/bhyve/bhyve_monitor.c
 @SRCDIR@src/bhyve/bhyve_parse_command.c
 @SRCDIR@src/bhyve/bhyve_process.c
diff --git a/src/bhyve/bhyve_domain.c b/src/bhyve/bhyve_domain.c
index 8fbc554a0a..209e4d3905 100644
--- a/src/bhyve/bhyve_domain.c
+++ b/src/bhyve/bhyve_domain.c
@@ -64,6 +64,9 @@ bhyveDomainDefNeedsISAController(virDomainDefPtr def)
 if (def->os.bootloader == NULL && def->os.loader)
 return true;
 
+if (def->os.firmware == VIR_DOMAIN_OS_DEF_FIRMWARE_EFI)
+return true;
+
 if (def->nserials || def->nconsoles)
 return true;
 
@@ -230,6 +233,8 @@ virDomainDefParserConfig 
virBhyveDriverDomainDefParserConfig = {
 .domainPostParseCallback = bhyveDomainDefPostParse,
 .assignAddressesCallback = bhyveDomainDefAssignAddresses,
 .deviceValidateCallback = bhyveDomainDeviceDefValidate,
+
+.features = VIR_DOMAIN_DEF_FEATURE_FW_AUTOSELECT,
 };
 
 static void
diff --git a/src/bhyve/bhyve_firmware.c b/src/bhyve/bhyve_firmware.c
new file mode 100644
index 00..ccc3a5ffc8
--- /dev/null
+++ b/src/bhyve/bhyve_firmware.c
@@ -0,0 +1,91 @@
+/*
+ * bhyve_firmware.c: bhyve firmware management
+ *
+ * Copyright (C) 2021 Roman Bogorodskiy
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library.  If not, see
+ * .
+ *
+ */
+
+#include 
+#include 
+
+#include "viralloc.h"
+#include "virlog.h"
+#include "virfile.h"
+#include "bhyve_conf.h"
+#include "bhyve_firmware.h"
+
+#define VIR_FROM_THIS   VIR_FROM_BHYVE
+
+VIR_LOG_INIT("bhyve.bhyve_firmware");
+
+
+#define BHYVE_DEFAULT_FIRMWARE  "BHYVE_UEFI.fd"
+
+int
+bhyveFirmwareFillDomain(bhyveConnPtr driver,
+virDomainDefPtr def,
+unsigned int flags)
+{
+g_autoptr(DIR) dir = NULL;
+virBhyveDriverConfigPtr cfg = virBhyveDriverGetConfig(driver);
+const char *firmware_dir_cfg = cfg->firmwareDir;
+const char *firmware_dir_env = NULL, *firmware_dir = NULL;
+struct dirent *entry;
+char *matching_firmware = NULL;
+char *first_found = NULL;
+
+virCheckFlags(0, -1);
+
+if (def->os.firmware == VIR_DOMAIN_OS_DEF_FIRMWARE_NONE)
+return 0;
+
+if (virDirOpenIfExists(, firmware_dir_cfg) > 0) {
+while ((virDirRead(dir, , firmware_dir)) > 0) {
+if (STREQ(entry->d_name, BHYVE_DEFAULT_FIRMWARE)) {
+matching_firmware = g_strdup(entry->d_name);
+break;
+}
+if (!first_found)
+first_found = g_strdup(entry->d_name);
+}
+}
+
+if (!matching_firmware) {
+if (!first_found) {
+

Re: [libvirt] [PATCH] bhyve: add support for passing stdin to loader

2018-06-03 Thread Roman Bogorodskiy
  Fabian Freyer wrote:

> On 26 Apr 2018, at 18:38, John Ferlan wrote:
> 
> > On 04/13/2018 03:27 PM, Fabian Freyer wrote:
> >> This commit adds the  node to the domain definition,
> >> with the following semantics:
> >>
> >> To pass standard input verbatim to the bootloader, set
> >>
> >> some stdin
> >>
> >> Multiline standard input can be set using a CDATA tag:
> >>
> >> 
> >>
> >> Standard input can be read from a file as follows:
> >>
> >> 
> >
> > Not my area of expertise, but some feedback to hopefully help a bit
> > seeing as there have been no other takes for 2 weeks.
> 
> Thanks!
> 
> > Personally this format over the other format would seem to be better
> > although the attribute name would be "path" not "file".  IOW: That whole
> > CDATA thing - not sure it passes by all the censors^W reviewers
> > scrutiny.  Is there a particular reason to have this CDATA tag syntax?
> The idea here is to be able to specify several lines of standard input,
> especially for line-oriented command line interfaces, while not needing
> to add a separate file.

If there are just a line or two to be passed to loader's stdin, being
able to specify that right in the domain xml feels more convenient than
creating a file.

> > Parsing the line and making sure consumers provide a specific format is
> > probably more hassle than it's worth and I would think presents an
> > opportunity to insert things that may cause interesting errors. Any time
> > you accept something from stdin like that you open up buffer overflows
> > and buffer handling problems. Not that the same thing cannot be in the
> > file, but at least you're then passing that off to something else to
> > manage whether what's in a file is correctly formatted as you're not
> > validating the contents of the file, just that it exists.
> 
> I’m not quite sure I comprehend the difference to a file here.
> 
> >>
> >> Signed-off-by: Fabian Freyer 
> >> ---
> >>  docs/formatdomain.html.in  | 19 ++

Would be good to add some example to drvbhyve.html.in as well.

> >>  docs/schemas/domaincommon.rng  | 10 
> >>  src/bhyve/bhyve_driver.c   | 10 
> >>  src/bhyve/bhyve_parse_command.c| 70 
> >> ++
> >>  src/bhyve/bhyve_process.c  | 22 +++
> >>  src/conf/domain_conf.c | 41 +
> >>  src/conf/domain_conf.h | 11 
> >>  .../bhyveargv2xml-loader-stdin-file.args   |  9 +++
> >>  .../bhyveargv2xml-loader-stdin-file.xml| 19 ++
> >>  .../bhyveargv2xml-loader-stdin-multiline.args  | 13 
> >>  .../bhyveargv2xml-loader-stdin-multiline.xml   | 21 +++
> >>  .../bhyveargv2xml-loader-stdin-oneline.args| 11 
> >>  .../bhyveargv2xml-loader-stdin-oneline.xml | 19 ++
> >>  tests/bhyveargv2xmltest.c  |  3 +
> >>  .../bhyvexml2argv-grub-stdin-file.args |  9 +++
> >>  .../bhyvexml2argv-grub-stdin-file.devmap   |  1 +
> >>  .../bhyvexml2argv-grub-stdin-file.ldargs   |  4 ++
> >>  .../bhyvexml2argv-grub-stdin-file.xml  | 25 
> >>  .../bhyvexml2argv-grub-stdin-multiline.args|  9 +++
> >>  .../bhyvexml2argv-grub-stdin-multiline.devmap  |  1 +
> >>  .../bhyvexml2argv-grub-stdin-multiline.ldargs  |  4 ++
> >>  .../bhyvexml2argv-grub-stdin-multiline.xml | 30 ++
> >>  .../bhyvexml2argv-grub-stdin-oneline.args  |  9 +++
> >>  .../bhyvexml2argv-grub-stdin-oneline.devmap|  1 +
> >>  .../bhyvexml2argv-grub-stdin-oneline.ldargs|  4 ++
> >>  .../bhyvexml2argv-grub-stdin-oneline.xml   | 25 
> >>  tests/bhyvexml2argvtest.c  |  3 +
> >>  .../bhyvexml2xmlout-grub-stdin-file.xml| 34 +++
> >>  .../bhyvexml2xmlout-grub-stdin-multiline.xml   | 39 
> >>  .../bhyvexml2xmlout-grub-stdin-oneline.xml | 34 +++
> >>  tests/bhyvexml2xmltest.c   |  3 +
> >>  31 files changed, 513 insertions(+)
> >>  create mode 100644 
> >> tests/bhyveargv2xmldata/bhyveargv2xml-loader-stdin-file.args
> >>  create mode 100644 
> >> tests/bhyveargv2xmldata/bhyveargv2xml-loader-stdin-file.xml
> >>  create mode 100644 
> >> tests/bhyveargv2xmldata/bhyveargv2xml-loader-stdin-multiline.args
> >>  create mode 100644 
> >> tests/bhyveargv2xmldata/bhyveargv2xml-loader-stdin-multiline.xml
> >>  create mode 100644 
> >> tests/bhyveargv2xmldata/bhyveargv2xml-loader-stdin-oneline.args
> >>  create mode 100644 
> >> tests/bhyveargv2xmldata/bhyveargv2xml-loader-stdin-oneline.xml
> >>  create mode 100644 
> >> tests/bhyvexml2argvdata/bhyvexml2argv-grub-stdin-file.args
> >>  create mode 100644 
> >> tests/bhyvexml2argvdata/bhyvexml2argv-grub-stdin-file.devmap
> >>  create mode 100644 
> >> 

Re: [libvirt] [PATCH] bhyve: add support for passing stdin to loader

2018-04-26 Thread Fabian Freyer


On 26 Apr 2018, at 18:38, John Ferlan wrote:

> On 04/13/2018 03:27 PM, Fabian Freyer wrote:
>> This commit adds the  node to the domain definition,
>> with the following semantics:
>>
>> To pass standard input verbatim to the bootloader, set
>>
>> some stdin
>>
>> Multiline standard input can be set using a CDATA tag:
>>
>> 
>>
>> Standard input can be read from a file as follows:
>>
>> 
>
> Not my area of expertise, but some feedback to hopefully help a bit
> seeing as there have been no other takes for 2 weeks.

Thanks!

> Personally this format over the other format would seem to be better
> although the attribute name would be "path" not "file".  IOW: That whole
> CDATA thing - not sure it passes by all the censors^W reviewers
> scrutiny.  Is there a particular reason to have this CDATA tag syntax?
The idea here is to be able to specify several lines of standard input,
especially for line-oriented command line interfaces, while not needing
to add a separate file.

> Parsing the line and making sure consumers provide a specific format is
> probably more hassle than it's worth and I would think presents an
> opportunity to insert things that may cause interesting errors. Any time
> you accept something from stdin like that you open up buffer overflows
> and buffer handling problems. Not that the same thing cannot be in the
> file, but at least you're then passing that off to something else to
> manage whether what's in a file is correctly formatted as you're not
> validating the contents of the file, just that it exists.

I’m not quite sure I comprehend the difference to a file here.

>>
>> Signed-off-by: Fabian Freyer 
>> ---
>>  docs/formatdomain.html.in  | 19 ++
>>  docs/schemas/domaincommon.rng  | 10 
>>  src/bhyve/bhyve_driver.c   | 10 
>>  src/bhyve/bhyve_parse_command.c| 70 
>> ++
>>  src/bhyve/bhyve_process.c  | 22 +++
>>  src/conf/domain_conf.c | 41 +
>>  src/conf/domain_conf.h | 11 
>>  .../bhyveargv2xml-loader-stdin-file.args   |  9 +++
>>  .../bhyveargv2xml-loader-stdin-file.xml| 19 ++
>>  .../bhyveargv2xml-loader-stdin-multiline.args  | 13 
>>  .../bhyveargv2xml-loader-stdin-multiline.xml   | 21 +++
>>  .../bhyveargv2xml-loader-stdin-oneline.args| 11 
>>  .../bhyveargv2xml-loader-stdin-oneline.xml | 19 ++
>>  tests/bhyveargv2xmltest.c  |  3 +
>>  .../bhyvexml2argv-grub-stdin-file.args |  9 +++
>>  .../bhyvexml2argv-grub-stdin-file.devmap   |  1 +
>>  .../bhyvexml2argv-grub-stdin-file.ldargs   |  4 ++
>>  .../bhyvexml2argv-grub-stdin-file.xml  | 25 
>>  .../bhyvexml2argv-grub-stdin-multiline.args|  9 +++
>>  .../bhyvexml2argv-grub-stdin-multiline.devmap  |  1 +
>>  .../bhyvexml2argv-grub-stdin-multiline.ldargs  |  4 ++
>>  .../bhyvexml2argv-grub-stdin-multiline.xml | 30 ++
>>  .../bhyvexml2argv-grub-stdin-oneline.args  |  9 +++
>>  .../bhyvexml2argv-grub-stdin-oneline.devmap|  1 +
>>  .../bhyvexml2argv-grub-stdin-oneline.ldargs|  4 ++
>>  .../bhyvexml2argv-grub-stdin-oneline.xml   | 25 
>>  tests/bhyvexml2argvtest.c  |  3 +
>>  .../bhyvexml2xmlout-grub-stdin-file.xml| 34 +++
>>  .../bhyvexml2xmlout-grub-stdin-multiline.xml   | 39 
>>  .../bhyvexml2xmlout-grub-stdin-oneline.xml | 34 +++
>>  tests/bhyvexml2xmltest.c   |  3 +
>>  31 files changed, 513 insertions(+)
>>  create mode 100644 
>> tests/bhyveargv2xmldata/bhyveargv2xml-loader-stdin-file.args
>>  create mode 100644 
>> tests/bhyveargv2xmldata/bhyveargv2xml-loader-stdin-file.xml
>>  create mode 100644 
>> tests/bhyveargv2xmldata/bhyveargv2xml-loader-stdin-multiline.args
>>  create mode 100644 
>> tests/bhyveargv2xmldata/bhyveargv2xml-loader-stdin-multiline.xml
>>  create mode 100644 
>> tests/bhyveargv2xmldata/bhyveargv2xml-loader-stdin-oneline.args
>>  create mode 100644 
>> tests/bhyveargv2xmldata/bhyveargv2xml-loader-stdin-oneline.xml
>>  create mode 100644 
>> tests/bhyvexml2argvdata/bhyvexml2argv-grub-stdin-file.args
>>  create mode 100644 
>> tests/bhyvexml2argvdata/bhyvexml2argv-grub-stdin-file.devmap
>>  create mode 100644 
>> tests/bhyvexml2argvdata/bhyvexml2argv-grub-stdin-file.ldargs
>>  create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-grub-stdin-file.xml
>>  create mode 100644 
>> tests/bhyvexml2argvdata/bhyvexml2argv-grub-stdin-multiline.args
>>  create mode 100644 
>> tests/bhyvexml2argvdata/bhyvexml2argv-grub-stdin-multiline.devmap
>>  create mode 100644 
>> tests/bhyvexml2argvdata/bhyvexml2argv-grub-stdin-multiline.ldargs
>>  create mode 100644 

Re: [libvirt] [PATCH] bhyve: add support for passing stdin to loader

2018-04-26 Thread John Ferlan


On 04/13/2018 03:27 PM, Fabian Freyer wrote:
> This commit adds the  node to the domain definition,
> with the following semantics:
> 
> To pass standard input verbatim to the bootloader, set
> 
> some stdin
> 
> Multiline standard input can be set using a CDATA tag:
> 
> 
> 
> Standard input can be read from a file as follows:
> 
> 

Not my area of expertise, but some feedback to hopefully help a bit
seeing as there have been no other takes for 2 weeks.

Personally this format over the other format would seem to be better
although the attribute name would be "path" not "file".  IOW: That whole
CDATA thing - not sure it passes by all the censors^W reviewers
scrutiny.  Is there a particular reason to have this CDATA tag syntax?
Parsing the line and making sure consumers provide a specific format is
probably more hassle than it's worth and I would think presents an
opportunity to insert things that may cause interesting errors. Any time
you accept something from stdin like that you open up buffer overflows
and buffer handling problems. Not that the same thing cannot be in the
file, but at least you're then passing that off to something else to
manage whether what's in a file is correctly formatted as you're not
validating the contents of the file, just that it exists.

> 
> Signed-off-by: Fabian Freyer 
> ---
>  docs/formatdomain.html.in  | 19 ++
>  docs/schemas/domaincommon.rng  | 10 
>  src/bhyve/bhyve_driver.c   | 10 
>  src/bhyve/bhyve_parse_command.c| 70 
> ++
>  src/bhyve/bhyve_process.c  | 22 +++
>  src/conf/domain_conf.c | 41 +
>  src/conf/domain_conf.h | 11 
>  .../bhyveargv2xml-loader-stdin-file.args   |  9 +++
>  .../bhyveargv2xml-loader-stdin-file.xml| 19 ++
>  .../bhyveargv2xml-loader-stdin-multiline.args  | 13 
>  .../bhyveargv2xml-loader-stdin-multiline.xml   | 21 +++
>  .../bhyveargv2xml-loader-stdin-oneline.args| 11 
>  .../bhyveargv2xml-loader-stdin-oneline.xml | 19 ++
>  tests/bhyveargv2xmltest.c  |  3 +
>  .../bhyvexml2argv-grub-stdin-file.args |  9 +++
>  .../bhyvexml2argv-grub-stdin-file.devmap   |  1 +
>  .../bhyvexml2argv-grub-stdin-file.ldargs   |  4 ++
>  .../bhyvexml2argv-grub-stdin-file.xml  | 25 
>  .../bhyvexml2argv-grub-stdin-multiline.args|  9 +++
>  .../bhyvexml2argv-grub-stdin-multiline.devmap  |  1 +
>  .../bhyvexml2argv-grub-stdin-multiline.ldargs  |  4 ++
>  .../bhyvexml2argv-grub-stdin-multiline.xml | 30 ++
>  .../bhyvexml2argv-grub-stdin-oneline.args  |  9 +++
>  .../bhyvexml2argv-grub-stdin-oneline.devmap|  1 +
>  .../bhyvexml2argv-grub-stdin-oneline.ldargs|  4 ++
>  .../bhyvexml2argv-grub-stdin-oneline.xml   | 25 
>  tests/bhyvexml2argvtest.c  |  3 +
>  .../bhyvexml2xmlout-grub-stdin-file.xml| 34 +++
>  .../bhyvexml2xmlout-grub-stdin-multiline.xml   | 39 
>  .../bhyvexml2xmlout-grub-stdin-oneline.xml | 34 +++
>  tests/bhyvexml2xmltest.c   |  3 +
>  31 files changed, 513 insertions(+)
>  create mode 100644 
> tests/bhyveargv2xmldata/bhyveargv2xml-loader-stdin-file.args
>  create mode 100644 
> tests/bhyveargv2xmldata/bhyveargv2xml-loader-stdin-file.xml
>  create mode 100644 
> tests/bhyveargv2xmldata/bhyveargv2xml-loader-stdin-multiline.args
>  create mode 100644 
> tests/bhyveargv2xmldata/bhyveargv2xml-loader-stdin-multiline.xml
>  create mode 100644 
> tests/bhyveargv2xmldata/bhyveargv2xml-loader-stdin-oneline.args
>  create mode 100644 
> tests/bhyveargv2xmldata/bhyveargv2xml-loader-stdin-oneline.xml
>  create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-grub-stdin-file.args
>  create mode 100644 
> tests/bhyvexml2argvdata/bhyvexml2argv-grub-stdin-file.devmap
>  create mode 100644 
> tests/bhyvexml2argvdata/bhyvexml2argv-grub-stdin-file.ldargs
>  create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-grub-stdin-file.xml
>  create mode 100644 
> tests/bhyvexml2argvdata/bhyvexml2argv-grub-stdin-multiline.args
>  create mode 100644 
> tests/bhyvexml2argvdata/bhyvexml2argv-grub-stdin-multiline.devmap
>  create mode 100644 
> tests/bhyvexml2argvdata/bhyvexml2argv-grub-stdin-multiline.ldargs
>  create mode 100644 
> tests/bhyvexml2argvdata/bhyvexml2argv-grub-stdin-multiline.xml
>  create mode 100644 
> tests/bhyvexml2argvdata/bhyvexml2argv-grub-stdin-oneline.args
>  create mode 100644 
> tests/bhyvexml2argvdata/bhyvexml2argv-grub-stdin-oneline.devmap
>  create mode 100644 
> tests/bhyvexml2argvdata/bhyvexml2argv-grub-stdin-oneline.ldargs
>  create mode 100644 
> 

[libvirt] [PATCH] bhyve: add support for passing stdin to loader

2018-04-15 Thread Fabian Freyer
This commit adds the  node to the domain definition,
with the following semantics:

To pass standard input verbatim to the bootloader, set

some stdin

Multiline standard input can be set using a CDATA tag:



Standard input can be read from a file as follows:



Signed-off-by: Fabian Freyer 
---
 docs/formatdomain.html.in  | 19 ++
 docs/schemas/domaincommon.rng  | 10 
 src/bhyve/bhyve_driver.c   | 10 
 src/bhyve/bhyve_parse_command.c| 70 ++
 src/bhyve/bhyve_process.c  | 22 +++
 src/conf/domain_conf.c | 41 +
 src/conf/domain_conf.h | 11 
 .../bhyveargv2xml-loader-stdin-file.args   |  9 +++
 .../bhyveargv2xml-loader-stdin-file.xml| 19 ++
 .../bhyveargv2xml-loader-stdin-multiline.args  | 13 
 .../bhyveargv2xml-loader-stdin-multiline.xml   | 21 +++
 .../bhyveargv2xml-loader-stdin-oneline.args| 11 
 .../bhyveargv2xml-loader-stdin-oneline.xml | 19 ++
 tests/bhyveargv2xmltest.c  |  3 +
 .../bhyvexml2argv-grub-stdin-file.args |  9 +++
 .../bhyvexml2argv-grub-stdin-file.devmap   |  1 +
 .../bhyvexml2argv-grub-stdin-file.ldargs   |  4 ++
 .../bhyvexml2argv-grub-stdin-file.xml  | 25 
 .../bhyvexml2argv-grub-stdin-multiline.args|  9 +++
 .../bhyvexml2argv-grub-stdin-multiline.devmap  |  1 +
 .../bhyvexml2argv-grub-stdin-multiline.ldargs  |  4 ++
 .../bhyvexml2argv-grub-stdin-multiline.xml | 30 ++
 .../bhyvexml2argv-grub-stdin-oneline.args  |  9 +++
 .../bhyvexml2argv-grub-stdin-oneline.devmap|  1 +
 .../bhyvexml2argv-grub-stdin-oneline.ldargs|  4 ++
 .../bhyvexml2argv-grub-stdin-oneline.xml   | 25 
 tests/bhyvexml2argvtest.c  |  3 +
 .../bhyvexml2xmlout-grub-stdin-file.xml| 34 +++
 .../bhyvexml2xmlout-grub-stdin-multiline.xml   | 39 
 .../bhyvexml2xmlout-grub-stdin-oneline.xml | 34 +++
 tests/bhyvexml2xmltest.c   |  3 +
 31 files changed, 513 insertions(+)
 create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-loader-stdin-file.args
 create mode 100644 tests/bhyveargv2xmldata/bhyveargv2xml-loader-stdin-file.xml
 create mode 100644 
tests/bhyveargv2xmldata/bhyveargv2xml-loader-stdin-multiline.args
 create mode 100644 
tests/bhyveargv2xmldata/bhyveargv2xml-loader-stdin-multiline.xml
 create mode 100644 
tests/bhyveargv2xmldata/bhyveargv2xml-loader-stdin-oneline.args
 create mode 100644 
tests/bhyveargv2xmldata/bhyveargv2xml-loader-stdin-oneline.xml
 create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-grub-stdin-file.args
 create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-grub-stdin-file.devmap
 create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-grub-stdin-file.ldargs
 create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-grub-stdin-file.xml
 create mode 100644 
tests/bhyvexml2argvdata/bhyvexml2argv-grub-stdin-multiline.args
 create mode 100644 
tests/bhyvexml2argvdata/bhyvexml2argv-grub-stdin-multiline.devmap
 create mode 100644 
tests/bhyvexml2argvdata/bhyvexml2argv-grub-stdin-multiline.ldargs
 create mode 100644 
tests/bhyvexml2argvdata/bhyvexml2argv-grub-stdin-multiline.xml
 create mode 100644 
tests/bhyvexml2argvdata/bhyvexml2argv-grub-stdin-oneline.args
 create mode 100644 
tests/bhyvexml2argvdata/bhyvexml2argv-grub-stdin-oneline.devmap
 create mode 100644 
tests/bhyvexml2argvdata/bhyvexml2argv-grub-stdin-oneline.ldargs
 create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-grub-stdin-oneline.xml
 create mode 100644 
tests/bhyvexml2xmloutdata/bhyvexml2xmlout-grub-stdin-file.xml
 create mode 100644 
tests/bhyvexml2xmloutdata/bhyvexml2xmlout-grub-stdin-multiline.xml
 create mode 100644 
tests/bhyvexml2xmloutdata/bhyvexml2xmlout-grub-stdin-oneline.xml

diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 5e99884dc..cea024235 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -245,6 +245,11 @@
 ...
 bootloader/usr/bin/pygrub/bootloader
 bootloader_args--append single/bootloader_args
+bootloader_stdin![CDATA[
+kernel (hd)/path/to/kernel
+initrd (host)/path/to/initrd
+boot
+]]
 ...
 
 
@@ -259,6 +264,20 @@
 command line arguments to be passed to the bootloader.
 Since 0.2.3
 
+  bootloader_stdin
+  The optional bootloader_stdin element specifies
+standard input to be passed to the bootloader. To pass multiple
+lines of standard input to the bootloader, wrap the content in
+a CDATA tag. Instead of specifying the standard input in the
+domain XML, the path to a file to be read may be given using the
+file 

Re: [libvirt] [PATCH] bhyve: add support for video device configuration

2017-06-12 Thread Roman Bogorodskiy
  John Ferlan wrote:

> 
> 
> On 05/09/2017 07:54 AM, Roman Bogorodskiy wrote:
> > 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.xml
> > 
> 
> As noted previously the xml2xml would be better served in the other
> patch. The rest seems reasonable, but obviously is affected by the other
> one... Still wanted to be sure to respond so that it's not left hanging
> without a response.

Good, I'll squash these two commits into a single one.

Roman Bogorodskiy


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH] bhyve: add support for video device configuration

2017-06-12 Thread John Ferlan


On 05/09/2017 07:54 AM, Roman Bogorodskiy wrote:
> 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.xml
> 

As noted previously the xml2xml would be better served in the other
patch. The rest seems reasonable, but obviously is affected by the other
one... Still wanted to be sure to respond so that it's not left hanging
without a response.

John

> 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 
> ATTRIBUTE_UNUSED,
> _("Unsupported listen type"));
>  }
>  
> +if (video->driver)
> +virBufferAsprintf(, ",vga=%s",
> +  
> virDomainVideoVgaconfTypeToString(video->driver->vgaconf));
> +
>  virCommandAddArg(cmd, "-s");
>  virCommandAddArgBuffer(cmd, );
>  return 0;
> diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-vgaconf.args 
> b/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-vgaconf.args
> new file mode 100644
> index 0..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=52:54:00:00:00:00 \
> +-s 4:0,fbuf,tcp=127.0.0.1:5904,vga=off \
> +-s 1,lpc bhyve
> diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-vgaconf.ldargs 
> b/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-vgaconf.ldargs
> new file mode 100644
> index 0..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 0..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
> +  
> +  
> +
> +  
> +  
> +  
> +  
> +
> +
> +  
> +  
> +   function='0x0'/>
> +
> +
> +  
> +
> +
> +  
> + 
> +  
> +
> +  
> +
> 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");
>  
>  /* Address allocation tests */
>  DO_TEST("addr-single-sata-disk");
> diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc-vgaconf.xml 
> b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc-vgaconf.xml
> new file mode 100644
> index 0..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
> +  
> +
> +  
> +  
> +  
> +  
> +
> +
> +
> +   function='0x0'/>
> +
> +
> +  
> +  
> +  
> +   function='0x0'/>
> +
> +
> +  
> +
> +
> +  
> +
> +  
> +   function='0x0'/>
> +
> +  
> +
> diff --git a/tests/bhyvexml2xmltest.c b/tests/bhyvexml2xmltest.c
> index b3759919e..70e4caeb3 100644
> --- 

Re: [libvirt] [PATCH] bhyve: add support for video device configuration

2017-06-06 Thread Roman Bogorodskiy
  Roman Bogorodskiy wrote:

> Sorry for the strange splitting of this (supposed-to-be) series,
> apparently I have something weird happening on my system so
> git-send-email authenticates only when sending the first patch :-(
> 
> Roman Bogorodskiy

ping?

As the series was unintentionally broken as mentioned above, the right
order is:

 - [PATCH 1/3] bhyve: tests: add vnc test to bhyvexml2xmltest
   https://www.redhat.com/archives/libvir-list/2017-May/msg00204.html

 - [PATCH 1/2] conf: add video driver configuration element
   https://www.redhat.com/archives/libvir-list/2017-May/msg00205.html

 - [PATCH] bhyve: add support for video device configuration
   https://www.redhat.com/archives/libvir-list/2017-May/msg00206.html
   ()

Roman Bogorodskiy


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH] bhyve: add support for video device configuration

2017-05-09 Thread Roman Bogorodskiy
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.xml

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 
ATTRIBUTE_UNUSED,
_("Unsupported listen type"));
 }
 
+if (video->driver)
+virBufferAsprintf(, ",vga=%s",
+  
virDomainVideoVgaconfTypeToString(video->driver->vgaconf));
+
 virCommandAddArg(cmd, "-s");
 virCommandAddArgBuffer(cmd, );
 return 0;
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-vgaconf.args 
b/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-vgaconf.args
new file mode 100644
index 0..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=52:54:00:00:00:00 \
+-s 4:0,fbuf,tcp=127.0.0.1:5904,vga=off \
+-s 1,lpc bhyve
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-vgaconf.ldargs 
b/tests/bhyvexml2argvdata/bhyvexml2argv-vnc-vgaconf.ldargs
new file mode 100644
index 0..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 0..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");
 
 /* Address allocation tests */
 DO_TEST("addr-single-sata-disk");
diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc-vgaconf.xml 
b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-vnc-vgaconf.xml
new file mode 100644
index 0..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
+  
+
+  
+  
+  
+  
+
+
+
+  
+
+
+  
+  
+  
+  
+
+
+  
+
+
+  
+
+  
+  
+
+  
+
diff --git a/tests/bhyvexml2xmltest.c b/tests/bhyvexml2xmltest.c
index b3759919e..70e4caeb3 100644
--- a/tests/bhyvexml2xmltest.c
+++ b/tests/bhyvexml2xmltest.c
@@ -105,6 +105,7 @@ mymain(void)
 DO_TEST_DIFFERENT("serial-grub");
 DO_TEST_DIFFERENT("serial-grub-nocons");
 DO_TEST_DIFFERENT("vnc");
+DO_TEST_DIFFERENT("vnc-vgaconf");
 
 /* Address allocation tests */
 DO_TEST_DIFFERENT("addr-single-sata-disk");
-- 
2.12.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] bhyve: add support for video device configuration

2017-05-09 Thread Roman Bogorodskiy
Sorry for the strange splitting of this (supposed-to-be) series,
apparently I have something weird happening on my system so
git-send-email authenticates only when sending the first patch :-(

Roman Bogorodskiy


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list