diff --git a/libdm/ioctl/libdm-iface.c b/libdm/ioctl/libdm-iface.c index b0a031dd8..4658f21c0 100644 --- a/libdm/ioctl/libdm-iface.c +++ b/libdm/ioctl/libdm-iface.c @@ -747,27 +747,6 @@ int dm_task_set_newuuid(struct dm_task *dmt, const char *newuuid) return 1; } -int dm_task_set_newname(struct dm_task *dmt, const char *newname) -{ - if (strchr(newname, '/')) { - log_error("Name \"%s\" invalid. It contains \"/\".", newname); - return 0; - } - - if (strlen(newname) >= DM_NAME_LEN) { - log_error("Name \"%s\" too long", newname); - return 0; - } - - if (!(dmt->newname = dm_strdup(newname))) { - log_error("dm_task_set_newname: strdup(%s) failed", newname); - return 0; - } - dmt->new_uuid = 0; - - return 1; -} - int dm_task_set_message(struct dm_task *dmt, const char *message) { if (!(dmt->message = dm_strdup(message))) { diff --git a/libdm/libdm-common.c b/libdm/libdm-common.c index 321a9a94d..15ab8643f 100644 --- a/libdm/libdm-common.c +++ b/libdm/libdm-common.c @@ -342,6 +342,27 @@ int dm_task_set_name(struct dm_task *dmt, const char *name) return 1; } +int dm_task_set_newname(struct dm_task *dmt, const char *newname) +{ + if (strchr(newname, '/')) { + log_error("Name \"%s\" invalid. It contains \"/\".", newname); + return 0; + } + + if (strlen(newname) >= DM_NAME_LEN) { + log_error("Name \"%s\" too long", newname); + return 0; + } + + if (!(dmt->newname = dm_strdup(newname))) { + log_error("dm_task_set_newname: strdup(%s) failed", newname); + return 0; + } + dmt->new_uuid = 0; + + return 1; +} + int dm_task_set_uuid(struct dm_task *dmt, const char *uuid) { dm_free(dmt->uuid);