[libvirt] [PATCH] conf: Format disk pool part_separator attribute for running pool
Michal Privoznik
mprivozn at redhat.com
Thu Mar 17 14:59:58 UTC 2016
On 17.03.2016 12:36, John Ferlan wrote:
> Commit id '4f846170' added printing of a new field 'part_separator'; however,
> neglected to do so when there was an "freeExtent" defined for the device
> (as there would be when the disk pool was started).
>
> This patch adjusts the logic to appropriately format the device path and
> if there the part_separator attribute.
>
> Signed-off-by: John Ferlan <jferlan at redhat.com>
> ---
>
> Discovered during the validation of :
>
> https://bugzilla.redhat.com/show_bug.cgi?id=1265694
>
> src/conf/storage_conf.c | 17 ++++++++---------
> 1 file changed, 8 insertions(+), 9 deletions(-)
>
> diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c
> index bfba521..497c65f 100644
> --- a/src/conf/storage_conf.c
> +++ b/src/conf/storage_conf.c
> @@ -1055,9 +1055,15 @@ virStoragePoolSourceFormat(virBufferPtr buf,
> if ((options->flags & VIR_STORAGE_POOL_SOURCE_DEVICE) &&
> src->ndevice) {
> for (i = 0; i < src->ndevice; i++) {
> + virBufferEscapeString(buf, "<device path='%s'",
> + src->devices[i].path);
> + if (src->devices[i].part_separator !=
> + VIR_TRISTATE_SWITCH_ABSENT) {
> + virBufferAsprintf(buf, " part_separator='%s'",
> + virTristateBoolTypeToString(src->devices[i].part_separator));
> + }
> if (src->devices[i].nfreeExtent) {
> - virBufferEscapeString(buf, "<device path='%s'>\n",
> - src->devices[i].path);
> + virBufferAddLit(buf, ">\n");
> virBufferAdjustIndent(buf, 2);
> for (j = 0; j < src->devices[i].nfreeExtent; j++) {
> virBufferAsprintf(buf, "<freeExtent start='%llu' end='%llu'/>\n",
> @@ -1067,13 +1073,6 @@ virStoragePoolSourceFormat(virBufferPtr buf,
> virBufferAdjustIndent(buf, -2);
> virBufferAddLit(buf, "</device>\n");
> } else {
> - virBufferEscapeString(buf, "<device path='%s'",
> - src->devices[i].path);
> - if (src->devices[i].part_separator !=
> - VIR_TRISTATE_SWITCH_ABSENT) {
> - virBufferAsprintf(buf, " part_separator='%s'",
> - virTristateBoolTypeToString(src->devices[i].part_separator));
> - }
> virBufferAddLit(buf, "/>\n");
> }
> }
>
ACK
Michal
More information about the libvir-list
mailing list