Skip to content

Add scp subcommand to ephemeral and libvirt#277

Open
cgwalters wants to merge 1 commit into
bootc-dev:mainfrom
cgwalters:libvirt-scp
Open

Add scp subcommand to ephemeral and libvirt#277
cgwalters wants to merge 1 commit into
bootc-dev:mainfrom
cgwalters:libvirt-scp

Conversation

@cgwalters
Copy link
Copy Markdown
Collaborator

Since we offer ssh, we should absolutely offer scp. I had an agent try to hack this by piping to ssh and try to base64 encode things.

Motivated by simple use cases like "copy out a log file" or "copy in a new bootc binary" (though that one is better with a sysext flow, but that's a whole other concern).

Assisted-by: pi (Sonnet 4.6 + Gemini 3.5 Flash)

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces SCP file transfer support for both ephemeral and libvirt domains via a new scp subcommand, complete with CLI options, execution logic, and integration tests. The reviewer provided constructive feedback recommending that the libvirt SCP command enforce that exactly one path uses the DOMAIN: prefix (matching the ephemeral SCP validation) and that the SCP command execution use .status() instead of .output() to allow real-time progress reporting during file transfers.

Comment thread crates/kit/src/libvirt/scp.rs Outdated
Comment thread crates/kit/src/libvirt/scp.rs Outdated
Comment thread crates/kit/src/libvirt/scp.rs Outdated
Comment thread crates/kit/src/libvirt/scp.rs Outdated
cgwalters added a commit to cgwalters/bcvk-fork that referenced this pull request May 28, 2026
- Use domain: (lowercase) prefix consistently in doc strings, error
  messages, and examples instead of DOMAIN:, matching conventional CLI
  style.
- Fix validation to reject both "neither is remote" and "both are remote"
  by using source_is_remote == dest_is_remote; previously only the first
  case was caught.
- Replace .output() with .status() for the final scp invocation so
  stdout/stderr stream to the terminal in real time rather than being
  buffered and printed after the fact.
- Extract the SSH readiness retry loop into a shared free function
  wait_for_ssh_ready() in ssh.rs, removing the near-identical duplicate
  in scp.rs.

Assisted-by: OpenCode (Claude Sonnet 4.6)
@cgwalters cgwalters force-pushed the libvirt-scp branch 3 times, most recently from d641d35 to 396d0fa Compare May 28, 2026 14:28
Since we offer `ssh`, we should absolutely offer `scp`. I had
an agent try to hack this by piping to ssh and try to base64
encode things.

Motivated by simple use cases like "copy out a log file"
or "copy in a new bootc binary" (though that one is better
with a sysext flow, but that's a whole other concern).

The libvirt implementation validates that exactly one of source
or destination uses the `domain:` prefix, uses `.status()` so
scp progress streams to the terminal in real time, and shares
the SSH readiness retry loop with the `ssh` subcommand via a
`wait_for_ssh_ready()` helper.

Assisted-by: OpenCode (Claude Sonnet 4.6)
Signed-off-by: Colin Walters <walters@verbum.org>
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