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

Ján Tomko jtomko at redhat.com
Mon Mar 18 17:37:09 UTC 2019


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 at 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 at redhat.com>

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20190318/76f52c8b/attachment-0001.sig>


More information about the libvir-list mailing list