[parted-edge] ped_disk_duplicate

David Cantrell dcantrell at redhat.com
Tue Nov 6 14:09:56 UTC 2007


On Tue, 6 Nov 2007 13:15:58 +0530
"Debarshi 'Rishi' Ray" <debarshi.ray at gmail.com> wrote:

> 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?

I think your understanding makes sense.  The dev members shouldn't necessarily be the same, but they could.

The bigger question is what is ped_disk_duplicate() used for?  In our code, nothing.

-- 
David Cantrell <dcantrell at redhat.com>
Red Hat / Westford, MA
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/parted-edge/attachments/20071106/eda503bd/attachment.pgp 


More information about the parted-edge mailing list