Skip to content

Exapansion of sync-cmd#10

Open
dpsmith wants to merge 18 commits intoOpenXT:masterfrom
dpsmith:update
Open

Exapansion of sync-cmd#10
dpsmith wants to merge 18 commits intoOpenXT:masterfrom
dpsmith:update

Conversation

@dpsmith
Copy link
Copy Markdown
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 <dpsmith@apertussolutions.com>
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 <dpsmith@apertussolutions.com>
Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
This adds the a create command to the net command to allow the creation
of networks.

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
Print it so remote management can decide if an OTA is needed.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
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 <jandryuk@gmail.com>
Allow deleting USB rules.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
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 <jandryuk@gmail.com>
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 <jandryuk@gmail.com>
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 <jandryuk@gmail.com>
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 <jandryuk@gmail.com>
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 <jandryuk@gmail.com>
Set the minimum version of TLS connections for sync-cmd to TLS 1.2.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
This moves the VM deletion logic to xenmgr where the unrestricted API
may be used.

Signed-off-by: Eric Gustafson <gustafson.e.gordon@gmail.com>
Add ability to shutdown and reboot the system via sync-cmd.

Signed-off-by: Eric Gustafson <gustafson.e.gordon@gmail.com>
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 <dpsmith@apertussolutions.com>
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