Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MwbQb-0002ug-LB for qemu-devel@nongnu.org; Sat, 10 Oct 2009 08:52:05 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MwbQW-0002ms-8n for qemu-devel@nongnu.org; Sat, 10 Oct 2009 08:52:04 -0400 Received: from [199.232.76.173] (port=52188 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MwbQV-0002mG-TY for qemu-devel@nongnu.org; Sat, 10 Oct 2009 08:52:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34223) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MwbQV-0003M2-AH for qemu-devel@nongnu.org; Sat, 10 Oct 2009 08:51:59 -0400 Subject: Re: [Qemu-devel] [PATCH 08/10] monitor: Convert bdrv_info() to QObject References: <1255037747-3340-1-git-send-email-lcapitulino@redhat.com> <1255037747-3340-9-git-send-email-lcapitulino@redhat.com> From: Markus Armbruster Date: Sat, 10 Oct 2009 14:18:03 +0200 In-Reply-To: <1255037747-3340-9-git-send-email-lcapitulino@redhat.com> (Luiz Capitulino's message of "Thu\, 8 Oct 2009 18\:35\:45 -0300") Message-ID: <87bpkf1lz8.fsf@pike.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org Luiz Capitulino writes: > Each block device information is stored in a QDict and the > returned QObject is a QList of all devices. > > The QDict contains the following: > > - "device": device name > - "type": device type > - "removable": 1 if the device is removable 0 otherwise > - "locked": 1 if the device is locked 0 otherwise > - "backing_file": backing file name if one is used Isn't this in "interted" rather than here? If yes, the comment in the code needs fixing, too. > - "inserted": only present if the device is inserted, it is a QDict I'd call this "media". > containing the following: > - "file": device file name > - "ro": 1 if read-only 0 otherwise > - "drv": driver format name > - "encrypted": 1 if encrypted 0 otherwise > > The current implemention uses integers as booleans, to make > things simple those integers are stored in the QDict. Ideally, > we would have a QBool type and this is probably going to be > a requirement for the protocol. > > But the integers will do the job for now. > > This commit should not change user output, the following is an > example of the returned QList: > > [ { "device": "ide0-hd0", "type": "hd", "removable": 0, > "file": "/tmp/foobar", "ro": 0, "drv": "qcow2", "encrypted": 0 } > { "device": "floppy0", "type": "floppy", "removable": 1, > "locked": 0 } ] [...]