Skip to content

Commit

Permalink
xen-dom-mgmt: introduce f_paused flag for domain creation
Browse files Browse the repository at this point in the history
Some users may want to left domain in paused state after creation.
Add flag for domain config that allows to configure it before passing
it to domain_create().

Signed-off-by: Dmytro Firsov <[email protected]>
Acked-by: Volodymyr Babchuk <[email protected]>
Reviewed-by: Grygorii Strashko <[email protected]>
  • Loading branch information
firscity committed May 15, 2024
1 parent 9619847 commit 94e64a0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions xen-dom-mgmt/include/domain.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ struct xen_domain_cfg {
void *image_info;

struct backend_configuration back_cfg;

bool f_paused:1; /**< Domain should remain paused after creation */
};

struct xen_domain_console {
Expand Down
10 changes: 6 additions & 4 deletions xen-dom-mgmt/src/xen-dom-mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -775,10 +775,12 @@ int domain_create(struct xen_domain_cfg *domcfg, uint32_t domid)
goto stop_domain_console;
}

rc = xen_domctl_unpausedomain(domid);
if (rc) {
LOG_ERR("Failed to unpause domain#%u (rc=%d)", domid, rc);
goto stop_domain_console;
if (!domcfg->f_paused) {
rc = xen_domctl_unpausedomain(domid);
if (rc) {
LOG_ERR("Failed to unpause domain#%u (rc=%d)", domid, rc);
goto stop_domain_console;
}
}

k_mutex_lock(&dl_mutex, K_FOREVER);
Expand Down

0 comments on commit 94e64a0

Please sign in to comment.