diff --git a/docs/formatdomaincaps.rst b/docs/formatdomaincaps.rst index a2ad0acc3d..be45de8996 100644 --- a/docs/formatdomaincaps.rst +++ b/docs/formatdomaincaps.rst @@ -629,6 +629,31 @@ Crypto device capabilities are exposed under the ``crypto`` element. For instanc ``backendModel`` Options for the ``backendModel`` attribute of the ```` element. +Interface device +^^^^^^^^^^^^^^^^ + +Interface device corresponds to `network interface +`__ (````) in domain XML. + +:: + + + ... + + + + default + passt + + + ... + + + +``backendType`` + Options for the ``type`` attribute of the ```` element + + Features ~~~~~~~~ diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index 3f2d231d1c..199bac006b 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -607,6 +607,18 @@ virDomainCapsDeviceCryptoFormat(virBuffer *buf, } +static void +virDomainCapsDeviceNetFormat(virBuffer *buf, + const virDomainCapsDeviceNet *interface) +{ + FORMAT_PROLOGUE(interface); + + ENUM_PROCESS(interface, backendType, virDomainNetBackendTypeToString); + + FORMAT_EPILOGUE(interface); +} + + /** * virDomainCapsFeatureGICFormat: * @buf: target buffer @@ -787,6 +799,7 @@ virDomainCapsFormat(const virDomainCaps *caps) virDomainCapsDeviceRedirdevFormat(&buf, &caps->redirdev); virDomainCapsDeviceChannelFormat(&buf, &caps->channel); virDomainCapsDeviceCryptoFormat(&buf, &caps->crypto); + virDomainCapsDeviceNetFormat(&buf, &caps->net); virBufferAdjustIndent(&buf, -2); virBufferAddLit(&buf, "\n"); diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h index 986f3cb394..3fe62ce211 100644 --- a/src/conf/domain_capabilities.h +++ b/src/conf/domain_capabilities.h @@ -250,6 +250,13 @@ struct _virDomainCapsDeviceCrypto { virDomainCapsEnum backendModel; /* virDomainCryptoBackend */ }; +STATIC_ASSERT_ENUM(VIR_DOMAIN_NET_BACKEND_LAST); +typedef struct _virDomainCapsDeviceNet virDomainCapsDeviceNet; +struct _virDomainCapsDeviceNet { + virTristateBool supported; + virDomainCapsEnum backendType; /* virDomainNetBackendType */ +}; + typedef enum { VIR_DOMAIN_CAPS_FEATURE_IOTHREADS = 0, VIR_DOMAIN_CAPS_FEATURE_VMCOREINFO, @@ -286,6 +293,7 @@ struct _virDomainCaps { virDomainCapsDeviceRedirdev redirdev; virDomainCapsDeviceChannel channel; virDomainCapsDeviceCrypto crypto; + virDomainCapsDeviceNet net; /* add new domain devices here */ virDomainCapsFeatureGIC gic; diff --git a/src/conf/schemas/domaincaps.rng b/src/conf/schemas/domaincaps.rng index b8115fe028..f17a4e681d 100644 --- a/src/conf/schemas/domaincaps.rng +++ b/src/conf/schemas/domaincaps.rng @@ -212,6 +212,9 @@ + + + @@ -285,6 +288,13 @@ + + + + + + +