qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH v3 07/38] block/quorum: Implement bdrv_is_insert


From: Max Reitz
Subject: Re: [Qemu-block] [PATCH v3 07/38] block/quorum: Implement bdrv_is_inserted()
Date: Fri, 05 Jun 2015 17:29:41 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

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 <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
---
+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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]