This function edits the given configuration so that it can be used in
subsequent calls to libvirt's createLinux call. Specifically, the
following modifications are made:
-
Remove the "id" attribute from the <domain> tag. The
"id" is whatever the hypervisor wants to assign to it, so
we should not try to assign it explicitly.
-
Determine whether the config contains an <os> section.
-
If it does, check whether the kernel and the initrd files it
refers to actually exist on disk.
-
If so, do nothing.
-
If not, remove the entire <os> section and insert a
<bootloader> section if one does not yet exist. These
files might not exist if the instance was started by xm using
a bootloader such as pygrub, which makes temporary copies of
the kernel & initrd and then removes them after starting
the instance.
-
If it does not, ensure there is a <bootloader> section or
add one if needed.
|