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 フッキングモジュールの関数
| 名前 | 引数 | 説明 |
|---|---|---|
|
|
文字列 |
「true」または「false」の文字列をブール値に変換します。 |
|
|
- |
仮想マシンの libvirt XML を DOM オブジェクトに読み取ります。 |
|
|
DOM オブジェクト |
仮想マシンの libvirt XML を DOM オブジェクトから書き込みます。 |

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.