-
Notifications
You must be signed in to change notification settings - Fork 20
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
dbs-cli: several refactor in cmd tool #26
Conversation
0275430
to
93af16d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @studychao! A few comments here.
README.md
Outdated
--log-file dbs-cli.log --log-level ERROR \ | ||
--kernel-path ~/path/to/kernel/vmlinux.bin \ | ||
--rootfs ~/path/to/rootfs/bionic.rootfs.ext4 \ | ||
--boot-args "console=ttyS0 console=ttyS1 earlyprintk=ttyS1 tty0 reboot=k debug panic=1 pci=off root=/dev/vda1" \ | ||
--virnets "[{\"iface_id\":\"eth0\",\"host_dev_name\":\"tap0\",\"num_queues\":2,\"queue_size\":0,\"guest_mac\":\"43:2D:9C:13:71:48\",\"allow_duplicate_mac\":true}]" \ | ||
create; | ||
; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move to previous line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done and I remove all redundant ;
README.md
Outdated
--log-file dbs-cli.log --log-level ERROR \ | ||
--kernel-path ~/path/to/kernel/vmlinux.bin \ | ||
--rootfs ~/path/to/rootfs/bionic.rootfs.ext4 \ | ||
--boot-args "console=ttyS0 console=ttyS1 earlyprintk=ttyS1 tty0 reboot=k debug panic=1 pci=off root=/dev/vda1" \ | ||
--virblks '[{"drive_id":"testblk","device_type":"RawBlock","path_on_host":"/path/to/test.img","is_root_device":false,"is_read_only":false,"is_direct":false,"no_drop":false,"num_queues":1,"queue_size":1024}]' \ | ||
create; | ||
; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
README.md
Outdated
@@ -117,9 +117,9 @@ Create hot-plug virtio-net devices via API Server: | |||
|
|||
``` | |||
sudo ./dbs-cli \ | |||
--api-sock-path [socket path] | |||
--api-sock-path [socket path] update | |||
--hotplug-virnets "[{\"iface_id\":\"eth0\",\"host_dev_name\":\"tap0\",\"num_queues\":2,\"queue_size\":0,\"guest_mac\":\"43:2D:9C:13:71:48\",\"allow_duplicate_mac\":true}]" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove \
at the end?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -129,11 +129,13 @@ Create hot-plug virtio-blk devices via API Server: | |||
|
|||
``` | |||
sudo ./dbs-cli \ | |||
--api-sock-path [socket path] | |||
--api-sock-path [socket path] update | |||
--hotplug-virblks '[{"drive_id":"testblk","device_type":"RawBlock","path_on_host":"/path/to/test.img","is_root_device":false,"is_read_only":false,"is_direct":false,"no_drop":false,"num_queues":1,"queue_size":1024}]' \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/parser/args.rs
Outdated
#[clap(long, value_parser, default_value = "dbs-cli.log", display_order = 1)] | ||
pub log_file: String, | ||
|
||
#[clap(long, value_parser, default_value = "Info", display_order = 1)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is "Debug" a better default value? The reason is that dbs-cli is a debug tool for Dragonball.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed.
README.md
Outdated
--kernel-path ~/path/to/kernel/vmlinux.bin \ | ||
--rootfs ~/path/to/rootfs/rootfs.dmg \ | ||
--boot-args "console=ttyS0 console=ttyS1 earlyprintk=ttyS1 tty0 reboot=k debug panic=1 pci=off root=/dev/vda1" create ; | ||
--boot-args "console=ttyS0 console=ttyS1 earlyprintk=ttyS1 tty0 reboot=k debug panic=1 pci=off root=/dev/vda1" ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the space at the end.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
README.md
Outdated
``` | ||
|
||
Set the log level and log file: | ||
|
||
> The log-level argument is case-insensitive: ErrOR and InFO are valid. | ||
|
||
```bash | ||
./dbs-cli \ | ||
./dbs-cli create\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
README.md
Outdated
@@ -44,12 +44,12 @@ Create a vsock console (communication with sock file) | |||
> Otherwise, `dbs-cli` will create a vsock console with a sock file, namely the value of `serial-path`. | |||
|
|||
``` | |||
./dbs-cli \ | |||
./dbs-cli create\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
README.md
Outdated
@@ -60,12 +60,12 @@ Create a virtio-vsock tunnel for Guest-to-Host communication. | |||
> specified with the `--vsock` parameter. | |||
|
|||
``` | |||
./dbs-cli \ | |||
./dbs-cli create\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
README.md
Outdated
@@ -89,13 +89,13 @@ Create virtio-blk devices. | |||
> format of JSON. | |||
|
|||
``` | |||
./dbs-cli \ | |||
./dbs-cli create\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
1. Add all creation related args under Create command and all update related args under Update command. 2. catagorize different args type to make more sense, like putting all cpu related commands under CpuArgs instead of putting them everything without order. Signed-off-by: Chao Wu <[email protected]>
93af16d
to
597ae08
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm, thanks @studychao!
Add all creation related args under Create command and all update related args under Update command.
catagorize different args type to make more sense, like putting all cpu related commands under CpuArgs instead of putting them everywhere without order.