Commit Graph

19 Commits

Author SHA1 Message Date
Tomáš Ryšavý
239caffb1d tests: Rename virtTestCompareToFile to virTestCompareToFile.
This function doesn't follow our convention of naming functions.
2016-06-08 11:23:12 -04:00
Tomáš Ryšavý
cd7dd1508d tests: Rename virtTestRun to virTestRun.
This function doesn't follow our convention of naming functions.
2016-06-08 11:23:12 -04:00
Roman Bogorodskiy
ef01addb38 bhyve: bhyveload: respect boot dev and boot order
Make bhyveload respect boot order as specified by os.boot section of the
domain XML or by "boot order" for specific devices. As bhyve does not
support a real boot order specification right now, it's just about
choosing a single device to boot from.
2016-01-25 04:19:33 +03:00
Roman Bogorodskiy
6cb9ef1bab bhyve: add UTC clock support
Bhyve as of r279225 (FreeBSD -CURRENT) or r284894 (FreeBSD 10-STABLE)
supports using UTC time offset via the '-u' argument to bhyve(8). By
default it's still using localtime.

Make the bhyve driver use UTC clock if it's requested by specifying
<clock offset='utc'> in domain XML and if the bhyve(8) binary supports
the '-u' flag.
2015-07-22 19:05:09 +03:00
Roman Bogorodskiy
846cc14c4d bhyve: fix bhyvexml2argvtest build with gcc
gcc5 reports an error like this:

bhyvexml2argvtest.c: In function 'testCompareXMLToArgvFiles':
bhyvexml2argvtest.c:24:18: error: variable 'vm' set but not used
[-Werror=unused-but-set-variable]
     virDomainObj vm;
                  ^
cc1: all warnings being treated as errors

Fix by dropping this variable.
2015-05-11 20:08:47 +03:00
Roman Bogorodskiy
0d6563d7f0 bhyve: fix build in tests
Commit ca32929 caused build errors in bhyvexml2argvtest.c because of
some undefined variables.

Pushing under the build breaker rule.
2015-04-24 19:54:12 +03:00
Cole Robinson
ca32929908 tests: Add virtTestCompareToFile
Replaces a common pattern used in many test files
2015-04-23 17:08:48 -04:00
Roman Bogorodskiy
c42dbd8a18 bhyve: fix build in tests
Commit 835cf84 dropped expectedVirtTypes argument for
virDomainDefParse*() functions, however bhyve tests still try to pass
that to virDomainDefParseFile(), therefore build fails.

Fix build by fixing virDomainDefParseFile() usage.
2015-04-23 10:54:32 +04:00
Daniel P. Berrange
0ecd685109 Give virDomainDef parser & formatter their own flags
The virDomainDefParse* and virDomainDefFormat* methods both
accept the VIR_DOMAIN_XML_* flags defined in the public API,
along with a set of other VIR_DOMAIN_XML_INTERNAL_* flags
defined in domain_conf.c.

This is seriously confusing & error prone for a number of
reasons:

 - VIR_DOMAIN_XML_SECURE, VIR_DOMAIN_XML_MIGRATABLE and
   VIR_DOMAIN_XML_UPDATE_CPU are only relevant for the
   formatting operation
 - Some of the VIR_DOMAIN_XML_INTERNAL_* flags only apply
   to parse or to format, but not both.

This patch cleanly separates out the flags. There are two
distint VIR_DOMAIN_DEF_PARSE_* and VIR_DOMAIN_DEF_FORMAT_*
flags that are used by the corresponding methods. The
VIR_DOMAIN_XML_* flags received via public API calls must
be converted to the VIR_DOMAIN_DEF_FORMAT_* flags where
needed.

The various calls to virDomainDefParse which hardcoded the
use of the VIR_DOMAIN_XML_INACTIVE flag change to use the
VIR_DOMAIN_DEF_PARSE_INACTIVE flag.
2015-01-13 16:26:12 +00:00
Conrad Meyer
cdbb21bc59 drvbhyve: Use boot-order for grub-bhyve boot device
Rather than just picking the first CD (or failing that, HDD) we come
across, if the user has picked a boot device ordering with <boot
order=''>, respect that (and just try to boot the lowest-index device).

Adds two sets of tests to bhyve2xmlargv; 'grub-bootorder' shows that we
pick a user-specified device over the first device in the domain;
'grub-bootorder2' shows that we pick the first (lowest index) device.
2014-11-13 15:40:48 +01:00
Conrad Meyer
a52b56b3fd bhyvexml2argv: Add test for grub console support 2014-11-12 09:55:22 +01:00
Conrad Meyer
cf133ed1c6 bhyvexml2argv: Add tests for domain-configured bootloader, args 2014-11-12 09:55:22 +01:00
Conrad Meyer
f2ce9d3645 bhyvexml2argv: Add loader argv tests. 2014-11-12 09:55:22 +01:00
Roman Bogorodskiy
6c2e7d0b17 bhyve: add volumes support
Update bhyveBuildDiskArgStr to support volumes:

 - Make virBhyveProcessBuildBhyveCmd and
   virBhyveProcessBuildLoadCmd take virConnectPtr as the
   first argument instead of bhyveConnPtr as virConnectPtr is
   needed for virStorageTranslateDiskSourcePool,
 - Add virStorageTranslateDiskSourcePool call to
   virBhyveProcessBuildBhyveCmd and
   virBhyveProcessBuildLoadCmd,
 - Allow disks of type VIR_STORAGE_TYPE_VOLUME
2014-08-19 20:50:22 +04:00
Roman Bogorodskiy
d704e69858 bhyve: cdrom support
Add support for CDROM devices for bhyve driver using
bhyve(8)'s 'ahci-cd' device type.

As bhyve currently does not support media insertion at runtime,
disallow to start a domain with an empty source path for cdrom
devices.
2014-07-24 18:56:37 +04:00
Roman Bogorodskiy
07e371fc36 bhyve: improve bhyve_command.c testability
* bhyve_command.c (bhyveBuildNetArgStr, virBhyveProcessBuildBhyveCmd):
  add dryRun mode which doesn't create any devices when enabled
* bhyve_command.c (virBhyveProcessBuildBhyveCmd,
  virBhyveProcessBuildDestroyCmd, virBhyveProcessBuildLoadCmd): accept
  virDomainDefPtr instead of virDomainObjPtr.
2014-05-04 17:43:54 +04:00
Roman Bogorodskiy
548f21d087 tests: use virBhyveCapsBuild in bhyvexml2argv test
As we can use virBhyveCapsBuild() now, replace
testBhyveBuildCapabilities() with it.
2014-04-09 10:27:16 +04:00
Roman Bogorodskiy
4463e438e2 bhyve: add xml2argv tests for console 2014-04-05 19:12:18 +04:00
Roman Bogorodskiy
1994d2dddb bhyve: add xml2args unittest
At this point unittest covers 4 basic cases:

 - minimal working XML for bhyve
 - same as above, but with virtio disk
 - ACPI and APIC args test
 - MAC address test
2014-03-27 08:33:41 +04:00