[Libguestfs] Proposed API for guestconv library

Matthew Booth mbooth at redhat.com
Mon Feb 25 15:00:55 UTC 2013


guestconv will be a new, re-usable library to perform guest OS
conversions when moving between hypervisors.

I've attached 3 files to this email which are relevant to the proposed
API.

guestconv.h is the proposed C binding.

example.c is the simplest possible usage of the API. It converts the
first detected root of the guest, accepting all defaults.

root.xml is an example description returned by inspection.

The first 2 should be self-explanatory, but root.xml requires more
explanation.

/guestconv/info contains generic information about the detected guest
OS. It can't be modified.

/guestconv/devices contains a list of detected devices. It can be
modified to affect the choice of driver for each device. Each element
has an id which uniquely identifies the specific device of a particular
type, and the selected driver. Available driver options are given as
child elements.

If an element is deleted from /guestconv/devices it will be
unconfigured.

There are a couple of potential issues I see with it myself:

Firstly, modifying XML isn't the cleanest API ever. However, I can't
think of a better solution which would be similarly flexible, and work
well with language bindings.

Secondly, it doesn't cover the case of an EC2->KVM conversion where you
will need to do additional transformations before conversion.
Specifically you'll need to add a partition table and boot loader.

You could potentially argue that this kind of transformation is out of
scope for the tool. However, it would introduce changes that you would
have to take into account during conversion due to altered device names.
I think we need to be able to support it without a major API change,
even if we don't support it initially. I'll try to post an update which
supports this, although ideas are welcome in the meantime.

Matt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: example.c
Type: text/x-csrc
Size: 635 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20130225/8c599cfe/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: guestconv.h
Type: text/x-chdr
Size: 730 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20130225/8c599cfe/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: root.xml
Type: application/xml
Size: 1065 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20130225/8c599cfe/attachment.wsdl>


More information about the Libguestfs mailing list