profile
viewpoint

rust-vmm/vm-virtio 58

virtio implementation

slp/gameboid 46

Gameboy Advance emulator for Android phones

slp/android-smarterwifi 9

Kismet's Android Smarter Wi-Fi Manager with a hack for autodisabling Bluetooth

slp/apodsmon 7

A Linux CLI utility for checking the AirPods battery level

slp/erouska-android 7

Bluetooth Tracing for Android

slp/hellokvm 6

Minimal (under 100 lines!) example of a KVM monitor.

slp/awesome-hamster 5

Bridge between Hamster Time Tracker and Awesome WM

slp/covid-tracker-poc 2

COVID tracker PoC for Android

pull request commentcontainers/crun

container: add support for libkrun

@slp @rhatdan are you fine with the crun API for using libkrun?

@giuseppe LGTM. 👍

giuseppe

comment created time in an hour

PR opened cloud-hypervisor/vhost-user-backend

Switch to using rust-vmm's vhost and vm-virtio

These commits allows vhost-user-backend to switch to rust-vmm's vhost and vm-virtio crates. I've tried to keep the changes at minimal as possible.

There's only one change in the API, which is that the update_memory method from the VhostUserBackend crate now receives an GuestMemoryMmap wrapped within a GuestMemoryAtomic.

+28 -16

0 comment

2 changed files

pr created time in 4 days

create barnchslp/vhost-user-backend

branch : rustvmm-crates

created branch time in 4 days

push eventslp/vm-virtio

Sergio Lopez

commit sha 03cacffbe28e72ff0d3ee8efbe1eed03d4550025

Update CODEOWNERS Add @alexandruag, @jiangliu and myself (@slp) to CODEOWNERS, to be automatically assigned as code reviewers, and remove 'gatekeeper-PullAssigner'. Signed-off-by: Sergio Lopez <slp@redhat.com>

view details

Alexandru Agache

commit sha 40f8b2f9449c178be07dfef51882ecacd7c62b09

update the rust-vmm-ci anchor The following commits are included: e58ea74 Fix kcov_ouput_dir typo in test_coverage.py d62d781 fix buildkite typos in readme 0fc8ced refactor test_benchmark.py 741b894 checkout to PR branch before finishing test_bench 645a5c3 test_bench: don't crash when no bench on master bd32544 Fetch origin in benchmark test 35beb91 Fix commit message test 53427aa benchmarks: add test that can run at every PR abd2c90 Add test for commit message format fe859f4 Update container image to v6 75d7254 run cargo check on all features 7e3f307 skip coverage-arm test Also updated the coverage score. Signed-off-by: Alexandru Agache <aagch@amazon.com>

view details

Alexandru Agache

commit sha 26f037fb3b0645fe2094951b740ccb5499d3dbe1

add simple bench Signed-off-by: Alexandru Agache <aagch@amazon.com>

view details

Alexandru Agache

commit sha a83152da14554cf810f672f6f4079e943fe6ce28

simplify descriptor chain handling Removed `DescriptorChain::is_indirect()`. Also updated coverage score. Signed-off-by: Alexandru Agache <aagch@amazon.com>

view details

Sergio Lopez

commit sha 9a4fd6ffe245ccc0ef500096e0b60fe00e6ab690

queue: add getter/setter for next_avail The vhost-user protocol includes the VHOST_USER_GET_VRING_BASE and VHOST_USER_SET_VRING_BASE for getting and setting the index for the next descriptor in the available ring. To support those messages in vhost-user-backend, we need access to Queue::next_avail. Signed-off-by: Sergio Lopez <slp@redhat.com>

view details

Sergio Lopez

commit sha b23baac86d7aa5987af88096462cb5f41e1aea9a

queue: derive Clone for DescriptorChain Being able to clone DescriptorChain is useful for implementing readers and writers for data descriptors. Signed-off-by: Sergio Lopez <slp@redhat.com>

view details

push time in 4 days

PR opened rust-vmm/vm-virtio

Reviewers
Add setter/getter for Queue::next_avail and derive Clone for DescriptorChain

Add setter/getter for Queue::next_avail and derive Clone for DescriptorChain. These changes enable crates such as vhost-user-backend and vhost-user-fs to start using this crate.

+11 -0

0 comment

1 changed file

pr created time in 4 days

create barnchslp/vm-virtio

branch : vhost-user-sup

created branch time in 4 days

PullRequestReviewEvent

pull request commentrust-vmm/vm-virtio

Simple initial benchmark and descriptor handling simplifications

Also, I was wondering, do ppl think the DescriptorChain::is_indirect method is useful? I would remove it otherwise, just to try and keep things as simple as possible.

I've checked the crates I'm familiar with, and the only one I found using it is vhost-user-fs, but that's because it's using the old DescriptorChain::new_from_indirect method. Once it's migrated to rust-vmm/vm-virtio, it no longer needs that.

So I'm fine with dropping it. We can always add it later if necessary.

alexandruag

comment created time in 5 days

push eventslp/libkrun

Sergio Lopez

commit sha e9075d5e66f7a7174c19d49fc51669f432ea3536

Revert "ci: Run the unit tests on each PR" This reverts commit ee78b71a71661c30fb27d8c9b6830fbaf3de7bf3.

view details

Sergio Lopez

commit sha 45eeb30bd5b4290f05db12ee4e3077cfe2b8fc14

ci: Run unit tests on Cirrus-CI Run unit tests on a KVM-enabled container on Cirrus-CI. Signed-off-by: Sergio Lopez <slp@redhat.com>

view details

Sergio Lopez

commit sha 25b4febbc7175a7c3a6ac5ce6303e98f1cc685a1

libkrun: Refactor the API to make it future-proof Refactor the public C API to add versioning and make it more granular, so we can extend it without breaking existing users. Signed-off-by: Sergio Lopez <slp@redhat.com>

view details

Sergio Lopez

commit sha d7767ab546d5a26f29826434c2546835b72d6a4c

Merge pull request #5 from slp/api_refactor libkrun: Refactor the API to make it future-proof

view details

Sergio Lopez

commit sha 95ae0028edc6dcfd0d20094f9e5454ed7a3ac97f

libkrun: Make "args" an array of string pointers krun_set_exec needed the arguments to be passed as a collapsed string, which is not what people will probably expect. Replace both the arguments and the environment lines and use an array of string pointers instead, just as 'execve(2)' does. Signed-off-by: Sergio Lopez <slp@redhat.com>

view details

Sergio Lopez

commit sha ad5b67f7deba9b2891ed0f1e4f96bd47f8bfbe14

Merge pull request #6 from slp/args_as_array libkrun: Make "args" an array of string pointers

view details

push time in 6 days

pull request commentcontainers/crun

container: add support for libkrun

@giuseppe I've updated the API to make krun_set_exec receive an array of string pointers for both the arguments and the environment variables lists, in the same fashion as execve(2) does.

This implies a couple of changes in this PR, basically updating the signature for krun_set_exec and passing &argv[1] instead of argv[1], but I think it's worth it.

giuseppe

comment created time in 6 days

delete branch slp/libkrun

delete branch : args_as_array

delete time in 6 days

push eventcontainers/libkrun

Sergio Lopez

commit sha 95ae0028edc6dcfd0d20094f9e5454ed7a3ac97f

libkrun: Make "args" an array of string pointers krun_set_exec needed the arguments to be passed as a collapsed string, which is not what people will probably expect. Replace both the arguments and the environment lines and use an array of string pointers instead, just as 'execve(2)' does. Signed-off-by: Sergio Lopez <slp@redhat.com>

view details

Sergio Lopez

commit sha ad5b67f7deba9b2891ed0f1e4f96bd47f8bfbe14

Merge pull request #6 from slp/args_as_array libkrun: Make "args" an array of string pointers

view details

push time in 6 days

PR merged containers/libkrun

libkrun: Make "args" an array of string pointers

krun_set_exec needed the arguments to be passed as a collapsed string, which is not what people will probably expect. Replace both the arguments and the environment lines and use an array of string pointers instead, just as 'execve(2)' does.

Signed-off-by: Sergio Lopez slp@redhat.com

+49 -46

0 comment

3 changed files

slp

pr closed time in 6 days

push eventslp/libkrun

Sergio Lopez

commit sha 95ae0028edc6dcfd0d20094f9e5454ed7a3ac97f

libkrun: Make "args" an array of string pointers krun_set_exec needed the arguments to be passed as a collapsed string, which is not what people will probably expect. Replace both the arguments and the environment lines and use an array of string pointers instead, just as 'execve(2)' does. Signed-off-by: Sergio Lopez <slp@redhat.com>

view details

push time in 6 days

PR opened containers/libkrun

libkrun: Make "args" an array of string pointers

krun_set_exec needed the arguments to be passed as a collapsed string, which is not what people will probably expect. Replace both the arguments and the environment lines and use an array of string pointers instead, just as 'execve(2)' does.

Signed-off-by: Sergio Lopez slp@redhat.com

+49 -46

0 comment

3 changed files

pr created time in 6 days

create barnchslp/libkrun

branch : args_as_array

created branch time in 6 days

pull request commentrust-vmm/vm-virtio

Add myself to CODEOWNERS

Based on @andreeaflorescu 's input, I've updated the PR to remove gatekeeper-PullAssigner and add @jiangliu, @alexandruag and myself as codeowners.

slp

comment created time in 6 days

push eventslp/vm-virtio

Sergio Lopez

commit sha d2ca8b6d612be4c0e24f86ba591ead71c6c73ebe

Update CODEOWNERS Add @alexandruag, @jiangliu and myself (@slp) to CODEOWNERS, to be automatically assigned as code reviewers, and remove 'gatekeeper-PullAssigner'. Signed-off-by: Sergio Lopez <slp@redhat.com>

view details

push time in 6 days

pull request commentrust-vmm/vm-virtio

Add myself to CODEOWNERS

Could you please help to add several more code owners? I recommend myself as one:)

Sure, in fact I was keeping gatekeeper-PullAssigner (though I'm not sure which users does that option bring). I think someone else also volunteered as reviewer. I think it was @sameo ?

slp

comment created time in 6 days

startedrust-vmm/vhost

started time in 6 days

startedrust-vmm/vm-virtio

started time in 6 days

startedrust-vmm/vm-memory

started time in 6 days

PR opened rust-vmm/vm-virtio

Add myself to CODEOWNERS

Add myself (@slp in GitHub) to CODEOWNERS, to be automatically assigned as code reviewer.

Signed-off-by: Sergio Lopez slp@redhat.com

+1 -1

0 comment

1 changed file

pr created time in 6 days

create barnchslp/vm-virtio

branch : codeowners

created branch time in 6 days

fork slp/vm-virtio

virtio implementation

fork in 6 days

PullRequestReviewEvent
PullRequestReviewEvent

pull request commentcontainers/crun

container: add support for libkrun

moved to ready for review.

One issue I am seeing is with the nginx image, the port is not accessible when running with krun:

Seems like nginx doesn't like some aspect of the s2vi (socket-2-vsock impersonation) mechanism, which is not surprising. I'll debug it later this week. The simple HTTP server embedded into python (python3 -m http.server --bind 0.0.0.0) seems to work fine.

If I don't specify a different command sh, the container exits immediately

This happens because krun_set_exec expects args to be a collapsed string from every argument, instead of a array of string pointers, to avoid doing that in Rust. Now I see this is clearly counterintuitive, so given that we're still in time to fix this in libkrun's public API, I'm going to do it there.

giuseppe

comment created time in 8 days

pull request commentcontainers/crun

container: add support for libkrun

rebased on top of the new API.

@slp, if we can consider the API "stable" I am fine with merging this PR, as anyway it is enabled via a configure option (disabled by default)

@giuseppe Yes, this API will be stable. New functionality will be added as new symbols.

It'd be great to have this merged. As soon it's there, I'll create a COPR repo with crun (installed on a different location) and libkrun so people can easily give it a try.

giuseppe

comment created time in 8 days

fork slp/vhost-user-backend

vhost-user backend Rust crate

fork in 11 days

issue commentrust-vmm/community

Crate Addition Request: vhost-user-backend

I would like to see the version of the code in cloud-hypervisor ported to rust-vmm vm-virtio before it is split out. Otherwise we will end up with another divergent repository.

I can create a draft (we're still missing https://github.com/rust-vmm/vm-virtio/pull/21 and deriving Clone for DescriptorChain) PR in cloud-hypervisor/vhost-user-backend to discuss the changes over there.

slp

comment created time in 12 days

issue commentrust-vmm/community

Crate Addition Request: vhost-user-backend

@slp we are now creating all new repositories using the crate-template: https://github.com/rust-vmm/crate-template

If I also create this repository from the template, I am not sure if you'll then be able to add a PR with the commits from the existing code in Cloud Hypervisor. There might be some conflicts that you'll need to fix manually. Are you okay with that? Or should I just create an empty repository?

Yes, let's go with the template and I'll try to rebase the commit history without generating too much noise. Worst case scenario, we can always remove the repo and recreate it empty.

slp

comment created time in 12 days

delete branch slp/libkrun

delete branch : api_refactor

delete time in 13 days

push eventcontainers/libkrun

Sergio Lopez

commit sha 25b4febbc7175a7c3a6ac5ce6303e98f1cc685a1

libkrun: Refactor the API to make it future-proof Refactor the public C API to add versioning and make it more granular, so we can extend it without breaking existing users. Signed-off-by: Sergio Lopez <slp@redhat.com>

view details

Sergio Lopez

commit sha d7767ab546d5a26f29826434c2546835b72d6a4c

Merge pull request #5 from slp/api_refactor libkrun: Refactor the API to make it future-proof

view details

push time in 13 days

PR merged containers/libkrun

libkrun: Refactor the API to make it future-proof

Refactor the public C API to add versioning and make it more granular, so we can extend it without breaking existing users.

Signed-off-by: Sergio Lopez slp@redhat.com

+343 -125

0 comment

5 changed files

slp

pr closed time in 13 days

pull request commentcontainers/crun

container: add support for libkrun

@giuseppe Done! PTAL, thanks! https://github.com/containers/libkrun/blob/5ecfa5caf97663350ffea3fae8d1b0adaa6e0a8d/include/libkrun.h

thanks!

Just one suggestion: do you think int32_t krun_create_ctx(...); should create the context_id itself? So tht the context_id is the return value instead of accepting it as input.

For API completeness, even if a NO-OP for now, could we have a krun_free_ctx(..)?

Done and done, PTAL, thanks! :-)

giuseppe

comment created time in 13 days

issue commentrust-vmm/community

Crate Addition Request: vhost-user-backend

+1 on creating the repository.

This would be based on Cloud Hypervisor's vhost-user-backend. It requires some refactoring as rust-vmm's vm-virtio::Queue lifetime is linked to a GuestMemory instance, so we need to decouple the VringWorker from the VhostUserBackend, but I already have a set of commits doing that. I think we can start by importing the repository as is, and then improving on it.

It looks like the repository in Cloud Hypervisor has a git referenced dependency on a vm-virtio fork from CH. Maybe we can add the required changes in rust-vmm/vm-virtio, so that the dependency is not needed anymore. We can discuss this on the PR that introduces the code though :D

Yes, I have some commits here to make vhost-user-backend use rust-vmm/vm-virtio instead.

BTW, how many approvals are needed for greenlighting the creation of the repository?

slp

comment created time in 13 days

push eventslp/libkrun

Sergio Lopez

commit sha 25b4febbc7175a7c3a6ac5ce6303e98f1cc685a1

libkrun: Refactor the API to make it future-proof Refactor the public C API to add versioning and make it more granular, so we can extend it without breaking existing users. Signed-off-by: Sergio Lopez <slp@redhat.com>

view details

push time in 13 days

pull request commentrust-vmm/vm-virtio

[RFC] Simple initial benchmark and descriptor handling simplifications

Thanks for the review! I totally acknowledge that microbenchmarks are not necessarily representative of real-world performance, but at the same time they provide useful data points and help identify potential issues early. We should build more realistic integration harnesses as well when additional components become available.

In an ideal world, we should have a test matrix with multiple VMMs and vhost-user device implementations (both in Rust and in C), to be able to get meaningful, comparable numbers. But that would require dedicated bare-metal hardware, which I guess would imply the need for some kind of sponsorship.

But that's definitely outside the scope of this PR ;-) I'll be in favor of transitioning this one from RFC to formal patch once https://github.com/rust-vmm/vm-virtio/pull/21 is merged and this is rebased on it.

alexandruag

comment created time in 14 days

Pull request review commentrust-vmm/vm-virtio

[RFC] Simple initial benchmark and descriptor handling simplifications

 pub struct DescriptorChain<M: GuestAddressSpace> {     mem: M::T,     desc_table: GuestAddress,     queue_size: u16,-    ttl: u16, // used to prevent infinite chain cycles--    /// The current descriptor-    desc: Descriptor,-    curr_indirect: Option<Box<DescriptorChain<M>>>,-    is_master: bool,+    next_index: u16,+    ttl: u16,+    is_indirect: bool, }  impl<M: GuestAddressSpace> DescriptorChain<M> {-    fn read_new(+    fn with_ttl(         mem: M::T,         desc_table: GuestAddress,         queue_size: u16,         ttl: u16,         index: u16,-    ) -> Option<Self> {-        if index >= queue_size {-            return None;-        }--        let desc_size = size_of::<Descriptor>();-        let desc_addr = desc_table.checked_add(desc_size as u64 * index as u64)?;-        let desc = mem.read_obj(desc_addr).ok()?;-        let chain = DescriptorChain {+    ) -> Self {+        DescriptorChain {             mem,             desc_table,             queue_size,+            next_index: index,             ttl,-            desc,-            curr_indirect: None,-            is_master: true,-        };--        if chain.is_valid() {-            Some(chain)-        } else {-            None+            is_indirect: false,         }     } -    /// Create a new DescriptorChain instance.-    fn checked_new(-        mem: M::T,-        dtable_addr: GuestAddress,-        queue_size: u16,-        index: u16,-    ) -> Option<Self> {-        Self::read_new(mem, dtable_addr, queue_size, queue_size, index)+    /// Create a new `DescriptorChain` instance.+    fn new(mem: M::T, desc_table: GuestAddress, queue_size: u16, index: u16) -> Self {

Makes sense to me. It's cleaner and I don't see any significant drawbacks. It most situations you already need to pass the --all-features flag anyways.

alexandruag

comment created time in 14 days

PullRequestReviewEvent

Pull request review commentrust-vmm/vm-virtio

Implement Queue::index() and Queue::has_next()

 impl<M: GuestAddressSpace> DescriptorChain<M> {      /// Checks if this descriptor chain has another descriptor chain linked after it.     pub fn has_next(&self) -> bool {-        self.desc.flags & VIRTQ_DESC_F_NEXT != 0 && self.ttl > 1+        self.has_next || self.curr_indirect.is_some()

I'd say the common use case for DescriptorChain is to simply iterate over it, so DescriptorChain::has_next may be redundant or even confusing, as it doesn't guarantee that next() will return something, as you said.

That said, if there's a use case for it (perhaps as a hint for an optimization?), I think we can keep it as long it's clearly stated in the documentation it's return value should only be used as a hint.

jiangliu

comment created time in 14 days

PullRequestReviewEvent

issue openedrust-vmm/vm-virtio

Where to obtain the descriptor index for Queue::add_used

After commit 904662c3830b6df303d1c15108d96df395011b6c (@bonzini) removed the field index from DescriptorChain, I can't find a way to obtain the index from the last processed descriptor to pass it to Queue::add_used. Am I missing something or do we need that field back?

created time in 15 days

Pull request review commentrust-vmm/vm-virtio

[RFC] Simple initial benchmark and descriptor handling simplifications

 pub struct DescriptorChain<M: GuestAddressSpace> {     mem: M::T,     desc_table: GuestAddress,     queue_size: u16,-    ttl: u16, // used to prevent infinite chain cycles--    /// The current descriptor-    desc: Descriptor,-    curr_indirect: Option<Box<DescriptorChain<M>>>,-    is_master: bool,+    next_index: u16,+    ttl: u16,+    is_indirect: bool, }  impl<M: GuestAddressSpace> DescriptorChain<M> {-    fn read_new(+    fn with_ttl(         mem: M::T,         desc_table: GuestAddress,         queue_size: u16,         ttl: u16,         index: u16,-    ) -> Option<Self> {-        if index >= queue_size {-            return None;-        }--        let desc_size = size_of::<Descriptor>();-        let desc_addr = desc_table.checked_add(desc_size as u64 * index as u64)?;-        let desc = mem.read_obj(desc_addr).ok()?;-        let chain = DescriptorChain {+    ) -> Self {+        DescriptorChain {             mem,             desc_table,             queue_size,+            next_index: index,             ttl,-            desc,-            curr_indirect: None,-            is_master: true,-        };--        if chain.is_valid() {-            Some(chain)-        } else {-            None+            is_indirect: false,         }     } -    /// Create a new DescriptorChain instance.-    fn checked_new(-        mem: M::T,-        dtable_addr: GuestAddress,-        queue_size: u16,-        index: u16,-    ) -> Option<Self> {-        Self::read_new(mem, dtable_addr, queue_size, queue_size, index)+    /// Create a new `DescriptorChain` instance.+    fn new(mem: M::T, desc_table: GuestAddress, queue_size: u16, index: u16) -> Self {

Slightly unrelated, but it'd be nice to have a public function for building a DescriptorChain, so other crates can make use of it for their own unit tests.

alexandruag

comment created time in 15 days

PullRequestReviewEvent
PullRequestReviewEvent

issue openedrust-vmm/community

Crate Addition Request: vhost-user-backend

Crate Name

vhost-user-backend

Short Description

vhost-user-backend extends vhost implementing the common infrastructure required by vhost-user devices. It provides the VhostUserBackend trait, that must be implemented by crates providing a device personality, and a multi-thread VringWorker to abstract low-level queue operations from the upper layers.

This would be based on Cloud Hypervisor's vhost-user-backend. It requires some refactoring as rust-vmm's vm-virtio::Queue lifetime is linked to a GuestMemory instance, so we need to decouple the VringWorker from the VhostUserBackend, but I already have a set of commits doing that. I think we can start by importing the repository as is, and then improving on it.

Why is this crate relevant to the rust-vmm project?

This is the final piece needed (with the others being vhost, vm-virtio and vm-memory) in rust-vmm to provide a common framework for writing vhost-user device in Rust.

created time in 15 days

push eventslp/libkrun

Sergio Lopez

commit sha 3a16a97ac302c8b4c4ae8403e7456baafcb78cc5

libkrun: Refactor the API to make it future-proof Refactor the public C API to add versioning and make it more granular, so we can extend it without breaking existing users. Signed-off-by: Sergio Lopez <slp@redhat.com>

view details

push time in 19 days

push eventcontainers/libkrun

Sergio Lopez

commit sha 45eeb30bd5b4290f05db12ee4e3077cfe2b8fc14

ci: Run unit tests on Cirrus-CI Run unit tests on a KVM-enabled container on Cirrus-CI. Signed-off-by: Sergio Lopez <slp@redhat.com>

view details

push time in 19 days

push eventslp/libkrun

Sergio Lopez

commit sha 4a0f8770e2a5d152a9ec2c9970fcf9642d66fa2d

libkrun: Refactor the API to make it future-proof Refactor the public C API to add versioning and make it more granular, so we can extend it without breaking existing users. Signed-off-by: Sergio Lopez <slp@redhat.com>

view details

push time in 19 days

push eventcontainers/libkrun

Sergio Lopez

commit sha 6a28a4ac6ce9084a5c5f70f3b35078cc522fde34

ci: Run unit tests on Cirrus-CI Run unit tests on a KVM-enabled container on Cirrus-CI. Signed-off-by: Sergio Lopez <slp@redhat.com>

view details

push time in 19 days

push eventslp/libkrun

Sergio Lopez

commit sha ebd80879139b305f739b13f2ab39c8c597e0ee11

libkrun: Refactor the API to make it future-proof Refactor the public C API to add versioning and make it more granular, so we can extend it without breaking existing users. Signed-off-by: Sergio Lopez <slp@redhat.com>

view details

push time in 19 days

push eventcontainers/libkrun

Sergio Lopez

commit sha cd18ee45cb16228f13015d4aedb2a15681d77667

ci: Run unit tests on Cirrus-CI Run unit tests on a KVM-enabled container on Cirrus-CI. Signed-off-by: Sergio Lopez <slp@redhat.com>

view details

push time in 19 days

push eventslp/libkrun

Sergio Lopez

commit sha 58ca578ee12d846a1cb004a935d3ddfa675bd83c

libkrun: Refactor the API to make it future-proof Refactor the public C API to add versioning and make it more granular, so we can extend it without breaking existing users. Signed-off-by: Sergio Lopez <slp@redhat.com>

view details

push time in 19 days

push eventcontainers/libkrun

Sergio Lopez

commit sha 4c39686f0569b732b4d055489dfa0af974876efc

ci: Run unit tests on Cirrus-CI Run unit tests on a KVM-enabled container on Cirrus-CI. Signed-off-by: Sergio Lopez <slp@redhat.com>

view details

push time in 19 days

push eventslp/libkrun

Sergio Lopez

commit sha 1057c924c29ec39dea2368a16c7e0a78a13b10dd

libkrun: Refactor the API to make it future-proof Refactor the public C API to add versioning and make it more granular, so we can extend it without breaking existing users. Signed-off-by: Sergio Lopez <slp@redhat.com>

view details

push time in 19 days

push eventcontainers/libkrun

Sergio Lopez

commit sha 660456a3d9397b0a40017804880a1cf686aee287

ci: Run unit tests on Cirrus-CI Run unit tests on a KVM-enabled container on Cirrus-CI. Signed-off-by: Sergio Lopez <slp@redhat.com>

view details

push time in 19 days

push eventslp/libkrun

Sergio Lopez

commit sha 934df79c0cd6d03d7c91d6f75c9350160eacd05c

ci: Run unit tests on Cirrus-CI Run unit tests on a KVM-enabled container on Cirrus-CI. Signed-off-by: Sergio Lopez <slp@redhat.com>

view details

push time in 19 days

push eventslp/libkrun

Sergio Lopez

commit sha 481fc259816c5139e94978f9c736b2f219e69e0e

ci: Add a step for creating a fake init file Add a step in the code quality check to create a fake init file, so it won't clippy won't bail out. Signed-off-by: Sergio Lopez <slp@redhat.com>

view details

Sergio Lopez

commit sha 13a10f9d9ad7c051fc26d0f60da0874097d664fa

src: Switch to rust-vmm/vm-memory Now that build_raw support has been merged into rust-vmm/vm-memory, switch to it. Once released we'll be able to switch from git to crate+version reference. Signed-off-by: Sergio Lopez <slp@redhat.com>

view details

Sergio Lopez

commit sha 50cbe84b871a8f21b43c34774410aff6a16e9c8e

Merge pull request #3 from slp/rustvmm_vm-memory src: Switch to rust-vmm/vm-memory

view details

Sergio Lopez

commit sha ee78b71a71661c30fb27d8c9b6830fbaf3de7bf3

ci: Run the unit tests on each PR Run the unit tests ("cargo test --all-targets --all-features") on each PR. Signed-off-by: Sergio Lopez <slp@redhat.com>

view details

Sergio Lopez

commit sha be3f65ba518c104c3cbc7ac45d520593413ffd94

vmm: Refactor kernel bundle config and parameters Move the responsibility of dealing with libkrunfw away from vmm to libkrun, wrapping the parameters into vmm_config::KernelBundle. Also, adapt the code to libkrunfw-0.1, which implements API versioning. Signed-off-by: Sergio Lopez <slp@redhat.com>

view details

Sergio Lopez

commit sha 0a33563fdd83117679711ba554d937211ec8eee9

Merge pull request #4 from slp/refactor_kernel_bundle vmm: Refactor kernel bundle config and parameters

view details

push time in 19 days

pull request commentcontainers/crun

container: add support for libkrun

If you find something you don't like or that you think it could be done in a better way,

do you think it would make sense to have a way to configure and use different contexts? e.g. int32_t krun_init(krun_context *ctx); and int32_t krun_set_root(krun_context *ctx, const char *root_path); With the current API, it looks like it is possible to configure just one VM per process. Not sure if it is technically possible now, but at least we won't block this possibility in the API.

I was planning to tackle multi-VM support in the future (mainly, because I don't see a clear use case), but let's see if we can at least prepare the API for that, as you suggested. Thanks!

@giuseppe Done! PTAL, thanks!

https://github.com/containers/libkrun/blob/5ecfa5caf97663350ffea3fae8d1b0adaa6e0a8d/include/libkrun.h

giuseppe

comment created time in 19 days

push eventslp/libkrun

Sergio Lopez

commit sha 5ecfa5caf97663350ffea3fae8d1b0adaa6e0a8d

libkrun: Refactor the API to make it future-proof Refactor the public C API to add versioning and make it more granular, so we can extend it without breaking existing users. Signed-off-by: Sergio Lopez <slp@redhat.com>

view details

push time in 19 days

pull request commentcontainers/crun

container: add support for libkrun

If you find something you don't like or that you think it could be done in a better way,

do you think it would make sense to have a way to configure and use different contexts? e.g. int32_t krun_init(krun_context *ctx); and int32_t krun_set_root(krun_context *ctx, const char *root_path);

With the current API, it looks like it is possible to configure just one VM per process. Not sure if it is technically possible now, but at least we won't block this possibility in the API.

I was planning to tackle multi-VM support in the future (mainly, because I don't see a clear use case), but let's see if we can at least prepare the API for that, as you suggested. Thanks!

giuseppe

comment created time in 20 days

pull request commentcontainers/crun

container: add support for libkrun

@giuseppe I've created a PR in libkrun with a new API that should allow us to evolve the library while retaining backwards compatibility. If possible, please take a look a it to check that it'll play nice with crun. If you find something you don't like or that you think it could be done in a better way, please don't hesitate to tell me:

  • https://github.com/containers/libkrun/blob/2433c0b70de75af85dbb123b23ca164a5e581d1f/include/libkrun.h
  • https://github.com/containers/libkrun/pull/5

Thanks!

giuseppe

comment created time in 21 days

push eventcontainers/libkrun

Sergio Lopez

commit sha e9075d5e66f7a7174c19d49fc51669f432ea3536

Revert "ci: Run the unit tests on each PR" This reverts commit ee78b71a71661c30fb27d8c9b6830fbaf3de7bf3.

view details

push time in 22 days

PR opened containers/libkrun

libkrun: Refactor the API to make it future-proof

Refactor the public C API to add versioning and make it more granular, so we can extend it without breaking existing users.

Signed-off-by: Sergio Lopez slp@redhat.com

+290 -127

0 comment

3 changed files

pr created time in 22 days

create barnchslp/libkrun

branch : api_refactor

created branch time in 22 days

delete branch slp/libkrun

delete branch : refactor_kernel_bundle

delete time in 25 days

delete branch slp/libkrun

delete branch : rustvmm_vm-memory

delete time in 25 days

PullRequestReviewEvent

push eventcontainers/libkrun

Sergio Lopez

commit sha ee78b71a71661c30fb27d8c9b6830fbaf3de7bf3

ci: Run the unit tests on each PR Run the unit tests ("cargo test --all-targets --all-features") on each PR. Signed-off-by: Sergio Lopez <slp@redhat.com>

view details

Sergio Lopez

commit sha be3f65ba518c104c3cbc7ac45d520593413ffd94

vmm: Refactor kernel bundle config and parameters Move the responsibility of dealing with libkrunfw away from vmm to libkrun, wrapping the parameters into vmm_config::KernelBundle. Also, adapt the code to libkrunfw-0.1, which implements API versioning. Signed-off-by: Sergio Lopez <slp@redhat.com>

view details

Sergio Lopez

commit sha 0a33563fdd83117679711ba554d937211ec8eee9

Merge pull request #4 from slp/refactor_kernel_bundle vmm: Refactor kernel bundle config and parameters

view details

push time in 25 days

PR merged containers/libkrun

vmm: Refactor kernel bundle config and parameters

Move the responsibility of dealing with libkrunfw away from vmm to libkrun, wrapping the parameters into vmm_config::KernelBundle. Also, adapt the code to libkrunfw-0.1, which implements API versioning.

Signed-off-by: Sergio Lopez slp@redhat.com

+156 -43

0 comment

7 changed files

slp

pr closed time in 25 days

push eventslp/libkrun

Sergio Lopez

commit sha be3f65ba518c104c3cbc7ac45d520593413ffd94

vmm: Refactor kernel bundle config and parameters Move the responsibility of dealing with libkrunfw away from vmm to libkrun, wrapping the parameters into vmm_config::KernelBundle. Also, adapt the code to libkrunfw-0.1, which implements API versioning. Signed-off-by: Sergio Lopez <slp@redhat.com>

view details

push time in 25 days

push eventcontainers/libkrun

push time in 25 days

PR opened containers/libkrun

vmm: Refactor kernel bundle config and parameters

Move the responsibility of dealing with libkrunfw away from vmm to libkrun, wrapping the parameters into vmm_config::KernelBundle. Also, adapt the code to libkrunfw-0.1, which implements API versioning.

Signed-off-by: Sergio Lopez slp@redhat.com

+124 -43

0 comment

6 changed files

pr created time in 25 days

create barnchslp/libkrun

branch : refactor_kernel_bundle

created branch time in 25 days

push eventcontainers/libkrun

Sergio Lopez

commit sha ee78b71a71661c30fb27d8c9b6830fbaf3de7bf3

ci: Run the unit tests on each PR Run the unit tests ("cargo test --all-targets --all-features") on each PR. Signed-off-by: Sergio Lopez <slp@redhat.com>

view details

push time in 25 days

created tagcontainers/libkrunfw

tagv0.1

A dynamic library bundling a Linux kernel in a convenient storage format

created time in 25 days

release containers/libkrunfw

v0.1

released time in 25 days

created tagslp/libkrun

tagv0.1

A dynamic library providing KVM-based process isolation capabilities

created time in 25 days

release slp/libkrun

v0.1

released time in 25 days

push eventcontainers/libkrunfw

Sergio Lopez

commit sha 79076794a6715c8813668e75a89ba2c7674236f3

v2b: Rename symbols and add versioning Rename symbols to include the krunfw prefix, and add the "krunfw_get_version" function to keep track of API versions. Signed-off-by: Sergio Lopez <slp@redhat.com>

view details

push time in 25 days

PullRequestReviewEvent

pull request commentrust-vmm/vhost

Initial vhost implementation

Thanks @arronwy. I'm happy with this initial implementation. The test coverage is a bit low, but we can improve on this later.

There are two CI tests failing. One is the unittest pipeline for the musl-arm, which can be fixed by using this workaround (thanks to @andreeaflorescu for pointing me to that). The other is commit-format, because some commit title exceeds 50 chars, but I think we can give it a pass this time.

arronwy

comment created time in 25 days

push eventcontainers/libkrun

Sergio Lopez

commit sha 13a10f9d9ad7c051fc26d0f60da0874097d664fa

src: Switch to rust-vmm/vm-memory Now that build_raw support has been merged into rust-vmm/vm-memory, switch to it. Once released we'll be able to switch from git to crate+version reference. Signed-off-by: Sergio Lopez <slp@redhat.com>

view details

Sergio Lopez

commit sha 50cbe84b871a8f21b43c34774410aff6a16e9c8e

Merge pull request #3 from slp/rustvmm_vm-memory src: Switch to rust-vmm/vm-memory

view details

push time in a month

PR merged containers/libkrun

src: Switch to rust-vmm/vm-memory

Now that build_raw support has been merged into rust-vmm/vm-memory, switch to it. Once released we'll be able to switch from git to crate+version reference.

Signed-off-by: Sergio Lopez slp@redhat.com

+16 -13

0 comment

6 changed files

slp

pr closed time in a month

push eventslp/libkrun

Sergio Lopez

commit sha 13a10f9d9ad7c051fc26d0f60da0874097d664fa

src: Switch to rust-vmm/vm-memory Now that build_raw support has been merged into rust-vmm/vm-memory, switch to it. Once released we'll be able to switch from git to crate+version reference. Signed-off-by: Sergio Lopez <slp@redhat.com>

view details

push time in a month

push eventslp/libkrun

Sergio Lopez

commit sha a4fad7ec6603018e49473240029ece739ae0a792

src: Switch to rust-vmm/vm-memory Now that build_raw support has been merged into rust-vmm/vm-memory, switch to it. Once released we'll be able to switch from git to crate+version reference. Signed-off-by: Sergio Lopez <slp@redhat.com>

view details

push time in a month

push eventcontainers/libkrun

Sergio Lopez

commit sha 481fc259816c5139e94978f9c736b2f219e69e0e

ci: Add a step for creating a fake init file Add a step in the code quality check to create a fake init file, so it won't clippy won't bail out. Signed-off-by: Sergio Lopez <slp@redhat.com>

view details

push time in a month

PR opened containers/libkrun

src: Switch to rust-vmm/vm-memory

Now that build_raw support has been merged into rust-vmm/vm-memory, switch to it. Once released we'll be able to switch from git to crate+version reference.

Signed-off-by: Sergio Lopez slp@redhat.com

+15 -12

0 comment

6 changed files

pr created time in a month

create barnchslp/libkrun

branch : rustvmm_vm-memory

created branch time in a month

fork slp/libkrun

A dynamic library providing KVM-based process isolation capabilities

fork in a month

pull request commentcontainers/crun

container: add support for libkrun

How does this look from your perspective?

it works fine for crun. So I'll keep this PR as a draft until we settle on the API :-)

This week I'll focus on updating the API.

BTW, I'm working on adding SEV support so users can run encrypted workloads and, ideally, there should be a protocol that would allow podman/CRI-O (or some entity controlling them) to verify the measurement of the payload for attestation. What's the proper place for this kind of discussions?

how much of the logic must end up in podman/CRI-O and how much in the OCI runtime? If most of the implementation must be done before crun runs, we could have a discussion on the podman mailing list. Otherwise if the implementation is mostly in the OCI runtime/libkrun layer, I guess we could even have it here?

Actually, it's quite a wide topic, as the upper layers also need to participate in the exchange of information. I guess I'll initiate the discussion on the podman mailing list, and we'll see where that leads us.

giuseppe

comment created time in a month

pull request commentcontainers/crun

container: add support for libkrun

@slp @giuseppe I would love to get this into Fedora so that people could start playing with it. We would need some video blogs on how to do this with Podman. What packages need to be installed, how to setup a kernel, although in a perfect world this could happen automatically or be packaged up with the host kernel (Not likely)

I'd like to mature libkrun a bit before attempting to get it into Fedora. But I also had the intention of creating a COPR repo as soon this PR gets merged, including crun (built with --with-libkrun and shipped with a different binary name, so it can be installed alongside the original one), libkrun and libkrunfw, so users can test it easily.

giuseppe

comment created time in a month

pull request commentrust-vmm/vm-memory

mmap_unix: add support for externally managed mappings

I've just noticed that I forgot to add the entry to CHANGELOG.md. Fixed now.

slp

comment created time in a month

push eventslp/vm-memory

Sergio Lopez

commit sha 935797ae48852070ae49ba4772020b3475588b37

mmap_unix: support for externally managed mappings Add the unsafe MmapRegion::build_raw method to allow users to instance MmapRegion with externally managed mappings. Add also a field to indicate whether the mapping is owned by the MmapRegion instance or not, so we don't try to munmap it on MmapRegion::Drop. Signed-off-by: Sergio Lopez <slp@redhat.com>

view details

push time in a month

push eventcontainers/libkrun

Sergio Lopez

commit sha 0ebce990b6b715732c9851ca79f8c30a7eb6e9d6

README.md: Mention the need of LD_LIBRARY_PATH Mention that, if the libraries are installed in a location that's not included in your '/etc/ld.so.conf' configuration, you may need to use the LD_LIBRARY_PATH environment variable to run the 'chroot_vm' example. Signed-off-by: Sergio Lopez <slp@redhat.com>

view details

push time in a month

issue commentcloud-hypervisor/cloud-hypervisor

Extract the vhost-user-fs crates into their own repo

I would say that it is preferable for components to evolve in rust-vmm, rather than dump thousands of lines in there at some point when we believe they're ready. We do not have any requirement for crates to be mature to live in rust-vmm, we just want to make sure that once they get on crates.io they meet the quality bar that we set for components to be production-ready.

Having design discussions in a separate place seems like a duplication of effort because there is a high likelihood of having the same questions asked again when moving the components to rust-vmm. IMHO, the goal of rust-vmm is to avoid the duplication.

IMHO, this is a very good point.

slp

comment created time in a month

pull request commentrust-vmm/vm-memory

mmap_unix: add support for externally managed mappings

@andreeaflorescu I've rebased the commit and addressed your comments. PTAL, thanks!

slp

comment created time in a month

push eventslp/vm-memory

Sergio Lopez

commit sha d4306e93f643bad8c93d975296531dcc622b7519

mmap_unix: support for externally managed mappings Add the unsafe MmapRegion::build_raw method to allow users to instance MmapRegion with externally managed mappings. Add also a field to indicate whether the mapping is owned by the MmapRegion instance or not, so we don't try to munmap it on MmapRegion::Drop. Signed-off-by: Sergio Lopez <slp@redhat.com>

view details

push time in a month

more