[libvirt] [PATCH] storage backend rbd: Do not prefix rbd: on volume names.

We used to prefix 'rbd:' to volume names, this is not necessary. Qemu takes RBD devices in this way, like: qemu -drive rbd:pool/image When attaching a network disk like RBD to a guest we however do not use this prefix. Currently you can't map a RBD volume name directly to a domain without removing the prefix. Signed-off-by: Wido den Hollander <wido@widodh.nl> --- src/storage/storage_backend_rbd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backend_rbd.c index 3e7464c..7615dcc 100644 --- a/src/storage/storage_backend_rbd.c +++ b/src/storage/storage_backend_rbd.c @@ -237,7 +237,7 @@ static int volStorageBackendRBDRefreshVolInfo(virStorageVolDefPtr vol, vol->type = VIR_STORAGE_VOL_NETWORK; VIR_FREE(vol->target.path); - if (virAsprintf(&vol->target.path, "rbd:%s/%s", + if (virAsprintf(&vol->target.path, "%s/%s", pool->def->source.name, vol->name) == -1) { virReportOOMError(); -- 1.7.9.5

On Fri, Jun 22, 2012 at 02:45:59PM +0200, Wido den Hollander wrote:
We used to prefix 'rbd:' to volume names, this is not necessary.
Qemu takes RBD devices in this way, like: qemu -drive rbd:pool/image
When attaching a network disk like RBD to a guest we however do not use this prefix.
Currently you can't map a RBD volume name directly to a domain without removing the prefix.
Signed-off-by: Wido den Hollander <wido@widodh.nl> --- src/storage/storage_backend_rbd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backend_rbd.c index 3e7464c..7615dcc 100644 --- a/src/storage/storage_backend_rbd.c +++ b/src/storage/storage_backend_rbd.c @@ -237,7 +237,7 @@ static int volStorageBackendRBDRefreshVolInfo(virStorageVolDefPtr vol, vol->type = VIR_STORAGE_VOL_NETWORK;
VIR_FREE(vol->target.path); - if (virAsprintf(&vol->target.path, "rbd:%s/%s", + if (virAsprintf(&vol->target.path, "%s/%s", pool->def->source.name, vol->name) == -1) { virReportOOMError();
ACK good to remove this redundancy Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On 25.06.2012 15:04, Daniel P. Berrange wrote:
On Fri, Jun 22, 2012 at 02:45:59PM +0200, Wido den Hollander wrote:
We used to prefix 'rbd:' to volume names, this is not necessary.
Qemu takes RBD devices in this way, like: qemu -drive rbd:pool/image
When attaching a network disk like RBD to a guest we however do not use this prefix.
Currently you can't map a RBD volume name directly to a domain without removing the prefix.
Signed-off-by: Wido den Hollander <wido@widodh.nl> --- src/storage/storage_backend_rbd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backend_rbd.c index 3e7464c..7615dcc 100644 --- a/src/storage/storage_backend_rbd.c +++ b/src/storage/storage_backend_rbd.c @@ -237,7 +237,7 @@ static int volStorageBackendRBDRefreshVolInfo(virStorageVolDefPtr vol, vol->type = VIR_STORAGE_VOL_NETWORK;
VIR_FREE(vol->target.path); - if (virAsprintf(&vol->target.path, "rbd:%s/%s", + if (virAsprintf(&vol->target.path, "%s/%s", pool->def->source.name, vol->name) == -1) { virReportOOMError();
ACK good to remove this redundancy
Daniel
Pushed now. Michal
participants (3)
-
Daniel P. Berrange
-
Michal Privoznik
-
Wido den Hollander