[libvirt] [PATCH] Do a correct format mapping of partitions 2

On Tue, Jun 23, 2009 at 12:47:58PM +0200, Henrik Persson wrote:
I make a new try from a different mail client now.
Hi Henrik, Okay, got it but there is a problem:
+ /* Get partition type */ + if(ped_partition_is_active(part)) { + if(ped_partition_is_flag_available(part, PED_PARTITION_TYPE)) { + partType = ped_partition_get_flag(part,PED_PARTITION_TYPE); + } + } +
paphio:~/libvirt -> grep PED_PARTITION_TYPE /usr/include/parted/*.h paphio:~/libvirt -> rpm -qf /usr/include/parted/parted.h parted-devel-1.8.8-17.fc11.x86_64 PED_PARTITION_TYPE is nowhere to be found in my parted headers so even if there is a runtime check to see if that flag is available, it just doesn't compile here. I suspect something changed seriously as I can see a reference to PED_PARTITION_TYPE in older version 1.7.0 maybe that's what's you got on SuSE but that flag is not available on Fedora, so this would need at least a #ifdef PED_PARTITION_TYPE or make sure we use a more stable interface to fetch it, Could you investigate the issue ? Is there a different API available ? The other parts of the patch looks fine but really depend on being able to fetch that information in the first place, so it's not worth applying as is. Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

I checked the SLES package and it is a patch that they have added themselves :( I will look into it to see if parted provides a better way to get the same information. /Henrik
-----Original Message----- From: Daniel Veillard [mailto:veillard@redhat.com] Sent: den 25 juni 2009 16:31 To: Henrik Persson E Cc: libvirt-list@redhat.com Subject: Re: [libvirt] [PATCH] Do a correct format mapping of partitions 2
On Tue, Jun 23, 2009 at 12:47:58PM +0200, Henrik Persson wrote:
I make a new try from a different mail client now.
Hi Henrik,
Okay, got it but there is a problem:
+ /* Get partition type */ + if(ped_partition_is_active(part)) { + if(ped_partition_is_flag_available(part, PED_PARTITION_TYPE)) { + partType = ped_partition_get_flag(part,PED_PARTITION_TYPE); + } + } +
paphio:~/libvirt -> grep PED_PARTITION_TYPE /usr/include/parted/*.h paphio:~/libvirt -> rpm -qf /usr/include/parted/parted.h parted-devel-1.8.8-17.fc11.x86_64
PED_PARTITION_TYPE is nowhere to be found in my parted headers so even if there is a runtime check to see if that flag is available, it just doesn't compile here. I suspect something changed seriously as I can see a reference to PED_PARTITION_TYPE in older version 1.7.0 maybe that's what's you got on SuSE but that flag is not available on Fedora, so this would need at least a #ifdef PED_PARTITION_TYPE or make sure we use a more stable interface to fetch it,
Could you investigate the issue ? Is there a different API available ?
The other parts of the patch looks fine but really depend on being able to fetch that information in the first place, so it's not worth applying as is.
Daniel
-- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

Hi, Just to follow up this issue, I haven't found any way to get this info from standard parted :( /Henrik
-----Original Message----- From: libvir-list-bounces@redhat.com [mailto:libvir-list-bounces@redhat.com] On Behalf Of Henrik Persson E Sent: den 26 juni 2009 12:08 To: veillard@redhat.com Cc: libvirt-list@redhat.com Subject: RE: [libvirt] [PATCH] Do a correct format mapping of partitions 2
I checked the SLES package and it is a patch that they have added themselves :( I will look into it to see if parted provides a better way to get the same information.
/Henrik
-----Original Message----- From: Daniel Veillard [mailto:veillard@redhat.com] Sent: den 25 juni 2009 16:31 To: Henrik Persson E Cc: libvirt-list@redhat.com Subject: Re: [libvirt] [PATCH] Do a correct format mapping of partitions 2
On Tue, Jun 23, 2009 at 12:47:58PM +0200, Henrik Persson wrote:
I make a new try from a different mail client now.
Hi Henrik,
Okay, got it but there is a problem:
+ /* Get partition type */ + if(ped_partition_is_active(part)) { + if(ped_partition_is_flag_available(part, PED_PARTITION_TYPE)) { + partType = ped_partition_get_flag(part,PED_PARTITION_TYPE); + } + } +
paphio:~/libvirt -> grep PED_PARTITION_TYPE /usr/include/parted/*.h paphio:~/libvirt -> rpm -qf /usr/include/parted/parted.h parted-devel-1.8.8-17.fc11.x86_64
PED_PARTITION_TYPE is nowhere to be found in my parted headers so even if there is a runtime check to see if that flag is available, it just doesn't compile here. I suspect something changed seriously as I can see a reference to PED_PARTITION_TYPE in older version 1.7.0 maybe that's what's you got on SuSE but that flag is not available on Fedora, so this would need at least a #ifdef PED_PARTITION_TYPE or make sure we use a more stable interface to fetch it,
Could you investigate the issue ? Is there a different API available ?
The other parts of the patch looks fine but really depend on being able to fetch that information in the first place, so it's not worth applying as is.
Daniel
-- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/
-- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

On Mon, Jul 06, 2009 at 04:07:32PM +0200, Henrik Persson E wrote:
Hi,
Just to follow up this issue, I haven't found any way to get this info from standard parted :(
Your code was getting the raw MS-Dos partition type. This isn't really needed by libvirt, and indeed we do need to work with partition tables that aren't MS-Dos format, eg GPT. As an alternative it looks like we ought to be able to get enough data for libvirt's needs by looking at a combo of the PED_PARTITION_RAID/PED_PARTITION_LVM flags, the 'fs_type' field of PedPartition. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

-----Original Message----- From: Daniel P. Berrange [mailto:berrange@redhat.com] Sent: den 6 juli 2009 16:17 To: Henrik Persson E Cc: veillard@redhat.com; libvirt-list@redhat.com Subject: Re: [libvirt] [PATCH] Do a correct format mapping of partitions 2
On Mon, Jul 06, 2009 at 04:07:32PM +0200, Henrik Persson E wrote:
Hi,
Just to follow up this issue, I haven't found any way to
get this info
from standard parted :(
Your code was getting the raw MS-Dos partition type. This isn't really needed by libvirt, and indeed we do need to work with partition tables that aren't MS-Dos format, eg GPT. As an alternative it looks like we ought to be able to get enough data for libvirt's needs by looking at a combo of the PED_PARTITION_RAID/PED_PARTITION_LVM flags, the 'fs_type' field of PedPartition.
That could be true for RAID and LVM types, but for all other types we can only guess since parted does not provide this info unless we create an FS at the sametime as the partition is created. I guess we could treat all as 'linux' as long as we don't know anything else. /Henrik
participants (4)
-
Daniel P. Berrange
-
Daniel Veillard
-
Henrik Persson
-
Henrik Persson E