Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.

20.18. Converting QEMU Arguments to Domain XML


The virsh domxml-from-native command provides a way to convert an existing set of QEMU arguments into a Domain XML configuration file that can then be used by libvirt. Note that this command is intended to be used only to convert existing QEMU guests previously started from the command line, in order to enable them to be managed through libvirt. Therefore, the method described here should not be used to create new guests from scratch. New guests should be created using either virsh, virt-install, or virt-manager. Additional information can be found on the libvirt upstream website.

Procedure 20.3. How to convert a QEMU guest to libvirt

  1. Start with a QEMU guest with a arguments file (file type *.args), named demo.args in this example:
    $ cat demo.args
    LC_ALL=C
    PATH=/bin
    HOME=/home/test
    USER=test
    LOGNAME=test /usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -serial none -parallel none -usb
    
    Copy to Clipboard Toggle word wrap
  2. To convert this file into a domain XML file so that the guest can be managed by libvirt, enter the following command. Remember to replace qemu-guest1 with the name of your guest virtual machine and demo.args with the filename of your QEMU args file.
    # virsh domxml-from-native qemu-guest1 demo.argsvirsh domxml-from-native qemu-guest1 demo.argsvirsh domxml-from-native qemu-guest1 demo.argsvirsh domxml-from-native qemu-guest1 demo.args
    Copy to Clipboard Toggle word wrap
    This command turns the demo.args file into the following domain XML file:
    <domain type='qemu'>
      <uuid>00000000-0000-0000-0000-000000000000</uuid>
      <memory>219136</memory>
      <currentMemory>219136</currentMemory>
      <vcpu>1</vcpu>
      <os>
        <type arch='i686' machine='pc'>hvm</type>
        <boot dev='hd'/>
      </os>
      <clock offset='utc'/>
      <on_poweroff>destroy</on_poweroff>
      <on_reboot>restart</on_reboot>
      <on_crash>destroy</on_crash>
      <devices>
        <emulator>/usr/bin/qemu</emulator>
        <disk type='block' device='disk'>
          <source dev='/dev/HostVG/QEMUGuest1'/>
          <target dev='hda' bus='ide'/>
        </disk>
      </devices>
    </domain>
    Copy to Clipboard Toggle word wrap

    Figure 20.1. Guest virtual machine new configuration file

Nach oben
Red Hat logoGithubredditYoutubeTwitter

Lernen

Testen, kaufen und verkaufen

Communitys

Über Red Hat Dokumentation

Wir helfen Red Hat Benutzern, mit unseren Produkten und Diensten innovativ zu sein und ihre Ziele zu erreichen – mit Inhalten, denen sie vertrauen können. Entdecken Sie unsere neuesten Updates.

Mehr Inklusion in Open Source

Red Hat hat sich verpflichtet, problematische Sprache in unserem Code, unserer Dokumentation und unseren Web-Eigenschaften zu ersetzen. Weitere Einzelheiten finden Sie in Red Hat Blog.

Über Red Hat

Wir liefern gehärtete Lösungen, die es Unternehmen leichter machen, plattform- und umgebungsübergreifend zu arbeiten, vom zentralen Rechenzentrum bis zum Netzwerkrand.

Theme

© 2025 Red Hat