summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNageswara R Sastry <rnsastry@linux.vnet.ibm.com>2013-08-21 16:37:17 -0700
committerBrian C. Lane <bcl@redhat.com>2014-04-29 11:42:24 -0700
commit0673dabee6f5b19317b0d85e399e9f876a2c2ea7 (patch)
treeec0cfb00407ff96f45fd6b63a8af5b048017360a
parent95649fc7d025a68074c8a00581bd24d2bd7751bc (diff)
downloadparted-0673dabee6f5b19317b0d85e399e9f876a2c2ea7.tar.gz
libparted: Avoid dasd as default disk type while probe
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 <rnsastry@linux.vnet.ibm.com>
-rw-r--r--include/parted/fdasd.in.h1
-rw-r--r--libparted/labels/fdasd.c6
2 files changed, 6 insertions, 1 deletions
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;