[PATCH v2 01/39] virhostdev: Fix const correctness of virHostdevIs{PCINet, SCSI, Mdev}Device()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 src/util/virhostdev.c | 6 +++---
 src/util/virhostdev.h | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/util/virhostdev.c b/src/util/virhostdev.c
index 41fcab7222..90967b7c7a 100644
--- a/src/util/virhostdev.c
+++ b/src/util/virhostdev.c
@@ -354,7 +354,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 &&
@@ -369,7 +369,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;
@@ -383,7 +383,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;
diff --git a/src/util/virhostdev.h b/src/util/virhostdev.h
index 88501e2743..8d7b8c3284 100644
--- a/src/util/virhostdev.h
+++ b/src/util/virhostdev.h
@@ -185,10 +185,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 */
-- 
2.21.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux