qmp: Add ro argument for block-device hotplug funcs

We should allow users to specify if a block device should be hotplugged
as read-only.

Fixes: #157

Signed-off-by: Eric Ernst <eric.g.ernst@gmail.com>
This commit is contained in:
Eric Ernst
2021-01-11 15:27:51 -08:00
committed by Eric Ernst
parent 5b0331c0fa
commit e2eb549fcd
2 changed files with 9 additions and 8 deletions

View File

@@ -408,7 +408,7 @@ func TestQMPBlockdevAdd(t *testing.T) {
q := startQMPLoop(buf, cfg, connectedCh, disconnectedCh)
q.version = checkVersion(t, connectedCh)
err := q.ExecuteBlockdevAdd(context.Background(), "/dev/rbd0",
fmt.Sprintf("drive_%s", volumeUUID))
fmt.Sprintf("drive_%s", volumeUUID), false)
if err != nil {
t.Fatalf("Unexpected error %v", err)
}
@@ -432,7 +432,7 @@ func TestQMPBlockdevAddWithCache(t *testing.T) {
q := startQMPLoop(buf, cfg, connectedCh, disconnectedCh)
q.version = checkVersion(t, connectedCh)
err := q.ExecuteBlockdevAddWithCache(context.Background(), "/dev/rbd0",
fmt.Sprintf("drive_%s", volumeUUID), true, true)
fmt.Sprintf("drive_%s", volumeUUID), true, true, false)
if err != nil {
t.Fatalf("Unexpected error %v", err)
}