From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:50680) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1So9l4-0006r4-7v for qemu-devel@nongnu.org; Mon, 09 Jul 2012 04:55:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1So9kt-00074Q-5W for qemu-devel@nongnu.org; Mon, 09 Jul 2012 04:55:53 -0400 Received: from e28smtp04.in.ibm.com ([122.248.162.4]:38368) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1So9ks-0006yg-BM for qemu-devel@nongnu.org; Mon, 09 Jul 2012 04:55:43 -0400 Received: from /spool/local by e28smtp04.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 9 Jul 2012 14:25:35 +0530 Received: from d28av01.in.ibm.com (d28av01.in.ibm.com [9.184.220.63]) by d28relay01.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q698tXdA11796876 for ; Mon, 9 Jul 2012 14:25:33 +0530 Received: from d28av01.in.ibm.com (loopback [127.0.0.1]) by d28av01.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q69EP6e4004224 for ; Mon, 9 Jul 2012 19:55:06 +0530 Message-ID: <4FFA9C30.2070201@linux.vnet.ibm.com> Date: Mon, 09 Jul 2012 16:54:08 +0800 From: Wenchao Xia MIME-Version: 1.0 Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [RFC] introduce a dynamic library to expose qemu block API List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , Anthony Liguori , Stefan Hajnoczi , qemu-devel@nongnu.org Hi, Paolo and folks, qemu have good capabilities to access different virtual disks, I want to expose its block layer API to let 3rd party program linked in, such as management stack or block tools, to access images data directly. Following is the objects: (1) API to write/read block device at offset. (2) Determine the image type,qcow2/qed/raw (3) Determine which blocks are allocated. (4) Determine backing file. Following is my implementing plan draft: 1 introduce libqblock.so in sub directory in qemu. 2 write a nbd client in libqblock, similar to qemu nbd client. Then use it to talk with nbd server, by default is qemu-nbd, to get access to images. In this way, libqblock.so could be friendly LGPL licensed. 3 still not got a good way to get additional info in (2)(3)(4), currently in my head is patch qemu-nbd to add an additional nbd command, "image-info", in which returns related info. What do you think about it? -- Best Regards Wenchao Xia mail:xiawenc@linux.vnet.ibm.com tel:86-010-82450803