mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 23:37:42 +00:00
conf: Refactor seclabel formatting in virDomainDiskSourceFormatInternal
Call the formatter function only once. Signed-off-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
bbacd6b113
commit
6bec169759
@ -22836,19 +22836,11 @@ virDomainDiskSourceFormatInternal(virBufferPtr buf,
|
|||||||
case VIR_STORAGE_TYPE_FILE:
|
case VIR_STORAGE_TYPE_FILE:
|
||||||
virBufferEscapeString(&attrBuf, " file='%s'", src->path);
|
virBufferEscapeString(&attrBuf, " file='%s'", src->path);
|
||||||
virBufferEscapeString(&attrBuf, " startupPolicy='%s'", startupPolicy);
|
virBufferEscapeString(&attrBuf, " startupPolicy='%s'", startupPolicy);
|
||||||
|
|
||||||
virDomainDiskSourceDefFormatSeclabel(&childBuf, src->nseclabels,
|
|
||||||
src->seclabels, flags,
|
|
||||||
skipSeclabels);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VIR_STORAGE_TYPE_BLOCK:
|
case VIR_STORAGE_TYPE_BLOCK:
|
||||||
virBufferEscapeString(&attrBuf, " dev='%s'", src->path);
|
virBufferEscapeString(&attrBuf, " dev='%s'", src->path);
|
||||||
virBufferEscapeString(&attrBuf, " startupPolicy='%s'", startupPolicy);
|
virBufferEscapeString(&attrBuf, " startupPolicy='%s'", startupPolicy);
|
||||||
|
|
||||||
virDomainDiskSourceDefFormatSeclabel(&childBuf, src->nseclabels,
|
|
||||||
src->seclabels, flags,
|
|
||||||
skipSeclabels);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VIR_STORAGE_TYPE_DIR:
|
case VIR_STORAGE_TYPE_DIR:
|
||||||
@ -22873,9 +22865,6 @@ virDomainDiskSourceFormatInternal(virBufferPtr buf,
|
|||||||
}
|
}
|
||||||
virBufferEscapeString(&attrBuf, " startupPolicy='%s'", startupPolicy);
|
virBufferEscapeString(&attrBuf, " startupPolicy='%s'", startupPolicy);
|
||||||
|
|
||||||
virDomainDiskSourceDefFormatSeclabel(&childBuf, src->nseclabels,
|
|
||||||
src->seclabels, flags,
|
|
||||||
skipSeclabels);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VIR_STORAGE_TYPE_NONE:
|
case VIR_STORAGE_TYPE_NONE:
|
||||||
@ -22885,6 +22874,12 @@ virDomainDiskSourceFormatInternal(virBufferPtr buf,
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (src->type != VIR_STORAGE_TYPE_NETWORK) {
|
||||||
|
virDomainDiskSourceDefFormatSeclabel(&childBuf, src->nseclabels,
|
||||||
|
src->seclabels, flags,
|
||||||
|
skipSeclabels);
|
||||||
|
}
|
||||||
|
|
||||||
/* Storage Source formatting will not carry through the blunder
|
/* Storage Source formatting will not carry through the blunder
|
||||||
* that disk source formatting had at one time to format the
|
* that disk source formatting had at one time to format the
|
||||||
* <auth> for a volume source type. The <auth> information is
|
* <auth> for a volume source type. The <auth> information is
|
||||||
|
Loading…
x
Reference in New Issue
Block a user