#include "libxl_migration.h"
#include "xen_xm.h"
#include "xen_sxpr.h"
+#include "xen_xl.h"
#include "virtypedparam.h"
#include "viruri.h"
#include "virstring.h"
#define LIBXL_DOM_REQ_CRASH 3
#define LIBXL_DOM_REQ_HALT 4
+#define LIBXL_CONFIG_FORMAT_XL "xen-xl"
#define LIBXL_CONFIG_FORMAT_XM "xen-xm"
#define LIBXL_CONFIG_FORMAT_SEXPR "xen-sxpr"
if (virConnectDomainXMLFromNativeEnsureACL(conn) < 0)
goto cleanup;
- if (STREQ(nativeFormat, LIBXL_CONFIG_FORMAT_XM)) {
+ if (STREQ(nativeFormat, LIBXL_CONFIG_FORMAT_XL)) {
+ if (!(conf = virConfReadMem(nativeConfig, strlen(nativeConfig), 0)))
+ goto cleanup;
+ if (!(def = xenParseXL(conf,
+ cfg->caps,
+ cfg->verInfo->xen_version_major))) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("parsing xl config failed"));
+ goto cleanup;
+ }
+ } else if (STREQ(nativeFormat, LIBXL_CONFIG_FORMAT_XM)) {
if (!(conf = virConfReadMem(nativeConfig, strlen(nativeConfig), 0)))
goto cleanup;
if (virConnectDomainXMLToNativeEnsureACL(conn) < 0)
goto cleanup;
- if (STRNEQ(nativeFormat, LIBXL_CONFIG_FORMAT_XM)) {
- virReportError(VIR_ERR_INVALID_ARG,
- _("unsupported config type %s"), nativeFormat);
- goto cleanup;
- }
-
if (!(def = virDomainDefParseString(domainXml,
cfg->caps, driver->xmlopt,
1 << VIR_DOMAIN_VIRT_XEN,
VIR_DOMAIN_DEF_PARSE_INACTIVE)))
goto cleanup;
- if (!(conf = xenFormatXM(conn, def, cfg->verInfo->xen_version_major)))
+ if (STREQ(nativeFormat, LIBXL_CONFIG_FORMAT_XL)) {
+ if (!(conf = xenFormatXL(def, conn, cfg->verInfo->xen_version_major)))
+ goto cleanup;
+ } else if (STREQ(nativeFormat, LIBXL_CONFIG_FORMAT_XM)) {
+ if (!(conf = xenFormatXM(conn, def, cfg->verInfo->xen_version_major)))
+ goto cleanup;
+ } else {
+
+ virReportError(VIR_ERR_INVALID_ARG,
+ _("unsupported config type %s"), nativeFormat);
goto cleanup;
+ }
if (VIR_ALLOC_N(ret, len) < 0)
goto cleanup;
Convert the file I<config> in the native guest configuration format
named by I<format> to a domain XML format. For QEMU/KVM hypervisor,
the I<format> argument must be B<qemu-argv>. For Xen hypervisor, the
-I<format> argument may be B<xen-xm> or B<xen-sxpr>. For LXC hypervisor,
-the I<format> argument must be B<lxc-tools>.
+I<format> argument may be B<xen-xm>, B<xen-xl>, or B<xen-sxpr>. For
+LXC hypervisor, the I<format> argument must be B<lxc-tools>.
=item B<domxml-to-native> I<format> I<xml>
Convert the file I<xml> in domain XML format to the native guest
configuration format named by I<format>. For QEMU/KVM hypervisor,
the I<format> argument must be B<qemu-argv>. For Xen hypervisor, the
-I<format> argument may be B<xen-xm> or B<xen-sxpr>. For LXC hypervisor,
-the I<format> argument must be B<lxc-tools>.
+I<format> argument may be B<xen-xm>, B<xen-xl>, or B<xen-sxpr>. For
+LXC hypervisor, the I<format> argument must be B<lxc-tools>.
=item B<dump> I<domain> I<corefilepath> [I<--bypass-cache>]
{ [I<--live>] | [I<--crash>] | [I<--reset>] } [I<--verbose>] [I<--memory-only>]