[libvirt] [PATCH] block/sheepdog: rename management program from collie to dog

The management program of latest sheepdog is named as "dog", "collie" is obsolete. This patch updates the name in the configure script and the sheepdog driver. Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru> Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp> --- configure.ac | 10 +++++----- src/storage/storage_backend_sheepdog.c | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/configure.ac b/configure.ac index 710cb71..186d9e3 100644 --- a/configure.ac +++ b/configure.ac @@ -1926,14 +1926,14 @@ AC_SUBST([LIBRBD_LIBS]) if test "$with_storage_sheepdog" = "yes" || test "$with_storage_sheepdog" = "check"; then - AC_PATH_PROG([COLLIE], [collie], [], [$PATH:/sbin:/usr/sbin]) + AC_PATH_PROG([DOG], [dog], [], [$PATH:/sbin:/usr/sbin]) if test "$with_storage_sheepdog" = "yes"; then - if test -z "$COLLIE"; then - AC_MSG_ERROR([We need collie for Sheepdog storage driver]) + if test -z "$DOG"; then + AC_MSG_ERROR([We need dog for Sheepdog storage driver]) fi else - if test -z "$COLLIE"; then + if test -z "$DOG"; then with_storage_sheepdog=no fi @@ -1945,7 +1945,7 @@ if test "$with_storage_sheepdog" = "yes" || if test "$with_storage_sheepdog" = "yes"; then AC_DEFINE_UNQUOTED([WITH_STORAGE_SHEEPDOG], 1, [whether Sheepdog backend for storage driver is enabled]) - AC_DEFINE_UNQUOTED([COLLIE],["$COLLIE"],[Location of collie program]) + AC_DEFINE_UNQUOTED([DOG],["$DOG"],[Location of dog program]) fi fi AM_CONDITIONAL([WITH_STORAGE_SHEEPDOG], diff --git a/src/storage/storage_backend_sheepdog.c b/src/storage/storage_backend_sheepdog.c index 9419859..864ecd6 100644 --- a/src/storage/storage_backend_sheepdog.c +++ b/src/storage/storage_backend_sheepdog.c @@ -150,7 +150,7 @@ virStorageBackendSheepdogRefreshAllVol(virConnectPtr conn ATTRIBUTE_UNUSED, char **cells = NULL; size_t i; - virCommandPtr cmd = virCommandNewArgList(COLLIE, "vdi", "list", "-r", NULL); + virCommandPtr cmd = virCommandNewArgList(DOG, "vdi", "list", "-r", NULL); virStorageBackendSheepdogAddHostArg(cmd, pool); virCommandSetOutputBuffer(cmd, &output); if (virCommandRun(cmd, NULL) < 0) @@ -195,7 +195,7 @@ virStorageBackendSheepdogRefreshPool(virConnectPtr conn ATTRIBUTE_UNUSED, char *output = NULL; virCommandPtr cmd; - cmd = virCommandNewArgList(COLLIE, "node", "info", "-r", NULL); + cmd = virCommandNewArgList(DOG, "node", "info", "-r", NULL); virStorageBackendSheepdogAddHostArg(cmd, pool); virCommandSetOutputBuffer(cmd, &output); if (virCommandRun(cmd, NULL) < 0) @@ -221,7 +221,7 @@ virStorageBackendSheepdogDeleteVol(virConnectPtr conn ATTRIBUTE_UNUSED, virCheckFlags(0, -1); - virCommandPtr cmd = virCommandNewArgList(COLLIE, "vdi", "delete", vol->name, NULL); + virCommandPtr cmd = virCommandNewArgList(DOG, "vdi", "delete", vol->name, NULL); virStorageBackendSheepdogAddHostArg(cmd, pool); int ret = virCommandRun(cmd, NULL); @@ -266,7 +266,7 @@ virStorageBackendSheepdogBuildVol(virConnectPtr conn, virCheckFlags(0, -1); - virCommandPtr cmd = virCommandNewArgList(COLLIE, "vdi", "create", vol->name, NULL); + virCommandPtr cmd = virCommandNewArgList(DOG, "vdi", "create", vol->name, NULL); virCommandAddArgFormat(cmd, "%llu", vol->target.capacity); virStorageBackendSheepdogAddHostArg(cmd, pool); if (virCommandRun(cmd, NULL) < 0) @@ -351,7 +351,7 @@ virStorageBackendSheepdogRefreshVol(virConnectPtr conn ATTRIBUTE_UNUSED, int ret; char *output = NULL; - virCommandPtr cmd = virCommandNewArgList(COLLIE, "vdi", "list", vol->name, "-r", NULL); + virCommandPtr cmd = virCommandNewArgList(DOG, "vdi", "list", vol->name, "-r", NULL); virStorageBackendSheepdogAddHostArg(cmd, pool); virCommandSetOutputBuffer(cmd, &output); ret = virCommandRun(cmd, NULL); @@ -387,7 +387,7 @@ virStorageBackendSheepdogResizeVol(virConnectPtr conn ATTRIBUTE_UNUSED, virCheckFlags(0, -1); - virCommandPtr cmd = virCommandNewArgList(COLLIE, "vdi", "resize", vol->name, NULL); + virCommandPtr cmd = virCommandNewArgList(DOG, "vdi", "resize", vol->name, NULL); virCommandAddArgFormat(cmd, "%llu", capacity); virStorageBackendSheepdogAddHostArg(cmd, pool); int ret = virCommandRun(cmd, NULL); -- 1.7.1

On Mon, Jun 23, 2014 at 03:20:11PM +0900, Hitoshi Mitake wrote:
The management program of latest sheepdog is named as "dog", "collie" is obsolete. This patch updates the name in the configure script and the sheepdog driver.
Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru> Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp> --- configure.ac | 10 +++++----- src/storage/storage_backend_sheepdog.c | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-)
This will break libvirt when run against existing sheepdog releases which still have the name 'collie'. Libvirt needs to detect which command name is used and pick the right one to use, not just hardcode one of them. Regards, 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 06/23/2014 12:20 AM, Hitoshi Mitake wrote:
The management program of latest sheepdog is named as "dog", "collie" is obsolete. This patch updates the name in the configure script and the sheepdog driver.
Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru> Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp> --- configure.ac | 10 +++++----- src/storage/storage_backend_sheepdog.c | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-)
Please re-read the comments given at the first attempt at this patch: https://www.redhat.com/archives/libvir-list/2014-June/msg00760.html
diff --git a/configure.ac b/configure.ac index 710cb71..186d9e3 100644 --- a/configure.ac +++ b/configure.ac @@ -1926,14 +1926,14 @@ AC_SUBST([LIBRBD_LIBS])
if test "$with_storage_sheepdog" = "yes" || test "$with_storage_sheepdog" = "check"; then - AC_PATH_PROG([COLLIE], [collie], [], [$PATH:/sbin:/usr/sbin]) + AC_PATH_PROG([DOG], [dog], [], [$PATH:/sbin:/usr/sbin])
This is wrong; you need to test for both names, and use the correct one, in order to be back-compat safe. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

Hi Eric, Daniel, thanks for your reply and sorry for my late reply. On Tue, Jun 24, 2014 at 1:43 AM, Eric Blake <eblake@redhat.com> wrote:
On 06/23/2014 12:20 AM, Hitoshi Mitake wrote:
The management program of latest sheepdog is named as "dog", "collie" is obsolete. This patch updates the name in the configure script and the sheepdog driver.
Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru> Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp> --- configure.ac | 10 +++++----- src/storage/storage_backend_sheepdog.c | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-)
Please re-read the comments given at the first attempt at this patch: https://www.redhat.com/archives/libvir-list/2014-June/msg00760.html
diff --git a/configure.ac b/configure.ac index 710cb71..186d9e3 100644 --- a/configure.ac +++ b/configure.ac @@ -1926,14 +1926,14 @@ AC_SUBST([LIBRBD_LIBS])
if test "$with_storage_sheepdog" = "yes" || test "$with_storage_sheepdog" = "check"; then - AC_PATH_PROG([COLLIE], [collie], [], [$PATH:/sbin:/usr/sbin]) + AC_PATH_PROG([DOG], [dog], [], [$PATH:/sbin:/usr/sbin])
This is wrong; you need to test for both names, and use the correct one, in order to be back-compat safe.
-- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
I missed the point of compatibility. I'll post v2 which doesn't break it later. Thanks, Hitoshi
participants (4)
-
Daniel P. Berrange
-
Eric Blake
-
Hitoshi Mitake
-
Hitoshi Mitake