8000 GitHub - moleium/qemu-yaml: A lightweight zero-dependency C build utility for configuring QEMU via YAML
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

A lightweight zero-dependency C build utility for configuring QEMU via YAML

License

Notifications You must be signed in to change notification settings

moleium/qemu-yaml

{"props":{"initialPayload":{"allShortcutsEnabled":false,"path":"/","repo":{"id":977228661,"defaultBranch":"master","name":"qemu-yaml","ownerLogin":"moleium","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2025-05-03T18:03:33.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/93382765?v=4","public":true,"private":false,"isOrgOwned":false},"currentUser":null,"refInfo":{"name":"master","listCacheKey":"v0:1746295848.0","canEdit":false,"refType":"branch","currentOid":"a498acc226403448b4770d4cca5070da83dd76d9"},"tree":{"items":[{"name":".gitignore","path":".gitignore","contentType":"file"},{"name":"LICENSE","path":"LICENSE","contentType":"file"},{"name":"Makefile","path":"Makefile","contentType":"file"},{"name":"README.md","path":"README.md","contentType":"file"},{"name":"qemu-config.c","path":"qemu-config.c","contentType":"file"}],"templateDirectorySuggestionUrl":null,"readme":null,"totalCount":5,"showBranchInfobar":false},"fileTree":null,"fileTreeProcessingTime":null,"foldersToFetch":[],"treeExpanded":false,"symbolsExpanded":false,"isOverview":true,"overview":{"banners":{"shouldRecommendReadme":false,"isPersonalRepo":false,"showUseActionBanner":false,"actionSlug":null,"actionId":null,"showProtectBranchBanner":false,"publishBannersInfo":{"dismissActionNoticePath":"/settings/dismiss-notice/publish_action_from_repo","releasePath":"/moleium/qemu-yaml/releases/new?marketplace=true","showPublishActionBanner":false},"interactionLimitBanner":null,"showInvitationBanner":false,"inviterName":null,"actionsMigrationBannerInfo":{"releaseTags":[],"showImmutableActionsMigrationBanner":false,"initialMigrationStatus":null}},"codeButton":{"contactPath":"/contact","isEnterprise":false,"local":{"protocolInfo":{"httpAvailable":true,"sshAvailable":null,"httpUrl":"https://github.com/moleium/qemu-yaml.git","showCloneWarning":null,"sshUrl":null,"sshCertificatesRequired":null,"sshCertificatesAvailable":null,"ghCliUrl":"gh repo clone moleium/qemu-yaml","defaultProtocol":"http","newSshKeyUrl":"/settings/ssh/new","setProtocolPath":"/users/set_protocol"},"platformInfo":{"cloneUrl":"https://desktop.github.com","showVisualStudioCloneButton":false,"visualStudioCloneUrl":"https://windows.github.com","showXcodeCloneButton":false,"xcodeCloneUrl":"xcode://clone?repo=https%3A%2F%2Fgithub.com%2Fmoleium%2Fqemu-yaml","zipballUrl":"/moleium/qemu-yaml/archive/refs/heads/master.zip"}},"newCodespacePath":"/codespaces/new?hide_repo_select=true\u0026repo=977228661"},"popovers":{"rename":null,"renamedParentRepo":null},"commitCount":"2","overviewFiles":[{"displayName":"README.md","repoName":"qemu-yaml","refName":"master","path":"README.md","preferredFileType":"readme","tabName":"README","richText":"\u003carticle class=\"markdown-body entry-content container-lg\" itemprop=\"text\"\u003e\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch1 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eqemu-yaml\u003c/h1\u003e\u003ca id=\"user-content-qemu-yaml\" class=\"anchor\" aria-label=\"Permalink: qemu-yaml\" href=\"#qemu-yaml\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eA lightweight zero-dependency single-source file C utility for configuring and launching QEMU virtual machnes using YAML configuration files.\nThe YAML parser used is simple that can only handle common YAML structures needed for the configuration only.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eBuilding\u003c/h2\u003e\u003ca id=\"user-content-building\" class=\"anchor\" aria-label=\"Permalink: Building\" href=\"#building\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eTo build, simply run \u003ccode\u003emake\u003c/code\u003e in the repository's root folder,\nThis will compile the \u003ccode\u003eqemu-config\u003c/code\u003e executable.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eUsage\u003c/h2\u003e\u003ca id=\"user-content-usage\" class=\"anchor\" aria-label=\"Permalink: Usage\" href=\"#usage\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"./qemu-config \u0026lt;config_file\u0026gt; [--dry-run]\"\u003e\u003cpre class=\"notranslate\"\u003e\u003ccode\u003e./qemu-config \u0026lt;config_file\u0026gt; [--dry-run]\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eConfiguration\u003c/h2\u003e\u003ca id=\"user-content-configuration\" class=\"anchor\" aria-label=\"Permalink: Configuration\" href=\"#configuration\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class=\"highlight highlight-source-yaml notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"# Comments will be ignored\n\nqemu_binary: qemu-system-x86_64\n\nmemory: 2G\ncpu: host\nsmp: cores=2,threads=2\n\nkernel: ./vmlinuz\ninitrd: ./initrd.img\nappend: \u0026quot;root=/dev/sda1 console=ttyS0\u0026quot;\n\nhda: ./disk.qcow2\ncdrom: ./install.iso\n\nusb: true\nvga: virtio\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c\"\u003e\u003cspan class=\"pl-c\"\u003e#\u003c/span\u003e Comments will be ignored\u003c/span\u003e\n\n\u003cspan class=\"pl-ent\"\u003eqemu_binary\u003c/span\u003e: \u003cspan class=\"pl-s\"\u003eqemu-system-x86_64\u003c/span\u003e\n\n\u003cspan class=\"pl-ent\"\u003ememory\u003c/span\u003e: \u003cspan class=\"pl-c1\"\u003e2G\u003c/span\u003e\n\u003cspan class=\"pl-ent\"\u003ecpu\u003c/span\u003e: \u003cspan class=\"pl-s\"\u003ehost\u003c/span\u003e\n\u003cspan class=\"pl-ent\"\u003esmp\u003c/span\u003e: \u003cspan class=\"pl-s\"\u003ecores=2,threads=2\u003c/span\u003e\n\n\u003cspan class=\"pl-ent\"\u003ekernel\u003c/span\u003e: \u003cspan class=\"pl-s\"\u003e./vmlinuz\u003c/span\u003e\n\u003cspan class=\"pl-ent\"\u003einitrd\u003c/span\u003e: \u003cspan class=\"pl-s\"\u003e./initrd.img\u003c/span\u003e\n\u003cspan class=\"pl-ent\"\u003eappend\u003c/span\u003e: \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003eroot=/dev/sda1 console=ttyS0\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e\n\n\u003cspan class=\"pl-ent\"\u003ehda\u003c/span\u003e: \u003cspan class=\"pl-s\"\u003e./disk.qcow2\u003c/span\u003e\n\u003cspan class=\"pl-ent\"\u003ecdrom\u003c/span\u003e: \u003cspan class=\"pl-s\"\u003e./install.iso\u003c/span\u003e\n\n\u003cspan class=\"pl-ent\"\u003eusb\u003c/span\u003e: \u003cspan class=\"pl-c1\"\u003etrue\u003c/span\u003e\n\u003cspan class=\"pl-ent\"\u003evga\u003c/span\u003e: \u003cspan class=\"pl-s\"\u003evirtio\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eSupport\u003c/h2\u003e\u003ca id=\"user-content-support\" class=\"anchor\" aria-label=\"Permalink: Support\" href=\"#support\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThe utility supports most common QEMU parameters, but it is limited in some aspects.\u003c/p\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\u003ccode\u003ememory\u003c/code\u003e, \u003ccode\u003ecpu\u003c/code\u003e, \u003ccode\u003esmp\u003c/code\u003e, \u003ccode\u003emachine\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003ekernel\u003c/code\u003e, \u003ccode\u003einitrd\u003c/code\u003e, \u003ccode\u003eappend\u003c/code\u003e, \u003ccode\u003eboot\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003ehda\u003c/code\u003e, \u003ccode\u003ecdrom\u003c/code\u003e, \u003ccode\u003edrive\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003edisplay\u003c/code\u003e, \u003ccode\u003evga\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003enet\u003c/code\u003e, \u003ccode\u003edevice\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003eserial\u003c/code\u003e, \u003ccode\u003eparallel\u003c/code\u003e, \u003ccode\u003emonitor\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003ename\u003c/code\u003e, \u003ccode\u003euuid\u003c/code\u003e\u003c/li\u003e\n\u003cli\u003eetc..\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp dir=\"auto\"\u003eRefer to the handler function for the list.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eTo add support for additional QEMU parameters, update the \u003ccode\u003ehandle_qemu_parameter\u003c/code\u003e function in the single source file.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003ePRs are welcome\u003c/strong\u003e for any additional support.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eLimitations\u003c/h2\u003e\u003ca id=\"user-content-limitations\" class=\"anchor\" aria-label=\"Permalink: Limitations\" href=\"#limitations\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003eNo validation of parameters\u003c/li\u003e\n\u003cli\u003eLightweight YAML parser, may not handle all YAML features\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/article\u003e","loaded":true,"timedOut":false,"errorMessage":null,"headerInfo":{"toc":[{"level":1,"text":"qemu-yaml","anchor":"qemu-yaml","htmlText":"qemu-yaml"},{"level":2,"text":"Building","anchor":"building","htmlText":"Building"},{"level":2,"text":"Usage","anchor":"usage","htmlText":"Usage"},{"level":2,"text":"Configuration","anchor":"configuration","htmlText":"Configuration"},{"level":2,"text":"Support","anchor":"support","htmlText":"Support"},{"level":2,"text":"Limitations","anchor":"limitations","htmlText":"Limitations"}],"siteNavLoginPath":"/login?return_to=https%3A%2F%2Fgithub.com%2Fmoleium%2Fqemu-yaml"}},{"displayName":"LICENSE","repoName":"qemu-yaml","refName":"master","path":"LICENSE","preferredFileType":"license","tabName":"MIT","richText":null,"loaded":false,"timedOut":false,"errorMessage":null,"headerInfo":{"toc":null,"siteNavLoginPath":"/login?return_to=https%3A%2F%2Fgithub.com%2Fmoleium%2Fqemu-yaml"}}],"overviewFilesProcessingTime":0}},"appPayload":{"helpUrl":"https://docs.github.com","findFileWorkerPath":"/assets-cdn/worker/find-file-worker-7d7eb7c71814.js","findInFileWorkerPath":"/assets-cdn/worker/find-in-file-worker-708ec8ade250.js","githubDevUrl":null,"enabled_features":{"copilot_workspace":null,"code_nav_ui_events":false,"react_blob_overlay":false,"accessible_code_button":true,"github_models_repo_integration":false}}}}

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

qemu-yaml

A lightweight zero-dependency single-source file C utility for configuring and launching QEMU virtual machnes using YAML configuration files. The YAML parser used is simple that can only handle common YAML structures needed for the configuration only.

Building

To build, simply run make in the repository's root folder, This will compile the qemu-config executable.

Usage

./qemu-config <config_file> [--dry-run]

Configuration

# Comments will be ignored

qemu_binary: qemu-system-x86_64

memory: 2G
cpu: host
smp: cores=2,threads=2

kernel: ./vmlinuz
initrd: ./initrd.img
append: "root=/dev/sda1 console=ttyS0"

hda: ./disk.qcow2
cdrom: ./install.iso

usb: true
vga: virtio

Support

The utility supports most common QEMU parameters, but it is limited in some aspects.

  • memory, cpu, smp, machine
  • kernel, initrd, append, boot
  • hda, cdrom, drive
  • display, vga
  • net, device
  • serial, parallel, monitor
  • name, uuid
  • etc..

Refer to the handler function for the list.

To add support for additional QEMU parameters, update the handle_qemu_parameter function in the single source file.

PRs are welcome for any additional support.

Limitations

  • No valid 5305 ation of parameters
  • Lightweight YAML parser, may not handle all YAML features

About

A lightweight zero-dependency C build utility for configuring QEMU via YAML

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0