Bug 965495

Summary: New APIs required in libguestfs for virt-v2v in RHEL 6.5
Product: Red Hat Enterprise Linux 6 Reporter: Richard W.M. Jones <rjones>
Component: libguestfsAssignee: Pino Toscano <ptoscano>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.5CC: leiwang, lnovich, mbooth, morazi, ptoscano, rjones, wshi
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libguestfs-1.20.11-7.el6 Doc Type: Bug Fix
Doc Text:
Cause: gdisk was not available as dependency for libguestfs. Consequence: The gdisk feature was not available, and thus the two APIs guestfs_part_get_gpt_type and guestfs_part_set_gpt_type were not usable. Fix: Add gdisk as dependency. Result: The gdisk feature is available, and the two APIs guestfs_part_get_gpt_type and guestfs_part_set_gpt_type are usable.
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-14 06:34:44 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 958183, 1015157    
Bug Blocks: 965501, 1012805, 1023565    

Description Richard W.M. Jones 2013-05-21 10:05:58 UTC
Description of problem:

libguestfs is being rebased in RHEL 6.5 (bug 958183) in order
to support the new version of virt-v2v (bug ?).  As well as
the rebase, some newer APIs will have to be backported.  It
appears only these are required:

 guestfs_part_get_gpt_type (added in 1.21.1)
 guestfs_part_set_gpt_type (added in 1.21.1)

Matt: Please add any further APIs to this bug.

Version-Release number of selected component (if applicable):

libguestfs 1.20.6

Comment 1 Richard W.M. Jones 2013-05-30 19:35:40 UTC
http://brewweb.devel.redhat.com/brew/taskinfo?taskID=5845372

Comment 9 bfan 2013-09-17 06:28:44 UTC
Verified with libguestfs-1.20.11-1.el6.x86_64

><fs> help part-get-gpt-type 
NAME
    part-get-gpt-type - get the type GUID of a GPT partition

SYNOPSIS
     part-get-gpt-type device partnum

DESCRIPTION
    Return the type GUID of numbered GPT partition "partnum". For MBR
    partitions, return an appropriate GUID corresponding to the MBR type.
    Behaviour is undefined for other partition types.

><fs> help part-set-gpt-type
NAME
    part-set-gpt-type - set the type GUID of a GPT partition

SYNOPSIS
     part-set-gpt-type device partnum guid

DESCRIPTION
    Set the type GUID of numbered GPT partition "partnum" to "guid". Return
    an error if the partition table of "device" isn't GPT, or if "guid" is
    not a valid GUID.

    See
    <http://en.wikipedia.org/wiki/GUID_Partition_Table#Partition_type_GUIDs>
    for a useful list of type GUIDs.

New APIS add, and work, so change the status to verified

Comment 10 Richard W.M. Jones 2013-10-01 13:17:25 UTC
I'm afraid comment 9 doesn't count as verification.  tzheng
discovered (bug 1012805) that although the APIs exist, they
don't work because gdisk isn't included in RHEL 6.5.

It's fairly easy to demonstrate this:

$ guestfish -N part:1G:gpt part-get-gpt-type /dev/sda 1
libguestfs: error: part_get_gpt_type: feature 'gdisk' is not available in this
build of libguestfs.  Read 'AVAILABILITY' in the guestfs(3) man page for
how to check for the availability of features.

or:

$ guestfish -N part:1G:gpt part-set-gpt-type /dev/sda 1 0FC63DAF-8483-4772-8E79-3D69D8477DE4
libguestfs: error: part_set_gpt_type: feature 'gdisk' is not available in this
build of libguestfs.  Read 'AVAILABILITY' in the guestfs(3) man page for
how to check for the availability of features.

Comment 11 Richard W.M. Jones 2013-10-04 17:41:08 UTC
We decided (sensibly IMHO) to push this bug out to 6.6.

Comment 12 Richard W.M. Jones 2013-10-04 17:42:44 UTC
BTW I'm setting QA flag back to ? because I believe the QA
test for this to be wrong.  See comment 10.

Comment 16 bfan 2014-07-02 05:37:22 UTC
Verified with libguestfs-1.20.11-8.el6.x86_64

# guestfish -N fs part-disk /dev/sda gpt : part-get-gpt-type /dev/sda 1 : part-set-gpt-type /dev/sda 1 EBD0A0A2-B9E5-4433-87C0-68B6B72699C0 : part-get-gpt-type /dev/sda 1

EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
EBD0A0A2-B9E5-4433-87C0-68B6B72699C0

The API works.

Comment 17 errata-xmlrpc 2014-10-14 06:34:44 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2014-1458.html