mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
qemu: block: Introduce qemuBlockStorageSourceGetSliceNodename
The helper retrieves the nodename of the slice layer if it's present. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
156ddb43b1
commit
05326395a9
@ -101,6 +101,22 @@ qemuBlockStorageSourceGetEffectiveNodename(virStorageSource *src)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* qemuBlockStorageSourceGetSliceNodename:
|
||||
*
|
||||
* Gets the nodename corresponding to the storage slice layer. Returns NULL
|
||||
* when there is no explicit storage slice layer.
|
||||
*/
|
||||
const char *
|
||||
qemuBlockStorageSourceGetSliceNodename(virStorageSource *src)
|
||||
{
|
||||
if (!src->sliceStorage)
|
||||
return NULL;
|
||||
|
||||
return src->sliceStorage->nodename;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* qemuBlockStorageSourceGetEffectiveStorageNodename:
|
||||
* @src: virStorageSource to get the effective nodename of
|
||||
@ -111,9 +127,10 @@ qemuBlockStorageSourceGetEffectiveNodename(virStorageSource *src)
|
||||
const char *
|
||||
qemuBlockStorageSourceGetEffectiveStorageNodename(virStorageSource *src)
|
||||
{
|
||||
if (src->sliceStorage &&
|
||||
src->sliceStorage->nodename)
|
||||
return src->sliceStorage->nodename;
|
||||
const char *slice = qemuBlockStorageSourceGetSliceNodename(src);
|
||||
|
||||
if (slice)
|
||||
return slice;
|
||||
|
||||
return src->nodenamestorage;
|
||||
}
|
||||
|
@ -40,6 +40,9 @@ qemuBlockStorageSourceGetEffectiveStorageNodename(virStorageSource *src);
|
||||
const char *
|
||||
qemuBlockStorageSourceGetStorageNodename(virStorageSource *src);
|
||||
|
||||
const char *
|
||||
qemuBlockStorageSourceGetSliceNodename(virStorageSource *src);
|
||||
|
||||
const char *
|
||||
qemuBlockStorageSourceGetFormatNodename(virStorageSource *src);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user