Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libtcmu: allow multiple daemons co-exist #519

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions libtcmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ static int handle_netlink(struct nl_cache_ops *unused, struct genl_cmd *cmd,
ret = add_device(ctx, buf,
nla_get_string(info->attrs[TCMU_ATTR_DEVICE]),
false);
if (ret == -ENOENT)
return 0;
break;
case TCMU_CMD_REMOVED_DEVICE:
reply_cmd = TCMU_CMD_REMOVED_DEVICE_DONE;
Expand Down Expand Up @@ -432,8 +434,8 @@ static int add_device(struct tcmulib_context *ctx, char *dev_name,

dev->handler = find_handler(ctx, dev->cfgstring);
if (!dev->handler) {
tcmu_err("could not find handler for %s\n", dev->dev_name);
goto err_free;
tcmu_warn("could not find handler for %s\n", dev->dev_name);
goto err_nohandler;
}

if (dev->handler->check_config &&
Expand Down Expand Up @@ -536,6 +538,9 @@ static int add_device(struct tcmulib_context *ctx, char *dev_name,
tcmu_cfgfs_dev_exec_action(dev, "block_dev", 0);
err_free:
free(dev);
return -1;
err_nohandler:
free(dev);

return -ENOENT;
}
Expand Down