mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-25 07:05:28 +00:00
domain_conf: Introduce virDomainDefHasNVMeDisk
This function will return true if any of disks (or their backing chain) for given domain contains an NVMe disk. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> ACKed-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
parent
a88eef7c48
commit
abd7c4c746
@ -31479,6 +31479,20 @@ virDomainDefHasManagedPR(const virDomainDef *def)
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
virDomainDefHasNVMeDisk(const virDomainDef *def)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < def->ndisks; i++) {
|
||||
if (virStorageSourceChainHasNVMe(def->disks[i]->src))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
virDomainDefHasVFIOHostdev(const virDomainDef *def)
|
||||
{
|
||||
|
@ -3667,6 +3667,9 @@ virDomainDiskGetDetectZeroesMode(virDomainDiskDiscard discard,
|
||||
bool
|
||||
virDomainDefHasManagedPR(const virDomainDef *def);
|
||||
|
||||
bool
|
||||
virDomainDefHasNVMeDisk(const virDomainDef *def);
|
||||
|
||||
bool
|
||||
virDomainDefHasVFIOHostdev(const virDomainDef *def);
|
||||
|
||||
|
@ -310,6 +310,7 @@ virDomainDefHasManagedPR;
|
||||
virDomainDefHasMdevHostdev;
|
||||
virDomainDefHasMemballoon;
|
||||
virDomainDefHasMemoryHotplug;
|
||||
virDomainDefHasNVMeDisk;
|
||||
virDomainDefHasUSB;
|
||||
virDomainDefHasVcpusOffline;
|
||||
virDomainDefHasVFIOHostdev;
|
||||
|
Loading…
Reference in New Issue
Block a user