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

Exapansion of sync-cmd #10

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open

Exapansion of sync-cmd #10

wants to merge 18 commits into from

Conversation

dpsmith
Copy link
Member

@dpsmith dpsmith commented Jun 7, 2023

This PR expands the capabilities of sync-cmd to provide a richer set of commands to manage an OpenXT device. To enable some of the functionality, additional rpc-proxy rules need to be added to the syncvm. These can be added, as desired, to the syncvm's domain configuration as to not have to add them to the global rpc-proxy.rules file installed in /etc.

To assist in its usage, there is a manpage included. It is not installed by the setup.py script and currently no plan to install it with the sync-client OE recipe.

dpsmith and others added 17 commits June 5, 2023 07:10
This adds the ability to create vms via the
`unrestricted_create_vm_with_template_and_json` method of xenmgr's unrestricted
interface. This will create a vm based on one of the vm templates stored in
Dom0 while also applying the contents of a JSON file as the vm's configuration.
The JSON file must follow the same conventions as a vm config file stored in
/config/vms.

Signed-off-by: Daniel P. Smith <[email protected]>
This commit adds the ability to list, inspect (aka show), and add USB policy
rules to the USB Daemon.

Signed-off-by: Daniel P. Smith <[email protected]>
This adds the a create command to the net command to allow the creation
of networks.

Signed-off-by: Daniel P. Smith <[email protected]>
Print it so remote management can decide if an OTA is needed.

Signed-off-by: Jason Andryuk <[email protected]>
A bug in column_print resulted in `TypeError: object of type
'dbus.Int32' has no len()`.

Change col to a string so we can use string operations.

Signed-off-by: Jason Andryuk <[email protected]>
Allow deleting USB rules.

Signed-off-by: Jason Andryuk <[email protected]>
Add ctrl-D support by implementing do_EOF.  It exits to one level up
when called, which exits the program from the top level.

Signed-off-by: Jason Andryuk <[email protected]>
VM Names can have spaces, so try to support that.  The xenmgr commands
can just pass the whole strings.  Commands like ~sync-cmd Windows 10
disks` are trickier.

Because of how cmd.py works, we just have a flat string.  Quotes at
invocation time `sync-cmd vm "Windows 10" disks` don't make it through
cmd.py.  We can heuristically parse the names out though.

Through introspection, we can get all valid command names.  Search for a
space prefixed " command" - since the command can't be first, it has to
be prefixed.  If found we can strip the remainder as the command string
and search for the space-containing name.

This means VmCmd has to tuck away the cmd_str for SyncCmd to recover.
This is icky, but it will do the trick.

Signed-off-by: Jason Andryuk <[email protected]>
The `net create` expects to consume 3 args, but incorrectly checks that
only one arg is passed. Additionally net_num needs to be an int, and
only wired takes a mac in config, which needs to be prefixed "mac=".

To enhance the command, reformat output from:
    Created:
        /wired/5/bridged
        /wired/5/shared

        /internal/5

        /any/5
to:
    Created:
        /wired/5/bridged
        /wired/5/shared
        /internal/5
        /any/5

Signed-off-by: Jason Andryuk <[email protected]>
The vusb-daemon only supports UUIDs for its policy checking.  However
nothing there or in sync-cmd enforces them.  They could populate dbd,
but could never be matched.  Have sync-cmd lookup uuids and send those.
Non-existant but validly formed UUIDs are passed through at this time.

Signed-off-by: Jason Andryuk <[email protected]>
sync-cmd usb set cannot currently handle spaces in the desc command.
cmd.py is passing in a string, and it doesn't seem possible to get
quotes down into the string.  At least not in any sensible way.

Parse the string in a custom fashion from back to front.  That lets
everything trailing the = to become the "value" and spaces can be
handled.

Signed-off-by: Jason Andryuk <[email protected]>
Set the minimum version of TLS connections for sync-cmd to TLS 1.2.

Signed-off-by: Jason Andryuk <[email protected]>
This moves the VM deletion logic to xenmgr where the unrestricted API
may be used.

Signed-off-by: Eric Gustafson <[email protected]>
Add ability to shutdown and reboot the system via sync-cmd.

Signed-off-by: Eric Gustafson <[email protected]>
Add a new doc folder to hold documentation and initially populate it
with a man page for sync-cmd. The man page is rendered from Markdown
using pandoc.

Signed-off-by: Daniel P. Smith <[email protected]>
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.

2 participants