We cannot do partition related ioctl's on loopback devices, so
treat them as files.

* libparted/arch/linux.c(LOOP_MAJOR): New define.
* libparted/arch/linux.c(_device_probe_type): Treat loopback
devices as files.
---
 libparted/arch/linux.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
index 94cbae9..9d15bf2 100644
--- a/libparted/arch/linux.c
+++ b/libparted/arch/linux.c
@@ -254,6 +254,7 @@ struct blkdev_ioctl_param {
 #define SX8_MAJOR2              161
 #define XVD_MAJOR               202
 #define SDMMC_MAJOR             179
+#define LOOP_MAJOR              7
 
 #define SCSI_BLK_MAJOR(M) (                                             \
                 (M) == SCSI_DISK0_MAJOR                                 \
@@ -569,6 +570,8 @@ _device_probe_type (PedDevice* dev)
                 dev->type = PED_DEVICE_SDMMC;
         } else if (_is_virtblk_major(dev_major)) {
                 dev->type = PED_DEVICE_VIRTBLK;
+        } else if (dev_major == LOOP_MAJOR) {
+                dev->type = PED_DEVICE_FILE;
         } else {
                 dev->type = PED_DEVICE_UNKNOWN;
         }
-- 
1.6.5.2



_______________________________________________
bug-parted mailing list
bug-parted@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-parted

Reply via email to