Show Table of Contents
A.10. VDSM 후킹 모듈 사용
VDSM은 Python 후킹 모듈과 함께 제공되며 VDSM 후크 스크립트의 도움말 기능을 제공합니다. 이 모듈은 예제로 제공되며 Python에 작성된 VDSM 후크에만 관련됩니다.
후킹 모듈은 가상 머신의 libvirt XML을 DOM 개체로 읽기를 지원합니다. 후크 스트립트는 Python의 내장
xml.dom 라이브러리 (http://docs.python.org/release/2.6/library/xml.dom.html)를 사용하여 개체를 조작할 수 있습니다.
수정된 개체는 후킹 모듈을 사용하여 libvirt XML에 다시 저장할 수 있습니다. 후킹 모듈은 후크 개발을 지원하기 위해 다음과 같은 함수를 제공합니다:
표 A.2. 후킹 모듈 함수
| 이름 | 인수 | 설명 |
|---|---|---|
tobool | 문자열 | 문자열 "true" 또는 "false"를 부울 값으로 변환합니다 |
read_domxml | - | 가상 머신의 libvirt XML을 DOM 개체로 읽습니다 |
write_domxml | DOM 개체 | DOM 개체에서 가상 머신의 libvirt XML를 씁니다 |

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.