提交 4e2d82f7 编写于 作者: A Andrea Bolognani

conf: Expose GIC capabilities

Add information about GIC capabilities to virDomainCaps and update
the formatter to include them in the XML output.
上级 24f17f55
...@@ -262,6 +262,34 @@ virDomainCapsDeviceHostdevFormat(virBufferPtr buf, ...@@ -262,6 +262,34 @@ virDomainCapsDeviceHostdevFormat(virBufferPtr buf,
} }
/**
* virDomainCapsFeatureGICFormat:
* @buf: target buffer
* @gic: GIC features
*
* Format GIC features for inclusion in the domcapabilities XML.
*
* The resulting XML will look like
*
* <gic supported='yes'>
* <enum name='version>
* <value>2</value>
* <value>3</value>
* </enum>
* </gic>
*/
static void
virDomainCapsFeatureGICFormat(virBufferPtr buf,
virDomainCapsFeatureGICPtr const gic)
{
FORMAT_PROLOGUE(gic);
ENUM_PROCESS(gic, version, virGICVersionTypeToString);
FORMAT_EPILOGUE(gic);
}
static int static int
virDomainCapsFormatInternal(virBufferPtr buf, virDomainCapsFormatInternal(virBufferPtr buf,
virDomainCapsPtr const caps) virDomainCapsPtr const caps)
...@@ -291,6 +319,14 @@ virDomainCapsFormatInternal(virBufferPtr buf, ...@@ -291,6 +319,14 @@ virDomainCapsFormatInternal(virBufferPtr buf,
virBufferAdjustIndent(buf, -2); virBufferAdjustIndent(buf, -2);
virBufferAddLit(buf, "</devices>\n"); virBufferAddLit(buf, "</devices>\n");
virBufferAddLit(buf, "<features>\n");
virBufferAdjustIndent(buf, 2);
virDomainCapsFeatureGICFormat(buf, &caps->gic);
virBufferAdjustIndent(buf, -2);
virBufferAddLit(buf, "</features>\n");
virBufferAdjustIndent(buf, -2); virBufferAdjustIndent(buf, -2);
virBufferAddLit(buf, "</domainCapabilities>\n"); virBufferAddLit(buf, "</domainCapabilities>\n");
return 0; return 0;
......
...@@ -81,6 +81,13 @@ struct _virDomainCapsDeviceHostdev { ...@@ -81,6 +81,13 @@ struct _virDomainCapsDeviceHostdev {
/* add new fields here */ /* add new fields here */
}; };
typedef struct _virDomainCapsFeatureGIC virDomainCapsFeatureGIC;
typedef virDomainCapsFeatureGIC *virDomainCapsFeatureGICPtr;
struct _virDomainCapsFeatureGIC {
bool supported;
virDomainCapsEnum version; /* Info about virGICVersion */
};
struct _virDomainCaps { struct _virDomainCaps {
virObjectLockable parent; virObjectLockable parent;
...@@ -96,6 +103,9 @@ struct _virDomainCaps { ...@@ -96,6 +103,9 @@ struct _virDomainCaps {
virDomainCapsDeviceDisk disk; virDomainCapsDeviceDisk disk;
virDomainCapsDeviceHostdev hostdev; virDomainCapsDeviceHostdev hostdev;
/* add new domain devices here */ /* add new domain devices here */
virDomainCapsFeatureGIC gic;
/* add new domain features here */
}; };
virDomainCapsPtr virDomainCapsNew(const char *path, virDomainCapsPtr virDomainCapsNew(const char *path,
......
...@@ -8,4 +8,7 @@ ...@@ -8,4 +8,7 @@
<disk supported='no'/> <disk supported='no'/>
<hostdev supported='no'/> <hostdev supported='no'/>
</devices> </devices>
<features>
<gic supported='no'/>
</features>
</domainCapabilities> </domainCapabilities>
...@@ -68,4 +68,7 @@ ...@@ -68,4 +68,7 @@
</enum> </enum>
</hostdev> </hostdev>
</devices> </devices>
<features>
<gic supported='no'/>
</features>
</domainCapabilities> </domainCapabilities>
...@@ -56,4 +56,7 @@ ...@@ -56,4 +56,7 @@
</enum> </enum>
</hostdev> </hostdev>
</devices> </devices>
<features>
<gic supported='no'/>
</features>
</domainCapabilities> </domainCapabilities>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册