[PATCH 24/32] Remove PROPERTY_* constants

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

 



They are no longer used.
---
 src/node_device/node_device_udev.c | 41 ++++++++++++--------------------------
 src/node_device/node_device_udev.h |  3 ---
 2 files changed, 13 insertions(+), 31 deletions(-)

diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
index f97f1eb..54eb319 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -206,10 +206,10 @@ static int udevGetUint64SysfsAttr(struct udev_device *udev_device,
 
     if (str && virStrToLong_ull(str, NULL, 0, value) < 0) {
         VIR_ERROR(_("Failed to convert '%s' to unsigned long long"), str);
-        return PROPERTY_ERROR;
+        return -1;
     }
 
-    return str == NULL ? PROPERTY_MISSING : PROPERTY_FOUND;
+    return 0;
 }
 
 
@@ -687,18 +687,12 @@ static int udevProcessDisk(struct udev_device *device,
     virNodeDevCapDataPtr data = &def->caps->data;
     int ret = 0;
 
-    if (udevGetUint64SysfsAttr(device,
-                               "size",
-                               &data->storage.num_blocks) == PROPERTY_ERROR) {
+    if (udevGetUint64SysfsAttr(device, "size", &data->storage.num_blocks) < 0)
         goto out;
-    }
 
-    if (udevGetUint64SysfsAttr(device,
-                               "queue/logical_block_size",
-                               &data->storage.logical_block_size)
-        == PROPERTY_ERROR) {
+    if (udevGetUint64SysfsAttr(device, "queue/logical_block_size",
+                               &data->storage.logical_block_size) < 0)
         goto out;
-    }
 
     data->storage.size = data->storage.num_blocks *
         data->storage.logical_block_size;
@@ -729,17 +723,13 @@ static int udevProcessRemoveableMedia(struct udev_device *device,
                                   &data->storage.media_label) < 0)
             goto out;
 
-        if (udevGetUint64SysfsAttr(device,
-                                   "size",
-                                   &data->storage.num_blocks) == PROPERTY_ERROR) {
+        if (udevGetUint64SysfsAttr(device, "size",
+                                   &data->storage.num_blocks) < 0)
             goto out;
-        }
 
-        if (udevGetUint64SysfsAttr(device,
-                                   "queue/logical_block_size",
-                                   &data->storage.logical_block_size) == PROPERTY_ERROR) {
+        if (udevGetUint64SysfsAttr(device, "queue/logical_block_size",
+                                   &data->storage.logical_block_size) < 0)
             goto out;
-        }
 
         /* XXX This calculation is wrong for the qemu virtual cdrom
          * which reports the size in 512 byte blocks, but the logical
@@ -801,18 +791,13 @@ static int udevProcessSD(struct udev_device *device,
     virNodeDevCapDataPtr data = &def->caps->data;
     int ret = 0;
 
-    if (udevGetUint64SysfsAttr(device,
-                               "size",
-                               &data->storage.num_blocks) == PROPERTY_ERROR) {
+    if (udevGetUint64SysfsAttr(device, "size",
+                               &data->storage.num_blocks) < 0)
         goto out;
-    }
 
-    if (udevGetUint64SysfsAttr(device,
-                               "queue/logical_block_size",
-                               &data->storage.logical_block_size)
-        == PROPERTY_ERROR) {
+    if (udevGetUint64SysfsAttr(device, "queue/logical_block_size",
+                               &data->storage.logical_block_size) < 0)
         goto out;
-    }
 
     data->storage.size = data->storage.num_blocks *
         data->storage.logical_block_size;
diff --git a/src/node_device/node_device_udev.h b/src/node_device/node_device_udev.h
index 47eeb1f..9a07ab7 100644
--- a/src/node_device/node_device_udev.h
+++ b/src/node_device/node_device_udev.h
@@ -29,6 +29,3 @@ typedef struct _udevPrivate udevPrivate;
 #define DRV_STATE_UDEV_MONITOR(ds) (((udevPrivate *)((ds)->privateData))->udev_monitor)
 #define DMI_DEVPATH "/sys/devices/virtual/dmi/id"
 #define DMI_DEVPATH_FALLBACK "/sys/class/dmi/id"
-#define PROPERTY_FOUND 0
-#define PROPERTY_MISSING 1
-#define PROPERTY_ERROR -1
-- 
2.7.3

--
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]