On Mon, Mar 18, 2019 at 04:54:51PM +0100, Peter Krempa wrote:
Move the formatters from virDomainDiskSourceFormatInternal to
virDomainStorageSourceFormat.
While 'startupPolicy' is attribute of the disk, we can format it when
formating generic virStorageSource into an element to allow simplifying
the code.
All but one callers pass 0, is it really worth putting a non-source
attribute here?
Since the arguments for virDomainStorageSourceFormat got complex this
patch also documents them.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/conf/domain_conf.c | 44 ++++++++++++++++++++++++++++++------------
src/conf/domain_conf.h | 5 ++++-
src/qemu/qemu_domain.c | 3 ++-
3 files changed, 38 insertions(+), 14 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 97d56c0067..4083839fc8 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -23755,12 +23755,32 @@ virDomainDiskSourceFormatPrivateData(virBufferPtr buf,
}
+/**
+ * virDomainStorageSourceFormat:
+ * @attrBuf: buffer for containing attribute portion of @src
+ * @childBuf: buffer for subelements of the formatted element
+ * @src: storage source to format
+ * @flags: XML formatter flags
+ * @seclabels: security labels are formatted if true
+ * @attrIndex: the 'index' attribute is formatted if true
+ * @policy: startup policy, taken from disk (use 0 to omit)
+ * @xmlopt: XML options data (for private data formatters)
+ *
+ * Formats @src into the attributes (@attrBuf) and subelements (@childBuf) ready
+ * for creating a full XML element representing @src.
+ *
+ * Note that this does _not_ format the 'type' and 'format' of @src due
to
+ * differences in callers.
different needs of callers.
+ */
int
Reviewed-by: Ján Tomko <jtomko(a)redhat.com>
Jano