and <a id="attributeOSTypeMachine"><code>machine</code></a> referring
to the machine type. The <a href="formatcaps.html">Capabilities XML</a>
provides details on allowed values for
- these. <span class="since">Since 0.0.1</span></dd>
+ these. If <code>arch</code> is omitted then for most hypervisor
+ drivers, the host native arch will be chosen. For the <code>test</code>,
+ <code>ESX</code> and <code>VMWare</code> hypervisor drivers, however,
+ the <code>i686</code> arch will always be chosen even on an
+ <code>x86_64</code> host. <span class="since">Since 0.0.1</span></dd>
<dt><a id="elementLoader"><code>loader</code></a></dt>
<dd>The optional <code>loader</code> tag refers to a firmware blob,
which is specified by absolute path,
static int
virDomainDefParseCaps(virDomainDefPtr def,
xmlXPathContextPtr ctxt,
+ virDomainXMLOptionPtr xmlopt,
virCapsPtr caps,
unsigned int flags)
{
return -1;
}
+ if (def->os.arch == VIR_ARCH_NONE) {
+ if (xmlopt && xmlopt->config.defArch != VIR_ARCH_NONE)
+ def->os.arch = xmlopt->config.defArch;
+ else
+ def->os.arch = virArchFromHost();
+ }
+
if (!(capsdata = virCapabilitiesDomainDataLookup(caps, def->os.type,
def->os.arch,
def->virtType,
return -1;
virResetLastError();
} else {
- if (!def->os.arch)
- def->os.arch = capsdata->arch;
if (!def->os.machine)
def->os.machine = g_strdup(capsdata->machinetype);
}
id = -1;
def->id = (int)id;
- if (virDomainDefParseCaps(def, ctxt, caps, flags) < 0)
+ if (virDomainDefParseCaps(def, ctxt, xmlopt, caps, flags) < 0)
goto error;
/* Extract domain name */
/* data */
unsigned int features; /* virDomainDefFeatures */
unsigned char macPrefix[VIR_MAC_PREFIX_BUFLEN];
+ virArch defArch;
};
typedef void *(*virDomainXMLPrivateDataAllocFunc)(void *);
VIR_DOMAIN_DEF_FEATURE_USER_ALIAS |
VIR_DOMAIN_DEF_FEATURE_FW_AUTOSELECT |
VIR_DOMAIN_DEF_FEATURE_NET_MODEL_STRING,
+ .defArch = VIR_ARCH_I686,
};
virDomainXMLPrivateDataCallbacks privatecb = {
.alloc = testDomainObjPrivateAlloc,
virDomainDefParserConfig vmwareDomainDefParserConfig = {
.devicesPostParseCallback = vmwareDomainDeviceDefPostParse,
.domainPostParseCallback = vmwareDomainDefPostParse,
+ .defArch = VIR_ARCH_I686,
};
static virDomainXMLOptionPtr
.features = (VIR_DOMAIN_DEF_FEATURE_WIDE_SCSI |
VIR_DOMAIN_DEF_FEATURE_NAME_SLASH |
VIR_DOMAIN_DEF_FEATURE_NO_BOOT_ORDER),
+ .defArch = VIR_ARCH_I686,
};
struct virVMXDomainDefNamespaceData {