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