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: do not left domain paused on creation #86

Merged
merged 3 commits into from
May 15, 2024

Conversation

firscity
Copy link
Collaborator

Some hacky logic were added previously on domain creation - only Domain-D is unpaused after domain_create(). This looks like hack, that definitely should be removed from mainline library.

Copy link
Collaborator

@lorc lorc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, this was hack. I am fine with this change:

Reviewed-by: Volodymyr Babchuk <[email protected]>

But, could you please add -p parameter to xu create command in case someone wants to create domain in paused state? I believe it was needed for PV drivers (or vchan?) debugging.

@Deedone
Copy link
Contributor

Deedone commented May 13, 2024

Reviewed-by: Mykyta Poturai <[email protected]>

@firscity
Copy link
Collaborator Author

Thanks for review

But, could you please add -p parameter to xu create command in case someone wants to create domain in paused state? I believe it was needed for PV drivers (or vchan?) debugging.

Yes, it is possible, but after changing domain_create() signature, unpause is currently called inside. Are you OK if it will be made separately after AoS release? Unfortunately, it will affect some other PRs.

@lorc
Copy link
Collaborator

lorc commented May 13, 2024

Yes, it is possible, but after changing domain_create() signature, unpause is currently called inside. Are you OK if it will be made separately after AoS release? Unfortunately, it will affect some other PRs.

Well, I am not sure that we need additional parameter. This can be flag in a domain configuration structure.

@xakep-amatop
Copy link
Collaborator

Acked-by: Mykola Kvach <[email protected]>

@@ -742,14 +742,10 @@ int domain_create(struct xen_domain_cfg *domcfg, uint32_t domid)
goto stop_domain_console;
}

if (domid == DOMID_DOMD) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems you can drop DOMID_DOMD now

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, done.

@GrygiriiS
Copy link

And API documentation seems need to be updated to mention that domain up and running

@GrygiriiS
Copy link

Yes, it is possible, but after changing domain_create() signature, unpause is currently called inside. Are you OK if it will be made separately after AoS release? Unfortunately, it will affect some other PRs.

Well, I am not sure that we need additional parameter. This can be flag in a domain configuration structure.

I'd probably agree with @lorc here. This patch will unconditionally change current DomU start sequence from:

domain_create
domain_post_create
domain_unpause

--- to ---

domain_create
domain_unpause
domain_post_create

If it's safe - ok then. if some doubts - It'd better to add "f_noautostart" in domcfg with default f_noautostart=false. All prods now expect DomD started from static dom_cfg (and use only one static domcfg), so f_noautostart will be "false" and no changes in prods will be needed.

Copy link
Collaborator Author

@firscity firscity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks everyone for review and suggestions!

And API documentation seems need to be updated to mention that domain up and running

This hack wasn't even mentioned in function description :)

to
domain_create
domain_unpause
domain_post_create

AFAIK, this is correct sequence and should not be a problem, maybe @lorc can correct me.

Since last push:

  • removed #define DOMID_DOMD
  • added pausing flag to domain config
  • added optional -p parameter for xu create

@@ -742,14 +742,10 @@ int domain_create(struct xen_domain_cfg *domcfg, uint32_t domid)
goto stop_domain_console;
}

if (domid == DOMID_DOMD) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, done.

@GrygiriiS
Copy link

Please, the commit message for last patch "xen-shell-cmd: add optional paramenters for pausing domain on creation" should contain cmd run/test example.

And seems some spelling issues.

@firscity
Copy link
Collaborator Author

Please, the commit message for last patch "xen-shell-cmd: add optional paramenters for pausing domain on creation" should contain cmd run/test example.

Currently any of our product do not use config_name in create command. To provide valuable output for command run advanced environment required. I tested flag functionality (set and successfully triggers domain creation logic) and updated help section for xu command.

And seems some spelling issues.

Can you please clarify?

Copy link
Collaborator

@lorc lorc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/paramenters/parameters

Configure spell checker already :)

Acked-by: Volodymyr Babchuk <[email protected]>

@GrygiriiS
Copy link

Please, the commit message for last patch "xen-shell-cmd: add optional paramenters for pausing domain on creation" should contain cmd run/test example.

Currently any of our product do not use config_name in create command. To provide valuable output for command run advanced environment required. I tested flag functionality (set and successfully triggers domain creation logic) and updated help section for xu command.

Then drop it. If you can't test it without magic. And I can't test it - then drop it from this PR, please?

Otherwise, provide full cmd line test sequence results:

xu create - without "p"
xstat stat - to show dom is unpaused
[xu console] - to prove dom is working
xu destroy
xu create - with "p"
xstat stat - to show dom is paused
[xu console] - to prove dom is paused
xu unpause - to run dom
xstat stat - to show dom is unpaused
[xu console] - to prove dom is working
xu destroy

And seems some spelling issues.

Can you please clarify?

You have "paramenters" in commit subject.

@GrygiriiS
Copy link

For patches 1 & 2: Reviewed-by: Grygorii Strashko <[email protected]>

firscity added 3 commits May 15, 2024 17:30
Some hacky logic were added previously on domain creation - only
Domain-D is unpaused after domain_create(). This looks like hack, that
definitely should be removed from mainline library.

Signed-off-by: Dmytro Firsov <[email protected]>
Acked-by: Volodymyr Babchuk <[email protected]>
Reviewed-by: Grygorii Strashko <[email protected]>
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]>
Previously f_paused flag was introduced to domain configuration struct.
Add optional parameter for "xu create" command to left created domain
paused after creation.

Signed-off-by: Dmytro Firsov <[email protected]>
Acked-by: Volodymyr Babchuk <[email protected]>
@firscity firscity merged commit 7c39b56 into xen-troops:main May 15, 2024
5 checks passed
@GrygiriiS
Copy link

FYI. Last patch works not as expected. It updates dom-cfg->f_paused and this configuration can't be undone without reboot.

cfg->f_paused = false
xu create rpi_5_domu    --> unpaused
xu create rpi_5_domu -p --> paused cfg->f_paused=true
xu create rpi_5_domu    --> paused cfg->f_paused=true
xu create rpi_5_domu -p --> paused cfg->f_paused=true
xu create rpi_5_domu    --> paused cfg->f_paused=true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants