mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 22:25:25 +00:00
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:
parent
d63f91648e
commit
72cbc1800b
@ -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;
|
||||
|
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user