From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36240) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0tZ9-0007ZT-MG for qemu-devel@nongnu.org; Fri, 05 Jun 2015 11:29:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z0tZ8-00080w-PK for qemu-devel@nongnu.org; Fri, 05 Jun 2015 11:29:51 -0400 Message-ID: <5571C065.10001@redhat.com> Date: Fri, 05 Jun 2015 17:29:41 +0200 From: Max Reitz MIME-Version: 1.0 References: <1433360659-1915-1-git-send-email-mreitz@redhat.com> <1433360659-1915-8-git-send-email-mreitz@redhat.com> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Qemu-block] [PATCH v3 07/38] block/quorum: Implement bdrv_is_inserted() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alberto Garcia , qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, Stefan Hajnoczi , Markus Armbruster On 04.06.2015 14:37, Alberto Garcia wrote: > On Wed 03 Jun 2015 09:43:48 PM CEST, Max Reitz wrote: >> bdrv_is_inserted() should be invoked recursively on the children of >> quorum. >> >> Signed-off-by: Max Reitz >> Reviewed-by: Eric Blake >> --- >> +static bool quorum_is_inserted(BlockDriverState *bs) >> +{ >> + BDRVQuorumState *s = bs->opaque; >> + int i; >> + >> + for (i = 0; i < s->num_children; i++) { >> + if (!bdrv_is_inserted(s->bs[i])) { >> + return false; >> + } >> + } >> + >> + return true; >> +} >> + > I wonder if it can actually happen that only some of the BDS are > inserted :-? I'm actually able to start Quorum on an empty DVD drive: $ x86_64-softmmu/qemu-system-x86_64 -drive if=none,id=drv,driver=quorum,children.0.file.filename=/dev/sr0,children.0.driver=raw,children.1.file.filename=test.qcow2,vote-threshold=1 -qmp stdio {"QMP": {"version": {"qemu": {"micro": 50, "minor": 3, "major": 2}, "package": ""}, "capabilities": []}} {'execute':'qmp_capabilities'} {"return": {}} {'execute':'human-monitor-command','arguments':{'command-line':'qemu-io drv "write 0 512"'}} write failed: No medium found {"return": ""} (note that on master, the write is successful (???), but you do get: {"timestamp": {"seconds": 1433518087, "microseconds": 527326}, "event": "QUORUM_REPORT_BAD", "data": {"node-name": "", "sectors-count": 1, "sector-num": 0, "error": "No medium found"}}) Thank you for reviewing! :-) Max