Re: [PATCH v2 2/2] Xen: Fake versions in xencapstest

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/14/2011 06:10 AM, Philipp Hahn wrote:
virInitialize() → xenRegister() → xenhypervisorInit() determins the

s/determins/determines/

version of the Hypervisor. This breaks xencapstest when building as root
on a dom0 system, since xenHypervisorBuildCapabilities() adds the "hap"
and "viridian" features based on the detected version.

Add an optional parameter to xenhypervisorInit() to disable automatic
detection of the Hypervisor version. The passed in arguments are used
instead.

Signed-off-by: Philipp Hahn<hahn@xxxxxxxxxxxxx>
---
  src/xen/xen_driver.c     |    2 +-
  src/xen/xen_hypervisor.c |   14 ++++++++++++--
  src/xen/xen_hypervisor.h |    2 +-
  tests/xencapstest.c      |   10 ++++++++++
  4 files changed, 24 insertions(+), 4 deletions(-)

Yay - the override approach is much nicer than skipping the test. Glad it was this easy to figure out.

+++ b/src/xen/xen_hypervisor.c
@@ -1951,12 +1951,16 @@ virXen_getvcpusinfo(int handle, int id, unsigned int vcpu, virVcpuInfoPtr ipt,

  /**
   * xenHypervisorInit:
+ * @override_versions: pointer to optional struct xenHypervisorVersions with
+ *     version informations used instead of automatic version detection.

s/informations/information/

+++ b/tests/xencapstest.c
@@ -145,11 +145,21 @@ static int testXenppc64(const void *data ATTRIBUTE_UNUSED) {
  }


+/* Fake initialization data for xenHypervisorInit(). Must be initialized
+ * explicitly before the implicit call via virInitialize(). */
+static struct xenHypervisorVersions hv_versions = {
+	.hv = 0,
+	.hypervisor = 2,
+	.sys_interface = -1,
+	.dom_interface = -1

Trailing commas make it easier to expand this in the future, if we ever need to. And again, no tabs.

ACK with nits fixed, and pushed.

--
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

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



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]