From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:58425) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QbvIm-0003YP-Tq for qemu-devel@nongnu.org; Wed, 29 Jun 2011 09:59:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QbvIl-0007A3-Ml for qemu-devel@nongnu.org; Wed, 29 Jun 2011 09:59:36 -0400 Received: from mail-iy0-f173.google.com ([209.85.210.173]:40294) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QbvIl-00079l-5P for qemu-devel@nongnu.org; Wed, 29 Jun 2011 09:59:35 -0400 Received: by iyb3 with SMTP id 3so1205966iyb.4 for ; Wed, 29 Jun 2011 06:59:33 -0700 (PDT) MIME-Version: 1.0 From: Wei Liu Date: Wed, 29 Jun 2011 21:59:03 +0800 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: [Qemu-devel] Questions on DeviceState and Virtio infrastructure List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Anthony Perard , Wei LIU , Stefano Stabellini Hi, QEMU folks I know that I might have a bad title for this post, but I just don't have better idea for the title. I'm developing virtio support for Xen pv guest, hoping to reuse the virtio infrastructure in qemu, i.e. I'm planning to use qemu as "virtio backend" for Xen pv. And qemu can be run as pv backend if proper "machine" option is given. Maybe you've known that Xen pv guest utilizes Xenbus/Xenstore to configure its paravirt devices. So I'm to configure virtio devices with Xenbus/Xenstore as well. But in nowdays XenDevice in qemu does not include a DeviceState. To my understanding, it is not connected to qemu's internal buses or whatever (correct me if I'm wrong, I'm relatively new to qemu). Here is the problem, say I'm to implement virtio nic for Xen pv guest, I use Xenbus to probe and initialize the device. When doing initialization, I am to reuse virtio_net_init, which takes DeviceState as the first argument -- but I just don't have one in XenDevice. All I need is to use qemu's virtio infrastructure. What's the purpose of this DeviceState argument? If I just construct my own DeviceState and pass it to virtio_net_init, what will happen? Will qemu emulates virtio nic as usual? Thanks. Wei.