From: Zhang, X. <xia...@in...> - 2008-01-30 02:36:59
|
Anthony Liguori wrote: > This patch attempts to clean up the interactions between KVM and > QEMU. Sorry=20 > for such a big patch, but I don't think there's a better way to > approach this=20 > such that it's still bisect friendly. I think this is most of what's > needed to=20 > get basic KVM support into QEMU though. >=20 > Right now, there's a mix of #ifdef USE_KVM, if (kvm_allowed), and > various=20 > extern declarations. It's all pretty fugly and there's a lot of > mistakes due=20 > to it. >=20 > The following patch eliminates almost all uses of #ifdef USE_KVM by > introducing=20 > a kvm_enabled() macro. If USE_KVM is set, this macro evaluates to > kvm_allowed.=20 > If USE_KVM isn't set, the macro evaluates to 0. >=20 > Since GCC eliminates if (0) blocks, this is just as good as using > #ifdef. By=20 > making sure that we never call into libkvm directly from QEMU, we can > also just=20 > not link qemu-kvm when USE_KVM isn't set instead of having the entire > file=20 > wrapped in a USE_KVM. >=20 > We also change the --enable-kvm configure option to --disable-kvm > since KVM is=20 > enabled by default. >=20 > I've tested this patch on x86 with 32-bit and 64-bit Linux guests and > a 32-bit=20 > Windows guest. I've also tested with USE_KVM not set. Jerone has > also=20 > verified that it doesn't PPC. My apologies if it breaks ia64 but I > have no=20 > way of testing that. Hi, Anthony=20 Good patch indeed! I have checked ia64 side, and It shouldn't break ia64. Thanks! Xiantao |