virhostdev: Fix const correctness of virHostdevIs{PCINet,SCSI,Mdev}Device()

These functions do not change any of the passed hostdevs. They
just read them.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
Michal Privoznik 2019-08-06 15:38:06 +02:00
parent d63f91648e
commit 72cbc1800b
2 changed files with 5 additions and 5 deletions

View File

@ -353,7 +353,7 @@ virHostdevNetDevice(virDomainHostdevDefPtr hostdev,
static bool
virHostdevIsPCINetDevice(virDomainHostdevDefPtr hostdev)
virHostdevIsPCINetDevice(const virDomainHostdevDef *hostdev)
{
return hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS &&
hostdev->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI &&
@ -368,7 +368,7 @@ virHostdevIsPCINetDevice(virDomainHostdevDefPtr hostdev)
* Returns true if @hostdev is a SCSI device, false otherwise.
*/
bool
virHostdevIsSCSIDevice(virDomainHostdevDefPtr hostdev)
virHostdevIsSCSIDevice(const virDomainHostdevDef *hostdev)
{
return hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS &&
hostdev->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI;
@ -382,7 +382,7 @@ virHostdevIsSCSIDevice(virDomainHostdevDefPtr hostdev)
* Returns true if @hostdev is a Mediated device, false otherwise.
*/
bool
virHostdevIsMdevDevice(virDomainHostdevDefPtr hostdev)
virHostdevIsMdevDevice(const virDomainHostdevDef *hostdev)
{
return hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS &&
hostdev->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV;

View File

@ -188,10 +188,10 @@ virHostdevReAttachDomainDevices(virHostdevManagerPtr mgr,
const char *oldStateDir)
ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
bool
virHostdevIsSCSIDevice(virDomainHostdevDefPtr hostdev)
virHostdevIsSCSIDevice(const virDomainHostdevDef *hostdev)
ATTRIBUTE_NONNULL(1);
bool
virHostdevIsMdevDevice(virDomainHostdevDefPtr hostdev)
virHostdevIsMdevDevice(const virDomainHostdevDef *hostdev)
ATTRIBUTE_NONNULL(1);
/* functions used by NodeDevDetach/Reattach/Reset */