From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=36018 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OIeWm-0000ik-50 for qemu-devel@nongnu.org; Sun, 30 May 2010 05:09:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OIeWk-0005Z5-MH for qemu-devel@nongnu.org; Sun, 30 May 2010 05:09:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54831) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OIeWk-0005Yp-DX for qemu-devel@nongnu.org; Sun, 30 May 2010 05:09:50 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o4U99mR5004086 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 30 May 2010 05:09:48 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o4U99kH8004640 for ; Sun, 30 May 2010 05:09:47 -0400 Message-ID: <4C022B59.80109@redhat.com> Date: Sun, 30 May 2010 12:09:45 +0300 From: Avi Kivity MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: RFC: blockdev_add & friends, brief rationale, QMP docs List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Kevin Wolf , Gerd Hoffmann , qemu-devel@nongnu.org, Luiz Capitulino On 05/28/2010 09:21 PM, Markus Armbruster wrote: > Summary of the host / guest split: > > -drive options host or guest? > bus, unit, if, index, addr guest, already covered by qdev > cyls, heads, secs, trans guest, new qdev properties > (but defaults depend on image) > media guest > snapshot, file, cache, aio, format host, blockdev_add options > We expose some of the cache property to the guest. IMO we need the cache property to be both guest and host, with qemu bridging the impedance mismatch if needed. > rerror, werror host, guest drivers will reject > values they don't support > Did you mean 'block format drivers will reject'? > serial guest, new qdev properties > readonly both host& guest, qdev will refuse > to connect readonly host to read/ > write guest > > QMP command docs: > > blockdev_add > ------------ > > Add host block device. > > Arguments: > > - "id": the host block device's ID, must be unique (json-string) > Unique in which namespace? A global ID namespace if fine. > - "file": the disk image file to use (json-string, optional) > - "format": disk format (json-string, optional) > - Possible values: "raw", "qcow2", ... > Need some way to list supported formats. > - "aio": host AIO (json-string, optional) > - Possible values: "threads" (default), "native" > Need some way to list supported options. > - "cache": host cache usage (json-string, optional) > - Possible values: "writethrough" (default), "writeback", "unsafe", > "none" > ... > - "readonly": open image read-only (json-bool, optional, default false) > - "rerror": what to do on read error (json-string, optional) > - Possible values: "report" (default), "ignore", "stop" > ... > - "werror": what to do on write error (json-string, optional) > - Possible values: "enospc" (default), "report", "ignore", "stop" > ... > - "snapshot": enable snapshot (json-bool, optional, default false) > > An alternative to the "Need some way to list *" is to provide another query capability, akin to KVM_CAP_..., but I think listing is superior. > Example: > > -> { "execute": "blockdev_add", > "arguments": { "format": "raw", "id": "blk1", > "file": "fedora.img" } } > <- { "return": {} } > > Notes: > > (1) If argument "file" is missing, all other optional arguments must be > missing as well. This defines a block device with no media > inserted. > > (2) It's possible to list supported disk formats by running QEMU with > arguments "-blockdev_add \?". > Ok, so there's a partial answer here. > blockdev_change > --------------- > > Change host block device media. > > Arguments are exactly like blockdev_add. > > Notes: > > (1) If argument "file" is missing, all other optional arguments must be > missing as well. This ejects the media without inserting a new one. > Maybe we want an explicit blockdev_eject instead, not sure. -- error compiling committee.c: too many arguments to function