aboutsummaryrefslogtreecommitdiff
path: root/blockdev.c
diff options
context:
space:
mode:
authorBenoƮt Canet <benoit.canet@irqsave.net>2014-02-12 17:15:07 +0100
committerStefan Hajnoczi <stefanha@redhat.com>2014-02-14 18:05:39 +0100
commit0c5e94ee8339e1aa49020466eba232e6f7c31a0a (patch)
tree6744c39277ab55efacd9543e573fe853c07b9812 /blockdev.c
parentdd67fa5052fecf661369540d5f104720f57900a4 (diff)
block: Open by reference will try device then node_name.
Since we introduced node_name for named bs of the graph modify the opening by reference to use it as a fallback. This patch also enforce the separation of the device id and graph node namespaces. Signed-off-by: Benoit Canet <benoit@irqsave.net> Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'blockdev.c')
-rw-r--r--blockdev.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/blockdev.c b/blockdev.c
index ccd6a72e92..dfb5ec7529 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -452,6 +452,12 @@ static DriveInfo *blockdev_init(const char *file, QDict *bs_opts,
}
}
+ if (bdrv_find_node(qemu_opts_id(opts))) {
+ error_setg(errp, "device id=%s is conflicting with a node-name",
+ qemu_opts_id(opts));
+ goto early_err;
+ }
+
/* init */
dinfo = g_malloc0(sizeof(*dinfo));
dinfo->id = g_strdup(qemu_opts_id(opts));