Show Table of Contents
21.18. QEMU 引数のドメイン XML への変換
virsh domxml-from-native コマンドは、QEMU 引数の既存のセットをドメイン XML 設定ファイルに変換する方法を提供します。この設定ファイルはその後 libvirt で使用できます。ただし、このコマンドは、既存の QEMU ゲストがコマンドラインから以前に起動されている場合に、これらのゲストを libvirt で管理できるように変換する目的でのみ使用されることになっている点に注意してください。このため、ここに説明されている方法は、新しいゲストをゼロから作成するためには使用しないでください。新しいゲストは virsh、virt-install、または virt-manager を使って作成する必要があります。追加情報については、libvirt のアップストリームの web サイト を参照してください。
手順21.3 QEMU ゲストを libvirt に変換する方法
- QEMU ゲストを引数ファイル (ファイルタイプは
*.args) で起動します。この例では、demo.args になります。$
cat demo.argsLC_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 - このファイルをドメイン XML ファイルに変換して、ゲストを libvirt で管理できるようにするには、以下のコマンドをターミナルに入力します。qemu-guest1 をゲスト仮想マシンの名前で、demo.args を QEMU args ファイルのファイル名で置き換えます。
#
virsh domxml-from-native qemu-guest1demo.argsこのコマンドは、demo.args ファイルを以下のドメイン XML ファイルに変換します。<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>図21.1 ゲスト仮想マシンの新規設定ファイル

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.