On 07.04.25 10:44, Michael S. Tsirkin wrote:
Wow great job digging through all these hypervisors!

There is more ... :(

aloith: https://github.com/google/alioth/blob/main/alioth/src/virtio/dev/balloon.rs

It uses the incremental vq index assignment like QEMU.

impl VirtioMio for Balloon {
    fn activate<'a, 'm, Q: VirtQueue<'m>, S: IrqSender>(
        &mut self,
        feature: u64,
        _active_mio: &mut ActiveMio<'a, 'm, Q, S>,
    ) -> Result<()> {
        let feature = BalloonFeature::from_bits_retain(feature);
        self.queues[0] = BalloonQueue::Inflate;
        self.queues[1] = BalloonQueue::Deflate;
        let mut index = 2;
        if feature.contains(BalloonFeature::STATS_VQ) {
            self.queues[index] = BalloonQueue::Stats;
            index += 1;
        }
        if feature.contains(BalloonFeature::FREE_PAGE_HINT) {
            self.queues[index] = BalloonQueue::FreePage;
            index += 1;
        }
        if feature.contains(BalloonFeature::PAGE_REPORTING) {
            self.queues[index] = BalloonQueue::Reporting;
        }
        Ok(())
    }


I'll dig some more, but this is getting out of hand :D

--
Cheers,

David / dhildenb


Reply via email to