Hi Jeroen, thanks a lot for your testing! On Thu, Oct 07, 2010 at 09:51:12PM +0200, Jeroen Dekkers wrote: > Hi Guido, > > At Fri, 1 Oct 2010 10:00:45 +0200, > Guido Günther wrote: > > It checks three error conditions but only sets an error message for one > > of them. Can I ask you to try the attached patch against 0.4.6 and see > > if it changes the error message? This should get us closer to the cause. > > I get this error (from virt-manager.log): > > libvirtError: internal error Cannot find suitable hypervisor > > > What version of kvm are you running on the Lenny system? I assume the > > one from Lenny? Could you also check if deinstalling it and running qemu > > instead does any difference? > > When I remove kvm and install qemu it works. If I install kvm again > it works too. But when I remove qemu, I get the same error again. That explains why I'm not seeing it. You're running on x86_64 and I on i386. The attached patch should fix your problem - I can't test that here since I don't have a 64bit capable machine around.
[..snip..] > Googling for that error message turns up that it's a bug in 0.8.1 that > should be fixed in 0.8.2. But virt-manager works fine with 0.8.1... I can only assume the error got ignored in earlier versions. The real cause of the problem seems to be the version in Lenny. I'd be great if you could check the attached patch. There could be more bugs lurking though if you're not running on real hardware since /dev/kvm isn't available then, but in this case the more detailed error message should give us another hint. Cheers, -- Guido
>From 625eace1b6f0a38041dc2502c3ee68c4a70c7f16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= <[email protected]> Date: Fri, 8 Oct 2010 14:45:20 +0200 Subject: [PATCH] Fix type detection --- src/qemu_conf.c | 30 ++++++++++++++++++++++++++---- 1 files changed, 26 insertions(+), 4 deletions(-) diff --git a/src/qemu_conf.c b/src/qemu_conf.c index 23ef050..65ec465 100644 --- a/src/qemu_conf.c +++ b/src/qemu_conf.c @@ -233,7 +233,8 @@ qemudCapsInitGuest(virCapsPtr caps, hasbase = (access(info->binary, X_OK) == 0); samearch = STREQ(info->arch, hostmachine); - if (samearch) { + if (samearch || + (STREQ(hostmachine, "x86_64") && STREQ(info->arch, "i686"))) { const char *const kvmbins[] = { "/usr/bin/qemu-kvm", /* Fedora */ "/usr/bin/kvm" }; /* Upstream .spec */ @@ -280,7 +281,9 @@ qemudCapsInitGuest(virCapsPtr caps, 0, NULL) == NULL) return -1; - + } + if (samearch || + (STREQ(hostmachine, "x86_64") && STREQ(info->arch, "i686"))) { if (access("/dev/kvm", F_OK) == 0 && haskvm && virCapabilitiesAddGuestDomain(guest, @@ -500,19 +503,38 @@ rewait: return ret; } +static void +uname_normalize (struct utsname *ut) +{ + uname(ut); + + /* Map i386, i486, i586 to i686. */ + if (ut->machine[0] == 'i' && + ut->machine[1] != '\0' && + ut->machine[2] == '8' && + ut->machine[3] == '6' && + ut->machine[4] == '\0') + ut->machine[1] = '6'; +} + int qemudExtractVersion(virConnectPtr conn, struct qemud_driver *driver) { const char *binary; struct stat sb; + struct utsname ut; if (driver->qemuVersion > 0) return 0; + uname_normalize(&ut); if ((binary = virCapabilitiesDefaultGuestEmulator(driver->caps, "hvm", - "i686", - "qemu")) == NULL) + ut.machine, + "qemu")) == NULL) { + qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, + _("Cannot find suitable emulator for %s"), ut.machine); return -1; + } if (stat(binary, &sb) < 0) { qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, -- 1.7.1

