[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#15351: [PATCH 09/19] libparted: Avoid dasd as default disk type whil
From: |
Brian C. Lane |
Subject: |
bug#15351: [PATCH 09/19] libparted: Avoid dasd as default disk type while probe |
Date: |
Wed, 11 Sep 2013 12:24:59 -0700 |
From: Nageswara R Sastry <address@hidden>
This patch avoids setting 'dasd' as a default disk type for
'disk image file' at the time of probe.
Signed-off-by: Nageswara R Sastry <address@hidden>
---
include/parted/fdasd.in.h | 1 +
libparted/labels/fdasd.c | 6 +++++-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/include/parted/fdasd.in.h b/include/parted/fdasd.in.h
index 3692596..6f6a7e0 100644
--- a/include/parted/fdasd.in.h
+++ b/include/parted/fdasd.in.h
@@ -261,6 +261,7 @@ typedef struct fdasd_anchor {
struct fdasd_hd_geometry geo;
unsigned int label_block;
unsigned int FBA_layout;
+ bool is_file;
} fdasd_anchor_t;
enum offset {lower, upper};
diff --git a/libparted/labels/fdasd.c b/libparted/labels/fdasd.c
index b58b2be..7de5f34 100644
--- a/libparted/labels/fdasd.c
+++ b/libparted/labels/fdasd.c
@@ -301,6 +301,7 @@ fdasd_initialize_anchor (fdasd_anchor_t * anc)
}
anc->hw_cylinders = 0;
anc->formatted_cylinders = 0;
+ anc->is_file = 0;
}
/*
@@ -890,7 +891,7 @@ fdasd_check_volume (fdasd_anchor_t *anc, int fd)
/* Some times LDL formatted disks does not
contain any volume label */
return 1;
- } else {
+ } else if (! anc->is_file) {
/* didn't find VOL1 volume label */
anc->formatted_cylinders = anc->hw_cylinders;
anc->fspace_trk = anc->formatted_cylinders * anc->geo.heads
@@ -974,6 +975,7 @@ fdasd_get_geometry (const PedDevice *dev, fdasd_anchor_t
*anc, int f)
dasd_info.FBA_layout = 0;
anc->hw_cylinders = ((st.st_size / blksize) / anc->geo.sectors) /
anc->geo.heads;
+ anc->is_file = 1;
} else {
if (ioctl(f, HDIO_GETGEO, &anc->geo) != 0)
fdasd_error(anc, unable_to_ioctl,
@@ -995,6 +997,8 @@ fdasd_get_geometry (const PedDevice *dev, fdasd_anchor_t
*anc, int f)
anc->hw_cylinders = characteristics->long_no_cyl;
else
anc->hw_cylinders = characteristics->no_cyl;
+
+ anc->is_file = 0;
}
anc->dev_type = dasd_info.dev_type;
--
1.8.3.1
- bug#15345: [PATCH 17/19] tests: Add btrfs and xfs to the fs probe test, (continued)
- bug#15345: [PATCH 17/19] tests: Add btrfs and xfs to the fs probe test, Brian C. Lane, 2013/09/11
- bug#15346: [PATCH 01/19] libparted: copy pmbr_boot when duplicating GPT disk, Brian C. Lane, 2013/09/11
- bug#15347: [PATCH 18/19] libparted: Flush parent device on open (#962611), Brian C. Lane, 2013/09/11
- bug#15350: [PATCH 19/19] tests: Restrict gpt-header-munge to little-endian systems, Brian C. Lane, 2013/09/11
- bug#15348: [PATCH 11/19] libparted: don't canonicalize /dev/md/ paths (#872361), Brian C. Lane, 2013/09/11
- bug#15349: [PATCH 10/19] libparted: mklabel to support EDEV DASD, Brian C. Lane, 2013/09/11
- bug#15353: [PATCH 12/19] tests: rewrite t6001 to use /dev/mapper, Brian C. Lane, 2013/09/11
- bug#15351: [PATCH 09/19] libparted: Avoid dasd as default disk type while probe,
Brian C. Lane <=
- bug#15352: [PATCH 04/19] libparted: preserve the uuid on dm partitions (#832145), Brian C. Lane, 2013/09/11
- bug#15354: [PATCH 05/19] tests: Make sure dm UUIDs are not erased, Brian C. Lane, 2013/09/11
- bug#15355: [PATCH 02/19] tests: test creating 20 device-mapper partitions (#803108), Brian C. Lane, 2013/09/11
- bug#15356: [PATCH 03/19] libparted: use dm_udev_wait (#698121), Brian C. Lane, 2013/09/11
- bug#15356: [PATCH 08/19] libparted: mklabel to support EAV DASD, Brian C. Lane, 2013/09/11
- bug#15356: [PATCH 16/19] libparted: Recognize btrfs filesystem, Brian C. Lane, 2013/09/11
- bug#15356: [PATCH 06/19] libparted: add support for implicit FBA DASD partitions, Brian C. Lane, 2013/09/11
- bug#15356: [PATCH 14/19] libparted: Add UEFI System Partition flag., Brian C. Lane, 2013/09/11
- bug#15356: [PATCH 15/19] libparted: Add hfs_esp partition flag to GPT., Brian C. Lane, 2013/09/11