Skip to content

run_qemu: make git-qemu argument a path#17

Open
nmtadam wants to merge 1 commit intopmem:mainfrom
nmtadam:git-qemu-cl-arg
Open

run_qemu: make git-qemu argument a path#17
nmtadam wants to merge 1 commit intopmem:mainfrom
nmtadam:git-qemu-cl-arg

Conversation

@nmtadam
Copy link
Copy Markdown

@nmtadam nmtadam commented Jun 6, 2022

Remove hardcoded git-qemu path, if the argument is not provided and needed
for cxl options then set ~/git/qemu/ as the default

Signed-off-by: Adam Manzanares a.manzanares@samsung.com

Remove hardcoded git-qemu path, if the argument is not provided and needed
for cxl options then set ~/git/qemu/ as the default

Signed-off-by: Adam Manzanares <a.manzanares@samsung.com>
Comment thread run_qemu.sh
if [[ $_arg_cxl_legacy == "on" ]] || [[ $_arg_cxl == "on" ]]; then
_arg_git_qemu="on"
if [[ ! $_arg_git_qemu ]]; then
_arg_git_qemu=~/git/qemu/
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This puts us in a weird situation where ~/git/qemu is default for CXL, but there's no default outside of CXL.
Also with CXL support soon to start appearing in upstream releases, and distros thereafter, I wonder if it is time to drop the CXL special case requirement of git-qemu altogether.

Comment thread run_qemu.sh
if [[ $_arg_git_qemu ]]; then
qemu=${_arg_git_qemu}/x86_64-softmmu/qemu-system-x86_64
qemu_img=${_arg_git_qemu}/qemu-img
qmp=${_arg_git_qemu}/scripts/qmp/qmp-shell
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

So this essentially duplicates the env way of setting qemu's location -

qemu=/path/to/qemu/binary run_qemu.sh ...

--git-qemu was supposed to be a shortcut to make that default to ~/git/qemu which happened to be the path in my case :)

Now that the user base is slightly bigger, I think it makes sense to clean it all up a bit:

  1. We can convert to --git=qemu= going forward, and make ~git/qemu the default in parser_generator.m4
  2. make qemu=<path> run_qemu.sh ... behave the same way (probably already the case)
  3. Remove the special case behavior for --cxl

Thoughts on this?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Can we get rid of all of these special cases and just use the env way of setting qemu? Let's assume cxl support moving forward, and figure out a way to add a check for cxl support if --cxl is set, maybe check qemu version?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I would rather drop the environment way because environments variables are sneaky and evil :-)

While CXL support in QEMU is mainstream now, I think it would be good to keep just ONE way to override it, at the very least for testing purposes.

@stellarhopper
Copy link
Copy Markdown
Member

I forgot to add above - if --git-qemu=~/git/qemu becomes the new default, we'd need a new option to use system installed qemu. Maybe we just add a new boolean option for that, --system-qemu

Copy link
Copy Markdown
Collaborator

@marc-hb marc-hb left a comment

Choose a reason for hiding this comment

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

There are conflicts now, this needs a rebase.

Comment thread run_qemu.sh
if [[ $_arg_git_qemu ]]; then
qemu=${_arg_git_qemu}/x86_64-softmmu/qemu-system-x86_64
qemu_img=${_arg_git_qemu}/qemu-img
qmp=${_arg_git_qemu}/scripts/qmp/qmp-shell
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I would rather drop the environment way because environments variables are sneaky and evil :-)

While CXL support in QEMU is mainstream now, I think it would be good to keep just ONE way to override it, at the very least for testing purposes.

@marc-hb
Copy link
Copy Markdown
Collaborator

marc-hb commented Jan 29, 2025

I forgot to add above - if --git-qemu=~/git/qemu becomes the new default, we'd need a new option to use system installed qemu. Maybe we just add a new boolean option for that, --system-qemu

Or, even better:

 --git-qemu=my/qemu/location
 --git-qemu="" # defaults to ~/git/qemu
  (not passed  # defaults to the Linux distribution

Can "argbash" do that? For sure the shell can tell the difference between unset versus set empty when you ask nicely https://pubs.opengroup.org/onlinepubs/7990989775/xcu/chap2.html#tag_001_006_002
https://mywiki.wooledge.org/BashFAQ/083

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.

3 participants