interface: introduce downscript element for interface

https://gitlab.com/libvirt/libvirt/-/issues/13

Add support for downscript:

<interface type='ethernet'>
    <mac address='00:11:22:33:44:55'/>
    <script path='/etc/qemu-ifup'/>
    <downscript path='/path/to/my/downscript'/>
</interface>

Signed-off-by: Chen Hanxiao <chen_han_xiao@126.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Chen Hanxiao
2020-05-25 20:40:59 -04:00
committed by Michal Privoznik
parent 1c425857fb
commit 61ba6f09b1
4 changed files with 26 additions and 2 deletions

View File

@@ -5879,8 +5879,13 @@
<p>
After creating/opening the tap device, an optional shell script
(given in the <code>path</code> attribute of
the <code>&lt;script&gt;</code> element) will be run; this can
be used to do whatever extra host network integration is
the <code>&lt;script&gt;</code> element) will be run.
<span class="since">Since 0.2.1</span>
Also, after detaching/closing the tap device, an optional shell
script (given in the <code>path</code> attribute of
the <code>&lt;downscript&gt;</code> element) will be run.
<span class="since">Since 5.1.0</span>
These can be used to do whatever extra host network integration is
required.
</p>
@@ -5889,6 +5894,7 @@
&lt;devices&gt;
&lt;interface type='ethernet'&gt;
&lt;script path='/etc/qemu-ifup-mynet'/&gt;
&lt;downscript path='/etc/qemu-ifdown-mynet'/&gt;
&lt;/interface&gt;
...
&lt;interface type='ethernet'&gt;

View File

@@ -3191,6 +3191,14 @@
<empty/>
</element>
</optional>
<optional>
<element name="downscript">
<attribute name="path">
<ref name="filePath"/>
</attribute>
<empty/>
</element>
</optional>
<optional>
<element name="backenddomain">
<attribute name="name">