quorum: Return an error if the blkverify mode has invalid settings
commit83aedca872b5c2bacf9fd35f62cf96479fbf062e
authorAlberto Garcia <berto@igalia.com>
Wed, 17 Oct 2018 14:33:50 +0000 (17 17:33 +0300)
committerKevin Wolf <kwolf@redhat.com>
Mon, 5 Nov 2018 14:09:54 +0000 (5 15:09 +0100)
tree2b1129e2fd0166035bacd1e33d158a20b42d9519
parent6840e8d8ae3c2f8efd76d9d01cce84d047132c7a
quorum: Return an error if the blkverify mode has invalid settings

The blkverify mode of Quorum can only be enabled if the number of
children is exactly two and the value of vote-threshold is also two.

If the user tries to enable it but the other settings are incorrect
then QEMU simply prints an error message to stderr and carries on
disabling the blkverify setting.

This patch makes quorum_open() fail and return an error in this case.

Signed-off-by: Alberto Garcia <berto@igalia.com>
Reported-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/quorum.c