<p>
After creating/opening the tap device, an optional shell script
(given in the <code>path</code> attribute of
- the <code><script></code> element) will be run; this can
- be used to do whatever extra host network integration is
+ the <code><script></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><downscript></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>
<devices>
<interface type='ethernet'>
<script path='/etc/qemu-ifup-mynet'/>
+ <downscript path='/etc/qemu-ifdown-mynet'/>
</interface>
...
<interface type='ethernet'>
VIR_FREE(def->teaming.persistent);
VIR_FREE(def->virtPortProfile);
VIR_FREE(def->script);
+ VIR_FREE(def->downscript);
VIR_FREE(def->domain_name);
VIR_FREE(def->ifname);
VIR_FREE(def->ifname_guest);
g_autofree char *ifname_guest = NULL;
g_autofree char *ifname_guest_actual = NULL;
g_autofree char *script = NULL;
+ g_autofree char *downscript = NULL;
g_autofree char *address = NULL;
g_autofree char *port = NULL;
g_autofree char *localaddr = NULL;
} else if (!script &&
virXMLNodeNameEqual(cur, "script")) {
script = virXMLPropString(cur, "path");
+ } else if (!downscript &&
+ virXMLNodeNameEqual(cur, "downscript")) {
+ downscript = virXMLPropString(cur, "path");
} else if (!domain_name &&
virXMLNodeNameEqual(cur, "backenddomain")) {
domain_name = virXMLPropString(cur, "name");
if (script != NULL)
def->script = g_steal_pointer(&script);
+ if (downscript != NULL)
+ def->downscript = g_steal_pointer(&downscript);
if (domain_name != NULL)
def->domain_name = g_steal_pointer(&domain_name);
if (ifname != NULL)
virBufferEscapeString(buf, "<script path='%s'/>\n",
def->script);
+ virBufferEscapeString(buf, "<downscript path='%s'/>\n",
+ def->downscript);
virBufferEscapeString(buf, "<backenddomain name='%s'/>\n", def->domain_name);
if (def->ifname &&