Skip to content

Instantly share code, notes, and snippets.

View MatiasVara's full-sized avatar
😀
Focusing

Matias Ezequiel Vara Larsen MatiasVara

😀
Focusing
View GitHub Profile
@carstein
carstein / main.rs
Last active August 25, 2024 18:47
Example code in Rust using fork and ptrace
use nix::sys::ptrace;
use nix::sys::signal::Signal;
use nix::sys::wait::{WaitStatus, wait};
use nix::unistd::{fork, ForkResult, Pid};
use std::collections::HashMap;
use std::ffi::c_void;
use std::os::unix::process::CommandExt;
use std::process::{Command, exit};
@zakkak
zakkak / gist:ab08672ff9d137bbc0b2d0792a73b7d2
Created March 24, 2020 23:25
Resizing a filesystem using qemu-img and fdisk

Occasionally we will deploy a virtual instance into our KVM infrastructure and realize after the fact that we need more local disk space available. This is the process we use to expand the disk image. This process assumes the following:

  • You're using legacy disk partitions. The process for LVM is similar and I will describe that in another post.
  • The partition you need to resize is the last partition on the disk.

This process will work with either a qcow2 or raw disk image. For

@sameo
sameo / vfio.md
Last active November 14, 2024 01:17

VFIO

Not KVM bound. The VFIO API deconstructs a device into regions, irqs, etc. The userspace application (QEMU, cloud-hypervisor, etc..) is responsible for reconstructing it into a device for e.g. a guest VM to consume.

Boot with intel_iommu=on.

IOMMU groups

Devices are bound together for isolation, IOMMU capabilities and platform topology reasons. It is not configurable.