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

xen-dom-mgmt: Use correct domid for domain_post_create #87

Merged
merged 1 commit into from
May 14, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion xen-dom-mgmt/include/xen_dom_mgmt.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ extern "C" {
*
* @param domcfg The configuration for the new domain.
* @param domid The ID of the new domain.
* @return 0 on success, or an error code on failure.
* @return domid on success, or a negative error code on failure.
*/
int domain_create(struct xen_domain_cfg *domcfg, uint32_t domid);

Expand Down
6 changes: 5 additions & 1 deletion xen-dom-mgmt/src/xen-dom-mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,11 @@ int domain_create(struct xen_domain_cfg *domcfg, uint32_t domid)
++dom_num;
k_mutex_unlock(&dl_mutex);

return rc;
if (rc) {
return rc;
}

return domid;

stop_domain_console:
#ifdef CONFIG_XEN_CONSOLE_SRV
Expand Down
4 changes: 2 additions & 2 deletions xen-shell-cmd/src/xen_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ static int domu_create(const struct shell *shell, int argc, char **argv)
}

ret = domain_create(cfg, domid);
if (ret) {
if (ret < 0) {
return ret; /* domain_create should care about error logs */
}

return domain_post_create(cfg, domid);
return domain_post_create(cfg, ret);
}

int domu_destroy(const struct shell *shell, size_t argc, char **argv)
Expand Down