Skip to content

carapace-sh/carapace-bin / skills/qemu

Use when working with QEMU — qemu-system-*, qemu-img, qemu-nbd, qemu-storage-daemon, qemu-pr-helper, block drivers, machine types, CPU models, device emulation, networking, display options, QMP protocol, and guest agent. Triggers on: "qemu", "qemu-system", "qemu-img", "qemu-nbd", "qemu-kvm", "QEMU", "qcow2", "qcow", "qed", "virtio", "virgl", "vhost-user", "VirtIO", "block driver", "machine type", "SEV", "SEV-SNP", "TDX", "snapshot", "backing file", "NBD", "Network Block Device", "QMP", "QEMU Monitor Protocol", "guest agent", "qemu-ga", "cpu model", "host passthrough", "SPICE", "VNC".

references/qemu-pr-helper.md

View on GitHub
# qemu-pr-helper — SCSI Persistent Reservation Helper

SCSI persistent reservations restrict access to block devices to specific initiators in shared storage setups. This helper daemon handles PR commands from QEMU's SCSI passthrough devices (`scsi-block`, `scsi-generic`).

## Synopsis

```
qemu-pr-helper [OPTION]
```

## How It Works

1. QEMU's `scsi-block` or `scsi-generic` device receives a PR command from the guest
2. Instead of executing it directly (which requires privileges), QEMU forwards it to `qemu-pr-helper` over a UNIX socket
3. `qemu-pr-helper` executes the PR command on behalf of QEMU
4. Returns the result to QEMU, which passes it to the guest

This allows unprivileged QEMU processes to use SCSI persistent reservations while the helper runs with elevated privileges.

## Options

| Option | Description |
|--------|-------------|
| `-d, --daemon` | Run in background (creates PID file) |
| `-q, --quiet` | Decrease verbosity |
| `-v, --verbose` | Increase verbosity |
| `-f, --pidfile PATH` | PID file (default: `/var/run/qemu-pr-helper.pid`) |
| `-k, --socket PATH` | Socket path (default: `/var/run/qemu-pr-helper.sock`) |
| `-u, --user USER` | Drop privileges to this user |
| `-g, --group GROUP` | Drop privileges to this group |
| `-T, --trace [...]` | Tracing options |
| `-h, --help` | Display help |
| `-V, --version` | Display version |

## systemd Integration

Supports socket activation. Example socket unit:

```
[Socket]
ListenStream=/var/run/qemu-pr-helper.sock
```

## QEMU Configuration

In the QEMU command line, configure the PR manager on the block device:

```
-object pr-manager-helper,id=pr0,path=/var/run/qemu-pr-helper.sock \
-drive file=shared.qcow2,if=none,id=drive0,format=qcow2 \
-device scsi-block,drive=drive0,pr-manager=pr0
```

## Use Case

Shared SCSI storage in a cluster of virtual machines. Each VM needs to coordinate access to the same LUN. Persistent reservations provide the cluster fence mechanism — when a node fails, the cluster manager releases its PR and another node takes ownership.
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 323kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 323kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 323kUpdated Claude CodeCodexVerifiedInstall