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:
Michal Privoznik 2019-06-21 18:00:01 +02:00
parent a88eef7c48
commit abd7c4c746
3 changed files with 18 additions and 0 deletions

View File

@ -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)
{

View File

@ -3667,6 +3667,9 @@ virDomainDiskGetDetectZeroesMode(virDomainDiskDiscard discard,
bool
virDomainDefHasManagedPR(const virDomainDef *def);
bool
virDomainDefHasNVMeDisk(const virDomainDef *def);
bool
virDomainDefHasVFIOHostdev(const virDomainDef *def);

View File

@ -310,6 +310,7 @@ virDomainDefHasManagedPR;
virDomainDefHasMdevHostdev;
virDomainDefHasMemballoon;
virDomainDefHasMemoryHotplug;
virDomainDefHasNVMeDisk;
virDomainDefHasUSB;
virDomainDefHasVcpusOffline;
virDomainDefHasVFIOHostdev;