}
/* the dm uuid uses the wwid of the underlying dev */
-int dev_has_mpath_uuid(struct cmd_context *cmd, struct device *dev, const char **idname_out)
+int dev_has_mpath_uuid(struct cmd_context *cmd, struct device *dev, char **idname_out)
{
char uuid[DM_UUID_LEN];
- const char *idname;
+ char *idname;
if (!device_get_uuid(cmd, MAJOR(dev->dev), MINOR(dev->dev), uuid, sizeof(uuid)))
return_0;
return 1;
}
-static int _dev_has_crypt_uuid(struct cmd_context *cmd, struct device *dev, const char **idname_out)
+static int _dev_has_crypt_uuid(struct cmd_context *cmd, struct device *dev, char **idname_out)
{
char uuid[DM_UUID_LEN];
- const char *idname;
+ char *idname;
if (!device_get_uuid(cmd, MAJOR(dev->dev), MINOR(dev->dev), uuid, sizeof(uuid)))
return_0;
return 1;
}
-static int _dev_has_lvmlv_uuid(struct cmd_context *cmd, struct device *dev, const char **idname_out)
+static int _dev_has_lvmlv_uuid(struct cmd_context *cmd, struct device *dev, char **idname_out)
{
char uuid[DM_UUID_LEN];
- const char *idname;
+ char *idname;
if (!device_get_uuid(cmd, MAJOR(dev->dev), MINOR(dev->dev), uuid, sizeof(uuid)))
return_0;
return 0;
}
-const char *device_id_system_read(struct cmd_context *cmd, struct device *dev, uint16_t idtype)
+char *device_id_system_read(struct cmd_context *cmd, struct device *dev, uint16_t idtype)
{
char sysbuf[PATH_MAX] = { 0 };
char sysbuf2[PATH_MAX] = { 0 };
- const char *idname = NULL;
+ char *idname;
struct dev_wwid *dw;
unsigned i;
}
static int device_id_system_read_preferred(struct cmd_context *cmd, struct device *dev,
- uint16_t *new_idtype, const char **new_idname)
+ uint16_t *new_idtype, char **new_idname)
{
- const char *idname = NULL;
+ char *idname = NULL;
uint16_t idtype;
if (MAJOR(dev->dev) == cmd->dev_types->device_mapper_major) {
{
char sysbuf[PATH_MAX] = { 0 };
struct dev_id *id;
- const char *idname;
+ char *idname;
/*
* An idtype other than DEVNAME is stable, i.e. it doesn't change after
if ((idname = device_id_system_read(cmd, dev, DEV_ID_TYPE_SYS_WWID))) {
/* see comment above */
if (!strstr(idname, "QEMU")) {
- free((void*)idname);
+ free(idname);
return 1;
}
- free((void*)idname);
+ free(idname);
return 0;
}
if ((idname = device_id_system_read(cmd, dev, DEV_ID_TYPE_SYS_SERIAL))) {
- free((void*)idname);
+ free(idname);
return 1;
}
if ((MAJOR(dev->dev) == cmd->dev_types->loop_major) &&
(idname = device_id_system_read(cmd, dev, DEV_ID_TYPE_LOOP_FILE))) {
- free((void*)idname);
+ free(idname);
return 1;
}
{
char pvid[ID_LEN+1] = { 0 };
uint16_t idtype = 0;
- const char *idname = NULL;
- const char *check_idname = NULL;
+ char *idname = NULL;
+ char *check_idname = NULL;
const char *update_matching_kind = NULL;
const char *update_matching_name = NULL;
struct dev_use *du, *update_du = NULL, *du_dev, *du_pvid, *du_devname, *du_devid;
if (!cmd->current_settings.yes &&
yes_no_prompt("Add device with duplicate PV to devices file?") == 'n') {
log_print_unless_silent("Device not added.");
- free((void *)check_idname);
+ free(check_idname);
return 1;
}
}
}
}
- free((void *)check_idname);
+ free(check_idname);
if (!update_du) {
log_debug("Adding new entry to devices file for %s PVID %s %s %s.",
new_devname = NULL;
if (cmd->device_ids_refresh_trigger || all_ids) {
- if (!device_id_system_read_preferred(cmd, dev, &new_idtype, (const char **)&new_idname))
+ if (!device_id_system_read_preferred(cmd, dev, &new_idtype, &new_idname))
continue;
new_idname2 = strdup(new_idname);
new_devname = strdup(devname);
int noupdate, int *update_needed);
void device_ids_search(struct cmd_context *cmd, struct dm_list *new_devs,
int all_ids, int noupdate, int *update_needed);
-const char *device_id_system_read(struct cmd_context *cmd, struct device *dev, uint16_t idtype);
+char *device_id_system_read(struct cmd_context *cmd, struct device *dev, uint16_t idtype);
void device_id_update_vg_uuid(struct cmd_context *cmd, struct volume_group *vg, struct id *old_vg_id);
int device_ids_version_unchanged(struct cmd_context *cmd);
int read_sys_block_binary(struct cmd_context *cmd, struct device *dev,
const char *suffix, char *sysbuf, int sysbufsize, int *retlen);
-int dev_has_mpath_uuid(struct cmd_context *cmd, struct device *dev, const char **idname_out);
+int dev_has_mpath_uuid(struct cmd_context *cmd, struct device *dev, char **idname_out);
int wwid_type_to_idtype(int wwid_type);
int idtype_to_wwid_type(int idtype);