From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sasha Levin Subject: Re: Guest kernel device compatability auto-detection Date: Fri, 26 Aug 2011 09:08:02 +0300 Message-ID: <1314338882.3647.13.camel@lappy> References: <1314249688.3459.23.camel@lappy> <4E56C334.5070509@codemonkey.ws> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: qemu-devel , kvm To: Anthony Liguori Return-path: Received: from mail-ww0-f44.google.com ([74.125.82.44]:46710 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752692Ab1HZGII (ORCPT ); Fri, 26 Aug 2011 02:08:08 -0400 Received: by wwf5 with SMTP id 5so3126493wwf.1 for ; Thu, 25 Aug 2011 23:08:07 -0700 (PDT) In-Reply-To: <4E56C334.5070509@codemonkey.ws> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, 2011-08-25 at 16:48 -0500, Anthony Liguori wrote: > On 08/25/2011 12:21 AM, Sasha Levin wrote: > > Hi, > > > > Currently when we run the guest we treat it as a black box, we're not > > quite sure what it's going to start and whether it supports the same > > features we expect it to support when running it from the host. > > > > This forces us to start the guest with the safest defaults possible, for > > example: '-drive file=my_image.qcow2' will be started with slow IDE > > emulation even though the guest is capable of virtio. > > > > I'm currently working on a method to try and detect whether the guest > > kernel has specific configurations enabled and either warn the user if > > we know the kernel is not going to properly work or use better defaults > > if we know some advanced features are going to work. > > > > How am I planning to do it? First, we'll try finding which kernel the > > guest is going to boot (easy when user does '-kernel', less easy when > > the user boots an image). For simplicity sake I'll stick with the > > '-kernel' option for now. > > Is the problem you're trying to solve determine whether the guest kernel > is going to work well under kvm tool or trying to choose the right > hardware profile to expose to the guest? > > If it's the former, I think the path you're heading down is the most > likely to succeed (trying to guess based on what you can infer about the > kernel). > > If it's the later, there's some interesting possibilities we never fully > explored in QEMU. > I was thinking about both, I've considered kvm tools to be the 'easy' case where we only say if it would work or not, and QEMU as the hard one where we need to build a working configuration. > One would be exposing a well supported device (like IDE emulation) and > having a magic mode that allowed you to basically promote the device > from IDE emulation to virtio-blk. Likewise, you could do something like > that to promote from the e1000 to virtio-net. > > It might require some special support in the guest kernel and would > likely be impossible to do in Windows, but if you primarily care about > Linux guests, it ought to be possible. You're thinking about trying to expose all interfaces during boot and seeing which ones the kernel bites? Another thing that comes to mind is that we could start this project with a script that given a kernel, it would find the optimal hardware configuration for it (and the matching QEMU command line). It would simply work the other way around: try booting with the best devices first, if it doesn't boot we would 'demote' them one at a time until the kernel does boot. -- Sasha. From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:33143) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwpaL-0003jE-VM for qemu-devel@nongnu.org; Fri, 26 Aug 2011 02:08:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QwpaK-0001Yk-T6 for qemu-devel@nongnu.org; Fri, 26 Aug 2011 02:08:09 -0400 Received: from mail-ww0-f53.google.com ([74.125.82.53]:49677) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwpaK-0001YV-LG for qemu-devel@nongnu.org; Fri, 26 Aug 2011 02:08:08 -0400 Received: by wwf25 with SMTP id 25so2940897wwf.10 for ; Thu, 25 Aug 2011 23:08:07 -0700 (PDT) From: Sasha Levin In-Reply-To: <4E56C334.5070509@codemonkey.ws> References: <1314249688.3459.23.camel@lappy> <4E56C334.5070509@codemonkey.ws> Content-Type: text/plain; charset="us-ascii" Date: Fri, 26 Aug 2011 09:08:02 +0300 Message-ID: <1314338882.3647.13.camel@lappy> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] Guest kernel device compatability auto-detection List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel , kvm On Thu, 2011-08-25 at 16:48 -0500, Anthony Liguori wrote: > On 08/25/2011 12:21 AM, Sasha Levin wrote: > > Hi, > > > > Currently when we run the guest we treat it as a black box, we're not > > quite sure what it's going to start and whether it supports the same > > features we expect it to support when running it from the host. > > > > This forces us to start the guest with the safest defaults possible, for > > example: '-drive file=my_image.qcow2' will be started with slow IDE > > emulation even though the guest is capable of virtio. > > > > I'm currently working on a method to try and detect whether the guest > > kernel has specific configurations enabled and either warn the user if > > we know the kernel is not going to properly work or use better defaults > > if we know some advanced features are going to work. > > > > How am I planning to do it? First, we'll try finding which kernel the > > guest is going to boot (easy when user does '-kernel', less easy when > > the user boots an image). For simplicity sake I'll stick with the > > '-kernel' option for now. > > Is the problem you're trying to solve determine whether the guest kernel > is going to work well under kvm tool or trying to choose the right > hardware profile to expose to the guest? > > If it's the former, I think the path you're heading down is the most > likely to succeed (trying to guess based on what you can infer about the > kernel). > > If it's the later, there's some interesting possibilities we never fully > explored in QEMU. > I was thinking about both, I've considered kvm tools to be the 'easy' case where we only say if it would work or not, and QEMU as the hard one where we need to build a working configuration. > One would be exposing a well supported device (like IDE emulation) and > having a magic mode that allowed you to basically promote the device > from IDE emulation to virtio-blk. Likewise, you could do something like > that to promote from the e1000 to virtio-net. > > It might require some special support in the guest kernel and would > likely be impossible to do in Windows, but if you primarily care about > Linux guests, it ought to be possible. You're thinking about trying to expose all interfaces during boot and seeing which ones the kernel bites? Another thing that comes to mind is that we could start this project with a script that given a kernel, it would find the optimal hardware configuration for it (and the matching QEMU command line). It would simply work the other way around: try booting with the best devices first, if it doesn't boot we would 'demote' them one at a time until the kernel does boot. -- Sasha.