[parted-edge] ped_disk_duplicate

Debarshi 'Rishi' Ray debarshi.ray at gmail.com
Tue Nov 6 07:45:58 UTC 2007


I was discussing the ped_disk_duplicate function with Otavio last
night. I am still not convinced about certain things though.

Currently if we were to look at it from a higher level of abstraction
we would have:
PedDisk*
ped_disk_duplicate (const PedDisk* old_disk)
{
    PedDisk* new_disk;
    ...
    new_disk = ped_disk_new_fresh (old_disk->dev, old_disk->type);
    /* add partitions from old_disk to new_disk */
    ...
    return new_disk;
}
So we end up with new_disk which basically has the same set of
partitions as old_disk. This much is understandable and sounds logical
to me. However why should new_disk->dev and old_disk->dev be the same?
It makes sense if we are duplicating the same partition list on a disk
label corresponding to a different block device, but not if we are
doing it on the same block device.

Is my understanding correct or am I missing something?

Happy hacking,
Debarshi
-- 
GPG key ID: 63D4A5A7
Key server: pgp.mit.edu



More information about the parted-edge mailing list