]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Xen: Do not generate net ifname if domain is inactive
authorJim Fehlig <jfehlig@novell.com>
Wed, 27 Apr 2011 22:39:37 +0000 (16:39 -0600)
committerJim Fehlig <jfehlig@novell.com>
Thu, 28 Apr 2011 20:54:06 +0000 (14:54 -0600)
commit578391e1bc8abfa9859bf9be8522c8f0edd06302
treeaad28152a0ccf4bcfdf3d8b5c31d1b2893f83345
parenta88916665df614238b8e56806bb27caaf4cc7725
Xen: Do not generate net ifname if domain is inactive

V2: Use virAsprintf instead of snprintf/strdup

The xend driver will generate a virDomainNetDef ifname if one is not
specified in xend sexpr, even if domain is inactive.  The result is
network interface XML containing 'vif-1.Y' on dev attribute of target
element, e.g.

  <interface type='bridge'>
    <target dev='vif-1.0'/>
    ...

This patch changes the behavior to only generate the ifname if not
specified in xend sexpr *and* domain is not inactive (id != -1).
src/xenxs/xen_sxpr.c