Hi all,
It would be nice to sort out the new PedUnit API.
Firstly, the latest survey results are:
(raw data view)
Q1: AADABABCCCDC
Q2: DCEAABBDADAD
Q3: CACAAABCADAC
Q4: DDFCBECDEEAE
(histogram view)
Q1: AAAABBCCCCDD
Q2: AAAABBCDDDDE
Q3: AAAAAABCCCCD
Q4: ABCCDDDEEEEF
I attached the annotated survey.
At the moment, the primary input functions' prototypes are:
int ped_unit_parse (const char* str, PedDevice* dev,PedSector* sector);
int ped_unit_parse_custom (const char* str, PedDevice* dev,
PedUnit unit, PedSector* sector);
If we want to make some units have special semantics, we could do this
by using constraints. A rather general way of doing this would be
the following:
int ped_unit_parse (const char* str, PedDevice* dev, PedSector* sector,
PedGeometry** range);
int ped_unit_parse_custom (const char* str, PedDevice* dev,
PedUnit unit, PedSector* sector,
PedGeometry** range);
The idea is that ped_unit_parse() would return a range constraint (i.e.
a PedGeometry) that describes how flexible the user would like its input
to be treated. For units like chs, we might want to return
*range = ped_geometry_new(dev, *sector, 1);
For units like MB, we might want to make it a megabyte radius around
*sector.
In any case, I think this API is very flexible. It should allow us to
change the semantics to anything we want without any binary
incompatibilities. Any objections?
Cheers,
Andrew
Hi all,
I would like everyone who has time to complete this 4-question
multiple-choice survey about the new proposed user interface of Parted
which is currently available in CVS. Please email your responses to
[EMAIL PROTECTED], with answers in this (greppable) format:
Q1: B
Q2: A
Q3: C
Q4: D (I would expect a segmentation fault.)
PLEASE READ THIS BEFORE PROCEEDING:
This survey is about the extent to which Parted should "do what you
said" versus "do what you meant". Important notes:
* The new Parted user interface allows you to demand "do exactly what I
said" by prefixing numbers with the equals sign (=).
* Some other programs do not function properly if partitions are not
aligned to cylinder boundaries.
* Most Unix utilities now use SI units (physics.nist.gov/cuu/Units).
According to this standard, one kilobyte (1 kB) is 1000 bytes and one
megabyte (1 MB) is 1000 kilobytes. The new Parted interface uses SI units.
-------------------------------------------------------------------------
QUESTION 1: Suppose you have a hard disk with one partition:
(parted) print
Disk geometry for /dev/hda: 0kB - 64GB
Disk label type: msdos
Number Start End Size Type File system Flags
1 599MB 19GB 19GB primary ext2
Moreover, suppose that the more verbose "megabytes" units mode appears
as follows:
(parted) unit mb
(parted) print
Disk geometry for /dev/hda: 0MB - 64424MB
Disk label type: msdos
Number Start End Size Type File system Flags
1 599MB 19599MB 19599MB primary ext2
Now, if you typed the following...
(parted) mkpartfs
Partition type? primary/extended? primary
File system type? [ext2]? ext2
Start? 20gb
End? 30gb
...where would you expect this new partition to begin?
(A: 4) Immediately after the first partition.
(B: 2) Exactly at 20GB (i.e. 20000MB), leaving a 400MB gap between the
partitions.
(C: 4) At the start of the closest cylinder to 20000MB.
(D: 2) Other. (Please specify)
-------------------------------------------------------------------------
QUESTION 2: This question refers to the same partition table from
question 1. This question is about the "sectors" unit. A sector is a
unit of information that has 512 bytes. Most hardware and operating
system software "talks" natively in sector units. In Parted, you can
specify the sector unit with "s". For example, "100s" refers to the
101st sector, or the 51201st byte on a disk. In sector units, the above
partition table looks like this:
(parted) unit s
(parted) print
Disk geometry for /dev/hda: 0s - 125829121s
Disk label type: msdos
Number Start End Size Type File system Flags
1 1171840s 38281215s 37109376s primary ext2
Suppose you typed in the following:
(parted) mkpartfs
Partition type? primary/extended? primary
File system type? [ext2]? ext2
Start? 33s
End? 1100000s
Where would you expect this partition to end?
(A: 4) At 1100000s.
(B: 2) At 1171839s. That is, immediately before partition 2.
(C: 1) At the closest cylinder boundary below 1171839s.
(D: 4) At the end of the closest cylinder to 1100000s.
(E: 1) Other. (Please specify)
-------------------------------------------------------------------------
QUESTION 3: Where would you expect the newly created partition from
question 2 to begin?
(A: 6) At 33s.
(B: 1) At the first valid location after the partition table.
(C: 4) At the start of the closest cylinder (assuming this is closer than (B)).
(D: 1) Other. (Please specify)
-------------------------------------------------------------------------
QUESTION 4: This question is about resizing. Suppose you have a
partition table that looks like this:
(parted) print
Disk geometry for /dev/hda: 0kB - 64GB
Disk label type: msdos
Number Start End Size Type File system Flags
1 1003MB 1800MB 796MB primary fat32
Now suppose you typed the following command:
(print) resize 1 1gb 2gb
Where would you expect the FAT32 partition to be resized to? (Note that
Parted is capable of non-destructively moving the start of FAT partitions.)
(A: 1) Start and end unchanged.
(B: 1) 1GB - 2GB. (i.e. starting at 1000MB and ending at 2000MB.)
(C: 2) Starting at 1003MB and ending at 2GB.
(D: 3) Starting at 1003MB and ending at the closest cylinder to 2GB.
(E: 4) The start at the closest cylinder boundary to 1GB and the end at
the closest cylinder boundary to 2GB.
(F: 1) Other. (Please specify)
-------------------------------------------------------------------------
Thanks,
Andrew
_______________________________________________
Bug-parted mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-parted