Default to native arch, and check domain type when auto-filling guest arch (Soren Hansen)
This commit is contained in:
parent
667f669fdc
commit
97230f6a35
@ -1,3 +1,10 @@
|
|||||||
|
Tue Mar 24 11:14:22 GMT 2009 Daniel P. Berrange <berrange@redhat.com>
|
||||||
|
|
||||||
|
* src/capabilities.c, file src/capabilities.h,
|
||||||
|
src/domain_conf.c, src/xm_internal.c: Prefer native arch
|
||||||
|
when auto-filling guest architecture. Match on domain type
|
||||||
|
when auto-filling architecture (Soren Hansen)
|
||||||
|
|
||||||
Tue Mar 24 10:51:22 GMT 2009 Daniel P. Berrange <berrange@redhat.com>
|
Tue Mar 24 10:51:22 GMT 2009 Daniel P. Berrange <berrange@redhat.com>
|
||||||
|
|
||||||
* src/Makefile.maint: Include 'CHECK: ' prefix when printing
|
* src/Makefile.maint: Include 'CHECK: ' prefix when printing
|
||||||
|
@ -468,14 +468,26 @@ virCapabilitiesSupportsGuestArch(virCapsPtr caps,
|
|||||||
*/
|
*/
|
||||||
extern const char *
|
extern const char *
|
||||||
virCapabilitiesDefaultGuestArch(virCapsPtr caps,
|
virCapabilitiesDefaultGuestArch(virCapsPtr caps,
|
||||||
const char *ostype)
|
const char *ostype,
|
||||||
|
const char *domain)
|
||||||
{
|
{
|
||||||
int i;
|
int i, j;
|
||||||
|
const char *arch = NULL;
|
||||||
for (i = 0 ; i < caps->nguests ; i++) {
|
for (i = 0 ; i < caps->nguests ; i++) {
|
||||||
if (STREQ(caps->guests[i]->ostype, ostype))
|
if (STREQ(caps->guests[i]->ostype, ostype)) {
|
||||||
return caps->guests[i]->arch.name;
|
for (j = 0 ; j < caps->guests[i]->arch.ndomains ; j++) {
|
||||||
|
if (STREQ(caps->guests[i]->arch.domains[j]->type, domain)) {
|
||||||
|
/* Use the first match... */
|
||||||
|
if (!arch)
|
||||||
|
arch = caps->guests[i]->arch.name;
|
||||||
|
/* ...unless we can match the host's architecture. */
|
||||||
|
if (STREQ(caps->guests[i]->arch.name, caps->host.arch))
|
||||||
|
return caps->guests[i]->arch.name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return NULL;
|
return arch;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -177,7 +177,8 @@ virCapabilitiesSupportsGuestArch(virCapsPtr caps,
|
|||||||
|
|
||||||
extern const char *
|
extern const char *
|
||||||
virCapabilitiesDefaultGuestArch(virCapsPtr caps,
|
virCapabilitiesDefaultGuestArch(virCapsPtr caps,
|
||||||
const char *ostype);
|
const char *ostype,
|
||||||
|
const char *domain);
|
||||||
extern const char *
|
extern const char *
|
||||||
virCapabilitiesDefaultGuestMachine(virCapsPtr caps,
|
virCapabilitiesDefaultGuestMachine(virCapsPtr caps,
|
||||||
const char *ostype,
|
const char *ostype,
|
||||||
|
@ -2146,7 +2146,7 @@ static virDomainDefPtr virDomainDefParseXML(virConnectPtr conn,
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const char *defaultArch = virCapabilitiesDefaultGuestArch(caps, def->os.type);
|
const char *defaultArch = virCapabilitiesDefaultGuestArch(caps, def->os.type, virDomainVirtTypeToString(def->virtType));
|
||||||
if (defaultArch == NULL) {
|
if (defaultArch == NULL) {
|
||||||
virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
|
virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
|
||||||
_("no supported architecture for os type '%s'"),
|
_("no supported architecture for os type '%s'"),
|
||||||
|
@ -695,7 +695,7 @@ xenXMDomainConfigParse(virConnectPtr conn, virConfPtr conf) {
|
|||||||
if (!(def->os.type = strdup(hvm ? "hvm" : "xen")))
|
if (!(def->os.type = strdup(hvm ? "hvm" : "xen")))
|
||||||
goto no_memory;
|
goto no_memory;
|
||||||
|
|
||||||
defaultArch = virCapabilitiesDefaultGuestArch(priv->caps, def->os.type);
|
defaultArch = virCapabilitiesDefaultGuestArch(priv->caps, def->os.type, virDomainVirtTypeToString(def->virtType));
|
||||||
if (defaultArch == NULL) {
|
if (defaultArch == NULL) {
|
||||||
xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
|
xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
|
||||||
_("no supported architecture for os type '%s'"),
|
_("no supported architecture for os type '%s'"),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user