[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt-users] libvirt shortcomings of virsh domxml-to-native and domxml-from-native

2012/7/25 张光鹏 <zhanggp neusoft com>
we use libvirt to manage some host and vms on vmware hypervisor.I have found the libvirt there are some shortcomings .
Such as virsh domxml-to-native and domxml-from-native .I have reviewed the libvirt source --src/vmx/vmx.c, code as follows :
xml 转化成vmx
/* def:os.arch -> vmx:guestOS */
if (def->os.arch == NULL || STRCASEEQ(def->os.arch, "i686")) {
virBufferAddLit(&buffer, "guestOS = \"other\"\n");
} else if (STRCASEEQ(def->os.arch, "x86_64")) {
virBufferAddLit(&buffer, "guestOS = \"other-64\"\n");
} else {
_("Expecting domain XML attribute 'arch' of entry 'os/type' "
"to be 'i686' or 'x86_64' but found '%s'"), def->os.arch);
goto cleanup;
/* vmx:guestOS -> def:os.arch */
if (virVMXGetConfigString(conf, "guestOS", &guestOS, true) < 0) {
goto cleanup;
if (guestOS != NULL && virFileHasSuffix(guestOS, "-64")) {
def->os.arch = strdup("x86_64");
} else {
def->os.arch = strdup("i686");
if (def->os.arch == NULL) {
goto cleanup;
Vmware support many guestOS types like "windows7srv-64 ",If I use 64-bit Windows virtual machine, other-64 this type is not correct. NIC e1000 system can not be used .
So I suggest to The libvirt improve the vmware support, especially the mutual transformation of the xml and vmx format guestOS only one parameter.
Thanks all.


This is a known problem. This is not that easy to fix because currently libvirt does not expose the guest OS type of the virtual machine in its XML config. Therefore, vmx.c has no place to store this information in the XML config.

To fix this the XML config hasto be extended with a guest OS tag.

Matthias Bolte

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]