Re: [PATCH 02/34] conf: Move formatting of 'index' and 'startupPolicy' for virStorageSource

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
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@xxxxxxxxxx>

Jano

Attachment: signature.asc
Description: Digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux