Commit Graph

101 Commits

Author SHA1 Message Date
Jake Correnti acd2cee42c build.rs: link with library specified by LIBKRUN_EFI
Rather than hardcoding a path to the /opt/homebrew/lib directory for the
build.rs file to link with, we should use the path provided by the user
in LIBKRUN_EFI instead. If the environment variable cannot be found
because a user didn't use it, then fallback to the default path.

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2025-08-29 08:05:24 +02:00
Jake Correnti a72d3e22ff makefile: fix incremental builds
Allow incremental builds when doing make targets other than `install` or
`clean`.

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2025-08-13 09:01:21 -04:00
Jake Correnti 28f5ce8855 docs: add `--bootloader efi`
Adds the "Bootloader Configuration" section to the docs page. Additionaly, it
specifies the option is purely for vfkit parity and does not get processed by
the CLI.

Resolves: #55

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2025-08-08 14:31:11 -04:00
Jake Correnti b78153aaf4 clippy fixes
Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2025-08-01 09:35:00 +01:00
Jake Correnti eb621a5bf0 docs: add `--nested`
Document the `--nested` option in the usage page.

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2025-08-01 09:35:00 +01:00
Sergio Lopez 34a5fb44c6 Bump version to 0.2.2
Signed-off-by: Sergio Lopez <slp@redhat.com>
2025-06-24 08:58:52 -04:00
Jake Correnti 3a369eeee7 docs: add missing URI schemes
Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2025-06-10 18:43:26 -04:00
Jake Correnti 43ae636c6d Add support for `none` and `unix` URI schemes
Vfkit supports the schemes `unix` and `none` in addition to `tcp`.
Krunkit currently only implements `tcp`, so implement the remaining
schemes to meet vfkit parity.

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2025-06-10 18:43:26 -04:00
Jake Correnti bb5cb8fcd0 Add Build & Test to CI
Adds a yaml file that will build and run the latest krunkit on each pull
request.

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2025-06-10 15:48:12 -04:00
Jake Correnti 6741f2999f docs: update virtio-blk documentation
Update the documentation for the virtio-blk device to be more accurate.
The user may include 1 or more disks, where the first is the root disk
and any subsequent disks will be used as data disks. Also do not restrict
the backing image to be a raw image, as we now support QCOW2.

Resolves: #48

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2025-05-26 07:54:43 +01:00
Jake Correnti 9421c0e1da bump version to 0.2.1
Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2025-05-07 16:39:19 +02:00
Jake Correnti 8ad12c3fd1 context: check if nested virt is supported before enabling
Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2025-05-02 16:12:17 -04:00
Jake Correnti 33c46238b7 context: use env_logger crate to setup logging
Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2025-05-02 16:12:17 -04:00
Sergio Lopez db0208624e Bump version to 0.2.0
This version introduces qcow2 and nested support. Let's bump minor
to 0.2.0.

Signed-off-by: Sergio Lopez <slp@redhat.com>
2025-04-07 11:33:59 -04:00
Sergio Lopez 7281398e0d Add a cmdline flag to request nested virt
Version 1.11 of libkrun introduces support for Nested
Virtualization on macOS hosts. Let's add a flag to allow users to
request its enablement.

Signed-off-by: Sergio Lopez <slp@redhat.com>
2025-04-07 11:10:19 -04:00
Tyler Fanelli 7cf0346f2a
Merge pull request #37 from jakecorrenti/fix-linking
Add LIBKRUN_EFI to Makefile
2025-03-24 10:17:11 -04:00
Jake Correnti 52e6de4f23
Update README.md
Update the README.md to give instructions on how to build krunkit from
source assuming all necessary dependencies are installed.

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2025-03-14 10:58:15 -04:00
Jake Correnti 7fa0b10bf5
Add LIBKRUN_EFI variable
Add an LIBKRUN_EFI variable that will link the specified library with the krunkit binary.

This is only necessary for when the user has built libkrun-efi from source
or if libkrun-efi.dylib is not in /opt/homebrew/lib/.

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2025-03-14 10:58:05 -04:00
Tyler Fanelli 559160efaf
Merge pull request #39 from jakecorrenti/default-image-format
Re-write argument parsing
2025-02-28 12:08:10 -05:00
Jake Correnti 5deeea73b4
Update argument parsing in src/cmdline.rs
Updates the argument parsing in src/cmdline.rs to no longer use
`args_parse` or `val_parse`.

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2025-02-28 09:32:56 -05:00
Jake Correnti db67dcf3d7
Remove `args_parse` from src/virtio.rs
Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2025-02-28 09:32:56 -05:00
Jake Correnti 20c3384fe8
Update `virtio-gpu` argument parsing
Updates virtio-gpu to use the new helper functions

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2025-02-28 09:32:56 -05:00
Jake Correnti 7a74a551f7
Update `virtio-input` argument parsing
Updates virtio-input to use the new helper functions

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2025-02-28 09:32:56 -05:00
Jake Correnti cda0ac227f
Update `virtio-fs` argument parsing
Updates virtio-fs argument parsing to use the new helper functions

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2025-02-28 09:32:56 -05:00
Jake Correnti 53cde7cb2e
Update `virtio-vsock` argument parsing
Updates virtio-vsock argument parsing to use the new helper functions

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2025-02-28 09:32:56 -05:00
Jake Correnti 632fb2b5ea
Update `virtio-serial` argument parsing
Updates virtio-serial argument parsing to use the new helper functions

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2025-02-28 09:32:56 -05:00
Jake Correnti 292fae919e
Update `virtio-net` argument parsing
Updates virtio-net argument parsing to use new helper functions.

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2025-02-28 09:32:56 -05:00
Jake Correnti 3e9ab7bd17
Update `virtio-blk` argument parsing
Updates the argument parsing for `virtio-blk` to use new helper
functions.

Makes the `format=` argument optional and provides the default value
`raw`.

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2025-02-28 09:32:56 -05:00
Jake Correnti 23bd21ebb6
Add helper functions
Adds `parse_args`, `check_required_args`, and
`check_unknown_args`.

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2025-02-28 09:32:51 -05:00
Jake Correnti 4511f48a36 Remove krun_log_level > 5 check
Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2025-02-11 15:57:58 +01:00
Jake Correnti 4f7311c5b5 Add --krun-log-level to docs/usage.md
Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2025-02-10 17:50:11 -05:00
Jake Correnti 6da1d13702 Set default krun-log-level to INFO and fix test
Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2025-02-10 17:50:11 -05:00
Jake Correnti 47d20dd625 Fail on krun-log-level value over 5
Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2025-02-10 17:50:11 -05:00
Jake Correnti 43649d8914
Merge pull request #27 from slp/add-jake
CODEOWNERS: add Jake Correnti
2025-02-04 09:59:05 -05:00
Sergio Lopez 084c9975e1 CODEOWNERS: add Jake Correnti
Signed-off-by: Sergio Lopez <slp@redhat.com>
2025-02-04 15:44:33 +01:00
Tyler Fanelli 92431db2b0 cmdline: Add short version of required args
Signed-off-by: Tyler Fanelli <tfanelli@redhat.com>
2025-02-03 20:53:04 -05:00
Jake Correnti 271f55d363 Update virtio-blk documentation
Updates the virtio-blk documentation to specify the new `format`
arugment.

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2025-01-17 13:58:33 -05:00
Jake Correnti e3ba5192f5 Support additional image types
Link with libkrun's new `krun_add_disk2` API to allow the user to use
either a Raw or Qcow2 disk image.

Adds the `format` argument to the `virtio-blk` device.

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2025-01-17 13:58:33 -05:00
Sergio Lopez 52f65e19a2 Bump version to 0.1.4
Signed-off-by: Sergio Lopez <slp@redhat.com>
2024-11-14 15:22:31 +01:00
Sergio Lopez 2965c47c55 Make krun_log_level optional
Signed-off-by: Sergio Lopez <slp@redhat.com>
2024-11-14 15:21:02 +01:00
Sergio Lopez ce48e7c9f5 Limit RAM+VRAM to avoid exceeding IPA addressing
Automatically adjust VRAM so VRAM+RAM doesn't exceed the space
available in a 36 bit IPA, accounting for the start address and
rounding in libkrun, which sets an upper limit of ~62GiB.

Also, reject a memory configuration larger than 60 GiB to ensure
we leave some room for VRAM.

Fixes: #17

Signed-off-by: Sergio Lopez <slp@redhat.com>
2024-11-04 22:05:56 -05:00
Sergio López 8e16224b1f
Merge pull request #18 from slp/krun-log-level
Allow setting up libkrun log level
2024-11-04 16:48:12 +01:00
Sergio Lopez 2decb12537 Allow setting up libkrun log level
Add the "krun-log-level" flag for setting up the desired log level
for libkrun's debug facilities.

Signed-off-by: Sergio Lopez <slp@redhat.com>
2024-11-04 11:19:29 +01:00
Sergio Lopez dcbe3c450d Bump version to 0.1.3
Signed-off-by: Sergio Lopez <slp@redhat.com>
2024-10-01 09:27:00 -04:00
Sergio Lopez 4dab024a5f context: set SHM window to be as large as the host's RAM
On version 1.9.5 libkrun introduced an API to set the size of the
SHM window for virtio-gpu. Use it to set it to be as large as the
host's RAM. This should give us enough room for running large
models, accounting for potential device memory fragmentation.

Signed-off-by: Sergio Lopez <slp@redhat.com>
2024-10-01 09:27:00 -04:00
Sergio Lopez 153aab4850 virtio: use krun_add_disk for virtio-blk disks
Use the new krun_add_disk API, introduced in libkrun 1.9.5, to be
able to add an arbitrary number of virtio-blk devices.

Signed-off-by: Sergio Lopez <slp@redhat.com>
2024-10-01 09:27:00 -04:00
Sergio López 29f5adafe1
Merge pull request #14 from tylerfanelli/vcpu_max
context: Add max vCPU check
2024-07-18 08:29:07 +02:00
Tyler Fanelli 377c03293c Update to 0.1.2
Signed-off-by: Tyler Fanelli <tfanelli@redhat.com>
2024-07-17 12:56:11 -04:00
Tyler Fanelli cfe1de26c8 context: Add max vCPU check
Signed-off-by: Tyler Fanelli <tfanelli@redhat.com>
2024-07-17 12:55:22 -04:00
Sergio López 2d3599dadc
Merge pull request #12 from slp/create-release
Add script to automate creating releases for podman and bump version to 0.1.1
2024-06-24 13:12:16 +02:00