[libvirt] [PATCH] docs: split typedef and struct definition for apibuild.py

Claudio Bley claudio.bley at gmail.com
Thu Dec 18 21:31:28 UTC 2014


The members of struct virSecurityLabel[1] and struct
virSecurityModel[2] were not shown in the libvirt API docs because the
corresponding <field> elements were missing from the libvirt-api.xml.

The reason is that apibuild.py does not cope well with typedef's using
inline struct definitions. It fails to associate any info about the
struct with the typedef and consequently cannot write out the members
of the struct.

Splitting the typedef and the struct definition into seperate
statements as it is done for other structs works around this problem.

[1]: http://libvirt.org/html/libvirt-libvirt-host.html#virSecurityLabel
[2]: http://libvirt.org/html/libvirt-libvirt-host.html#virSecurityModel
---
Seems I had to run "make" twice inside the docs folder before the changes
were picked up.

Besides, my email address has changed. If this this patch gets ACKed,
I'd also adjust the AUTHORS file in a separate trivial patch.

include/libvirt/libvirt-host.h | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/include/libvirt/libvirt-host.h b/include/libvirt/libvirt-host.h
index 53b529f..0704672 100644
--- a/include/libvirt/libvirt-host.h
+++ b/include/libvirt/libvirt-host.h
@@ -108,12 +108,13 @@ typedef virStream *virStreamPtr;
  * a virSecurityLabel is a structure filled by virDomainGetSecurityLabel(),
  * providing the security label and associated attributes for the specified
  * domain.
- *
  */
-typedef struct _virSecurityLabel {
+typedef struct _virSecurityLabel virSecurityLabel;
+
+struct _virSecurityLabel {
     char label[VIR_SECURITY_LABEL_BUFLEN];    /* security label string */
     int enforcing;                            /* 1 if security policy is being enforced for domain */
-} virSecurityLabel;
+};
 
 /**
  * virSecurityLabelPtr:
@@ -142,12 +143,13 @@ typedef virSecurityLabel *virSecurityLabelPtr;
  * a virSecurityModel is a structure filled by virNodeGetSecurityModel(),
  * providing the per-hypervisor security model and DOI attributes for the
  * specified domain.
- *
  */
-typedef struct _virSecurityModel {
+typedef struct _virSecurityModel virSecurityModel;
+
+struct _virSecurityModel {
     char model[VIR_SECURITY_MODEL_BUFLEN];      /* security model string */
     char doi[VIR_SECURITY_DOI_BUFLEN];          /* domain of interpetation */
-} virSecurityModel;
+};
 
 /**
  * virSecurityModelPtr:
-- 
2.2.0




More information about the libvir-list mailing list