Red Hat Training

A Red Hat training course is available for Red Hat Enterprise Linux

14.6. 게스트 가상 머신의 구성 파일 편집

dumpxml 옵션( 14.5.23절. “가상 머신 XML 덤프 생성 (구성 파일)”참조)을 사용하는 대신 게스트 가상 머신을 실행 중이나 오프라인 상태에서 편집할 수 있습니다. virsh edit 명령은 이 기능을 제공합니다. 예를 들어 rhel6 이라는 게스트 가상 머신을 편집하려면 다음을 수행합니다.
# virsh edit rhel6
그러면 텍스트 편집기가 열립니다. 기본 텍스트 편집기는 $EDITOR 쉘 매개변수입니다(기본적으로 vi 로 설정).

14.6.1. KVM 게스트 가상 머신에 Multifunction PCI 장치 추가

이 섹션에서는 KVM 게스트 가상 머신에 다중 기능 PCI 장치를 추가하는 방법을 보여줍니다.
  1. virsh edit [guestname] 명령을 실행하여 게스트 가상 시스템의 XML 구성 파일을 편집합니다.
  2. address 유형 태그에서 function='0x0' 에 대해 multifunction='on' 항목을 추가합니다.
    이를 통해 게스트 가상 머신은 다기능 PCI 장치를 사용할 수 있습니다.
    <disk type='file' device='disk'>
    <driver name='qemu' type='raw' cache='none'/>
    <source file='/var/lib/libvirt/images/rhel62-1.img'/>
    <target dev='vda' bus='virtio'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0' multifunction='on'/
    </disk>
    
    두 개의 기능이 있는 PCI 장치의 경우 첫 번째 장치와 동일한 슬롯 번호와 function='0x1' 과 같은 다른 함수 번호를 사용하여 두 번째 장치를 포함하도록 XML 구성 파일을 수정합니다.
    예를 들면 다음과 같습니다.
    <disk type='file' device='disk'>
    <driver name='qemu' type='raw' cache='none'/>
    <source file='/var/lib/libvirt/images/rhel62-1.img'/>
    <target dev='vda' bus='virtio'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0' multifunction='on'/>
    </disk>
    <disk type='file' device='disk'>
    <driver name='qemu' type='raw' cache='none'/>
    <source file='/var/lib/libvirt/images/rhel62-2.img'/>
    <target dev='vdb' bus='virtio'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x1'/>
    </disk>
    
  3. KVM 게스트 가상 머신의 lspci 출력에는 다음이 표시됩니다.
    $ lspci
    
    00:05.0 SCSI storage controller: Red Hat, Inc Virtio block device
    00:05.1 SCSI storage controller: Red Hat, Inc Virtio block device