return NULL;
}
+/**
+ * virCapabilitiesSupportsGuestArch:
+ * @caps: capabilities to query
+ * @arch: Architecture to search for (eg, 'i686', 'x86_64')
+ *
+ * Returns non-zero if the capabilities support the
+ * requested architecture
+ */
+extern int
+virCapabilitiesSupportsGuestArch(virCapsPtr caps,
+ const char *arch)
+{
+ int i;
+ for (i = 0 ; i < caps->nguests ; i++) {
+ if (STREQ(caps->guests[i]->arch.name, arch))
+ return 1;
+ }
+ return 0;
+}
+
/**
* virCapabilitiesSupportsGuestOSType:
/**
- * virCapabilitiesSupportsGuestOSType:
+ * virCapabilitiesSupportsGuestOSTypeArch:
* @caps: capabilities to query
* @ostype: OS type to search for (eg 'hvm', 'xen')
* @arch: Architecture to search for (eg, 'i686', 'x86_64')
* requested operating system type
*/
extern int
-virCapabilitiesSupportsGuestArch(virCapsPtr caps,
- const char *ostype,
- const char *arch)
+virCapabilitiesSupportsGuestOSTypeArch(virCapsPtr caps,
+ const char *ostype,
+ const char *arch)
{
int i;
for (i = 0 ; i < caps->nguests ; i++) {
int toggle);
extern int
+virCapabilitiesSupportsGuestArch(virCapsPtr caps,
+ const char *arch);
+extern int
virCapabilitiesSupportsGuestOSType(virCapsPtr caps,
const char *ostype);
extern int
-virCapabilitiesSupportsGuestArch(virCapsPtr caps,
- const char *ostype,
- const char *arch);
+virCapabilitiesSupportsGuestOSTypeArch(virCapsPtr caps,
+ const char *ostype,
+ const char *arch);
extern const char *
def->os.arch = virXPathString("string(./os/type[1]/@arch)", ctxt);
if (def->os.arch) {
- if (!virCapabilitiesSupportsGuestArch(caps, def->os.type, def->os.arch)) {
+ if (!virCapabilitiesSupportsGuestArch(caps, def->os.arch)) {
virDomainReportError(VIR_ERR_INTERNAL_ERROR,
- _("os type '%s' & arch '%s' combination is not supported"),
+ _("No guest options available for arch '%s'"),
+ def->os.arch);
+ goto error;
+ }
+
+ if (!virCapabilitiesSupportsGuestOSTypeArch(caps,
+ def->os.type,
+ def->os.arch)) {
+ virDomainReportError(VIR_ERR_INTERNAL_ERROR,
+ _("No os type '%s' available for arch '%s'"),
def->os.type, def->os.arch);
goto error;
}