mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 11:35:19 +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:
|
* qemuBlockStorageSourceGetEffectiveStorageNodename:
|
||||||
* @src: virStorageSource to get the effective nodename of
|
* @src: virStorageSource to get the effective nodename of
|
||||||
@ -111,9 +127,10 @@ qemuBlockStorageSourceGetEffectiveNodename(virStorageSource *src)
|
|||||||
const char *
|
const char *
|
||||||
qemuBlockStorageSourceGetEffectiveStorageNodename(virStorageSource *src)
|
qemuBlockStorageSourceGetEffectiveStorageNodename(virStorageSource *src)
|
||||||
{
|
{
|
||||||
if (src->sliceStorage &&
|
const char *slice = qemuBlockStorageSourceGetSliceNodename(src);
|
||||||
src->sliceStorage->nodename)
|
|
||||||
return src->sliceStorage->nodename;
|
if (slice)
|
||||||
|
return slice;
|
||||||
|
|
||||||
return src->nodenamestorage;
|
return src->nodenamestorage;
|
||||||
}
|
}
|
||||||
|
@ -40,6 +40,9 @@ qemuBlockStorageSourceGetEffectiveStorageNodename(virStorageSource *src);
|
|||||||
const char *
|
const char *
|
||||||
qemuBlockStorageSourceGetStorageNodename(virStorageSource *src);
|
qemuBlockStorageSourceGetStorageNodename(virStorageSource *src);
|
||||||
|
|
||||||
|
const char *
|
||||||
|
qemuBlockStorageSourceGetSliceNodename(virStorageSource *src);
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
qemuBlockStorageSourceGetFormatNodename(virStorageSource *src);
|
qemuBlockStorageSourceGetFormatNodename(virStorageSource *src);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user