On 09/23/2015 12:51 AM, Shivangi Dhir wrote:
[...]
>
> Thanks alot for your feedback.
> Should I modify and resend the patches after making the changes
> suggested above, if there are no other issues ?
>
>
I should be able to jiggle your patches - I'll work on those tomorrow
(for me).
I also found out from practice that using virDomainVirtType in the
capabilities.{h,c} functions & structures would result in many more
changes in order to pull in the definition from domain_conf.h. So just
kept them as int, but added a comment to make it more obvious.
I'll end up with two patches, with the first getting the attached
squashed in... Unless someone comes up with a path that's using the
numerical representation - it just seemed the virtType would be (but I
can check that).
John
>From a27c58e42f95e2929ebf0ca0819ed187a513f63e Mon Sep 17 00:00:00 2001
From: John Ferlan <[email protected]>
Date: Wed, 23 Sep 2015 18:04:43 -0400
Subject: [PATCH 2/3] merge
Signed-off-by: John Ferlan <[email protected]>
---
src/conf/capabilities.c | 11 ++++++-----
src/conf/capabilities.h | 6 +++---
2 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c
index b420f9f..86ea212 100644
--- a/src/conf/capabilities.c
+++ b/src/conf/capabilities.c
@@ -1,7 +1,7 @@
/*
* capabilities.c: hypervisor capabilities
*
- * Copyright (C) 2006-2014 Red Hat, Inc.
+ * Copyright (C) 2006-2015 Red Hat, Inc.
* Copyright (C) 2006-2008 Daniel P. Berrange
*
* This library is free software; you can redistribute it and/or
@@ -573,7 +573,7 @@ virCapsDomainDataCompare(virCapsGuestPtr guest,
virCapsGuestMachinePtr machine,
int ostype,
virArch arch,
- int domaintype,
+ virDomainVirtType domaintype,
const char *emulator,
const char *machinetype)
{
@@ -584,7 +584,8 @@ virCapsDomainDataCompare(virCapsGuestPtr guest,
if ((arch != VIR_ARCH_NONE) && (guest->arch.id != arch))
return false;
- if (domaintype != VIR_DOMAIN_VIRT_NONE && (!domain || domain->type != domaintype))
+ if (domaintype != VIR_DOMAIN_VIRT_NONE &&
+ (!domain || domain->type != domaintype))
return false;
if (emulator) {
@@ -611,7 +612,7 @@ static virCapsDomainDataPtr
virCapabilitiesDomainDataLookupInternal(virCapsPtr caps,
int ostype,
virArch arch,
- int domaintype,
+ virDomainVirtType domaintype,
const char *emulator,
const char *machinetype)
{
@@ -678,7 +679,7 @@ virCapabilitiesDomainDataLookupInternal(virCapsPtr caps,
virDomainOSTypeToString(ostype));
if (arch)
virBufferAsprintf(&buf, "arch=%s ", virArchToString(arch));
- if (domaintype)
+ if (domaintype > VIR_DOMAIN_VIRT_NONE)
virBufferAsprintf(&buf, "domaintype=%s ",
virDomainVirtTypeToString(domaintype));
if (emulator)
diff --git a/src/conf/capabilities.h b/src/conf/capabilities.h
index c14fcf6..1754b13 100644
--- a/src/conf/capabilities.h
+++ b/src/conf/capabilities.h
@@ -1,7 +1,7 @@
/*
* capabilities.h: hypervisor capabilities
*
- * Copyright (C) 2006-2014 Red Hat, Inc.
+ * Copyright (C) 2006-2015 Red Hat, Inc.
* Copyright (C) 2006-2008 Daniel P. Berrange
*
* This library is free software; you can redistribute it and/or
@@ -61,7 +61,7 @@ struct _virCapsGuestDomainInfo {
typedef struct _virCapsGuestDomain virCapsGuestDomain;
typedef virCapsGuestDomain *virCapsGuestDomainPtr;
struct _virCapsGuestDomain {
- int type;
+ int type; /* virDomainVirtType */
virCapsGuestDomainInfo info;
};
@@ -197,7 +197,7 @@ typedef virCapsDomainData *virCapsDomainDataPtr;
struct _virCapsDomainData {
int ostype;
int arch;
- int domaintype;
+ int domaintype; /* virDomainVirtType */
const char *emulator;
const char *machinetype;
};
--
2.1.0
--
libvir-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/libvir-list