[parted-edge] ped_disk_duplicate

Otavio Salvador otavio at debian.org
Tue Nov 6 15:21:01 UTC 2007


David Cantrell <dcantrell at redhat.com> writes:

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

It's used on qtparted and knxinstaller according to google codesearch.

Looks like it's used to simulate what we're going to support as history.

-- 
        O T A V I O    S A L V A D O R
---------------------------------------------
 E-mail: otavio at debian.org      UIN: 5906116
 GNU/Linux User: 239058     GPG ID: 49A5F855
 Home Page: http://otavio.ossystems.com.br
---------------------------------------------
"Microsoft sells you Windows ... Linux gives
 you the whole house."



More information about the parted-edge mailing list