mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 20:15:17 +00:00
domcaps: Add function for initializing domain caps as unsupported
For future extensions of the domain caps it's useful to have a single point that initializes all capabilities as unsupported by a driver. The driver then can enable specific ones. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
f2316d8d26
commit
5751a0b6b1
@ -116,9 +116,7 @@ virBhyveDomainCapsFill(virDomainCapsPtr caps,
|
||||
}
|
||||
|
||||
caps->hostdev.supported = VIR_TRISTATE_BOOL_NO;
|
||||
caps->iothreads = VIR_TRISTATE_BOOL_NO;
|
||||
caps->vmcoreinfo = VIR_TRISTATE_BOOL_NO;
|
||||
caps->genid = VIR_TRISTATE_BOOL_NO;
|
||||
virDomainCapsFeaturesInitUnsupported(caps);
|
||||
caps->gic.supported = VIR_TRISTATE_BOOL_NO;
|
||||
|
||||
return 0;
|
||||
|
@ -309,6 +309,20 @@ virDomainCapsEnumClear(virDomainCapsEnumPtr capsEnum)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @caps: domain caps
|
||||
*
|
||||
* Initializes all features in 'caps' as unsupported.
|
||||
*/
|
||||
void
|
||||
virDomainCapsFeaturesInitUnsupported(virDomainCapsPtr caps)
|
||||
{
|
||||
caps->iothreads = VIR_TRISTATE_BOOL_NO;
|
||||
caps->vmcoreinfo = VIR_TRISTATE_BOOL_NO;
|
||||
caps->genid = VIR_TRISTATE_BOOL_NO;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
virDomainCapsEnumFormat(virBufferPtr buf,
|
||||
const virDomainCapsEnum *capsEnum,
|
||||
|
@ -225,6 +225,8 @@ int virDomainCapsEnumSet(virDomainCapsEnumPtr capsEnum,
|
||||
unsigned int *values);
|
||||
void virDomainCapsEnumClear(virDomainCapsEnumPtr capsEnum);
|
||||
|
||||
void virDomainCapsFeaturesInitUnsupported(virDomainCapsPtr caps);
|
||||
|
||||
char * virDomainCapsFormat(const virDomainCaps *caps);
|
||||
|
||||
int virDomainCapsDeviceDefValidate(const virDomainCaps *caps,
|
||||
|
@ -202,6 +202,7 @@ virDomainCapsCPUUsableTypeToString;
|
||||
virDomainCapsDeviceDefValidate;
|
||||
virDomainCapsEnumClear;
|
||||
virDomainCapsEnumSet;
|
||||
virDomainCapsFeaturesInitUnsupported;
|
||||
virDomainCapsFormat;
|
||||
virDomainCapsNew;
|
||||
virSEVCapabilitiesFree;
|
||||
|
@ -764,9 +764,8 @@ libxlMakeDomainCapabilities(virDomainCapsPtr domCaps,
|
||||
libxlMakeDomainDeviceHostdevCaps(hostdev) < 0)
|
||||
return -1;
|
||||
|
||||
domCaps->iothreads = VIR_TRISTATE_BOOL_NO;
|
||||
domCaps->vmcoreinfo = VIR_TRISTATE_BOOL_NO;
|
||||
domCaps->genid = VIR_TRISTATE_BOOL_NO;
|
||||
virDomainCapsFeaturesInitUnsupported(domCaps);
|
||||
|
||||
domCaps->gic.supported = VIR_TRISTATE_BOOL_NO;
|
||||
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user