mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
conf: storage: remove redundant condition
We exit early if poolOptions->formatToString is false.
Fixes: 9dadc73029
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
6e48e02475
commit
d063389f10
@ -364,6 +364,7 @@ virStoragePoolOptionsFormatPool(virBuffer *buf,
|
|||||||
int type)
|
int type)
|
||||||
{
|
{
|
||||||
virStoragePoolOptions *poolOptions;
|
virStoragePoolOptions *poolOptions;
|
||||||
|
size_t i;
|
||||||
|
|
||||||
if (!(poolOptions = virStoragePoolOptionsForPoolType(type)))
|
if (!(poolOptions = virStoragePoolOptionsForPoolType(type)))
|
||||||
return -1;
|
return -1;
|
||||||
@ -374,9 +375,6 @@ virStoragePoolOptionsFormatPool(virBuffer *buf,
|
|||||||
virBufferAddLit(buf, "<poolOptions>\n");
|
virBufferAddLit(buf, "<poolOptions>\n");
|
||||||
virBufferAdjustIndent(buf, 2);
|
virBufferAdjustIndent(buf, 2);
|
||||||
|
|
||||||
if (poolOptions->formatToString) {
|
|
||||||
size_t i;
|
|
||||||
|
|
||||||
virBufferAsprintf(buf, "<defaultFormat type='%s'/>\n",
|
virBufferAsprintf(buf, "<defaultFormat type='%s'/>\n",
|
||||||
(poolOptions->formatToString)(poolOptions->defaultFormat));
|
(poolOptions->formatToString)(poolOptions->defaultFormat));
|
||||||
|
|
||||||
@ -384,12 +382,10 @@ virStoragePoolOptionsFormatPool(virBuffer *buf,
|
|||||||
virBufferAdjustIndent(buf, 2);
|
virBufferAdjustIndent(buf, 2);
|
||||||
|
|
||||||
for (i = 0; i < poolOptions->lastFormat; i++)
|
for (i = 0; i < poolOptions->lastFormat; i++)
|
||||||
virBufferAsprintf(buf, "<value>%s</value>\n",
|
virBufferAsprintf(buf, "<value>%s</value>\n", (poolOptions->formatToString)(i));
|
||||||
(poolOptions->formatToString)(i));
|
|
||||||
|
|
||||||
virBufferAdjustIndent(buf, -2);
|
virBufferAdjustIndent(buf, -2);
|
||||||
virBufferAddLit(buf, "</enum>\n");
|
virBufferAddLit(buf, "</enum>\n");
|
||||||
}
|
|
||||||
|
|
||||||
virBufferAdjustIndent(buf, -2);
|
virBufferAdjustIndent(buf, -2);
|
||||||
virBufferAddLit(buf, "</poolOptions>\n");
|
virBufferAddLit(buf, "</poolOptions>\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user