Bug 825939 - RFE: qemu: support -net downscript=
Summary: RFE: qemu: support -net downscript=
Status: NEW
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact:
Whiteboard: LibvirtFirstBug
Depends On:
TreeView+ depends on / blocked
Reported: 2012-05-29 07:04 UTC by Hiroaki KAWAI
Modified: 2018-07-18 14:15 UTC (History)
14 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed:

Attachments (Terms of Use)

Description Hiroaki KAWAI 2012-05-29 07:04:16 UTC
Description of problem:
qemu-kvm controls tap device attachment and detachment with script. libvirt does support interface up script, but does not support down script.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. $ echo "/usr/libexec/qemu-kvm -name hoge -smp 2 -m 1024 -hda hoge.img -net nic,macaddr=54:52:00:01:02:03,model=virtio -net tap,ifname=tap0,script=no,downscript=no" > sample.kvm-native
2. $ virsh domxml-from-native qemu-argv sample.kvm-native > sample.xml

Actual results:
The're is no downscript section in sample.xml, which seems to be simply ignored.

Expected results:
/domain/devices/interface should contain downscript section.

Additional info:
It seems that current master HEAD git repository does not have downscript support yet.

Comment 1 Cole Robinson 2012-06-07 14:32:33 UTC
Moving to upstream tracker

Comment 2 Cole Robinson 2016-03-23 22:09:24 UTC
Currently we support XML like:

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

Where script path maps to qemu -net ...,script=/etc/qemu-ifup

Seems sensible to add

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

Comment 3 Cole Robinson 2016-04-15 14:42:38 UTC
Some info for LibvirtFirstBug: 

Here is an example git commit that could be followed as a template:

commit 937ebba00e1bbbb7f67e00f5522511e6e650fd0a
Author: Marc-André Lureau <marcandre.lureau@gmail.com>
Date:   Fri Feb 19 15:30:15 2016 +0100

    qemu: add spice opengl support

The main components are:

- Parsing the new parameter out of the XML (src/conf/domain_conf.c)
- Putting the new parameter on the qemu command line (src/qemu/qemu_command.c)
- Updating the documentation (docs/formatdomain.html.in)
- Adding a test case to the test suite

Comment 4 sachidananda sahu 2017-02-06 06:45:46 UTC
Hi, i want to work for this, with this i want to get started with opensource , can any one guide me about the floe to make this possible, i will be extremely happy to continue like this.

Comment 5 Daniel Berrangé 2017-02-06 10:25:16 UTC
The best thing is to look at the libvirt code for places that deal with the existing "script" parameter - the support for "downscript" will be 90% the same as that.

Note You need to log in before you can comment on or make changes to this bug.