From bf5dbce61e5c0ded4c7b7592e69e1bfb3220fcfe Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Wed, 26 Feb 2014 12:34:17 +0000 Subject: [PATCH] libxl: Recognise ARM architectures Only tested on v7 but the v8 equivalent seems pretty obvious. XEN_CAP_REGEX already accepts more than it should (e.g. x86_64p or x86_32be) but I have stuck with the existing pattern. With this I can create a guest from: libvirt-test 6343998e-9eda-11e3-98f6-77252a7d02f3 393216 393216 1 linux /boot/vmlinuz-arm-native console=hvc0 earlyprintk debug root=/dev/xvda1 destroy restart destroy Using virsh create and I can destroy it too. Currently virsh console fails with: Connected to domain libvirt-test Escape character is ^] error: internal error: cannot find character device I haven't investigated yet. Signed-off-by: Ian Campbell Signed-off-by: Eric Blake --- src/libxl/libxl_conf.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c index 13eddd11fd..ade0a0800f 100644 --- a/src/libxl/libxl_conf.c +++ b/src/libxl/libxl_conf.c @@ -61,7 +61,7 @@ struct guest_arch { int ia64_be; }; -#define XEN_CAP_REGEX "(xen|hvm)-[[:digit:]]+\\.[[:digit:]]+-(x86_32|x86_64|ia64|powerpc64)(p|be)?" +#define XEN_CAP_REGEX "(xen|hvm)-[[:digit:]]+\\.[[:digit:]]+-(aarch64|armv7l|x86_32|x86_64|ia64|powerpc64)(p|be)?" static virClassPtr libxlDriverConfigClass; @@ -320,8 +320,11 @@ libxlCapsInitGuests(libxl_ctx *ctx, virCapsPtr caps) } else if (STRPREFIX(&token[subs[2].rm_so], "powerpc64")) { arch = VIR_ARCH_PPC64; + } else if (STRPREFIX(&token[subs[2].rm_so], "armv7l")) { + arch = VIR_ARCH_ARMV7L; + } else if (STRPREFIX(&token[subs[2].rm_so], "aarch64")) { + arch = VIR_ARCH_AARCH64; } else { - /* XXX arm ? */ continue; }