Bug 706295

Summary: UML started with incorrect command line networking parameters
Product: [Community] Virtualization Tools Reporter: Heath Petersen <HeathPetersen>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED UPSTREAM QA Contact:
Severity: high Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: crobinso, eblake, xen-maint
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-06-02 19:55:59 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
patch to fix the problem none

Description Heath Petersen 2011-05-19 23:24:46 UTC
Description of problem:

When starting a UML domain from virsh, the generated UML command line has an incorrect eth0= parameter generated.  It should be eth0=tuntap,h1,00:00:00:61:bf:b8 but eth0=tuntap,00:00:00:61:bf:b8 is being generated instead.


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

libvirt: 0.9.1 (downloaded and built myself)
UML: 2.6.35.1 (Ubuntu 11.04)


How reproducible:

---------- Output of virsh -c uml:///session dumpxml demo ----------
<domain type='uml'>
  <name>demo</name>
  <uuid>abadea12-6bc9-04f4-1f76-83eab415ba50</uuid>
  <memory>512000</memory>
  <currentMemory>512000</currentMemory>
  <vcpu>1</vcpu>
  <os>
    <type arch='i686'>uml</type>
    <kernel>/usr/bin/linux.uml</kernel>
  </os>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <disk type='file' device='disk'>
      <source file='/home/heath/uml_test/root_fs'/>
      <target dev='ubd0' bus='uml'/>
    </disk>
    <interface type='ethernet'>
      <mac address='00:00:00:61:bf:b8'/>
      <target dev='h1'/>
    </interface>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
  </devices>
</domain>

Comment 1 Heath Petersen 2011-05-19 23:38:20 UTC
After thinking about it, to prove my point, I tried removing the name of the tun device from the XML config by removing the "<target dev='h1'/>" line.  It also generates an incorrect command line with eth0=tuntap,00:00:00:61:bf:b8.  It should have two commas after tuntap.

Comment 2 Heath Petersen 2011-05-28 01:43:31 UTC
Created attachment 501428 [details]
patch to fix the problem

This attachment appears to fix the problem.  I release it into the public domain with no copyright or license restrictions.  Please use it if you like.

Comment 3 Cole Robinson 2011-05-31 15:19:22 UTC
Hi Heath, thanks for the report and the patch. Your change is likely to get more attention if you mail it to libvirt-list with a [PATCH] prefix in the subject. Thanks!

Comment 4 Eric Blake 2011-06-02 19:55:59 UTC
0.9.2 will include:

commit 39b59dbdb4cf81302adee76d88c76f59b1281708
Author: Heath Petersen <HeathPetersen>
Date:   Thu Jun 2 11:23:43 2011 -0500

    uml: correct command line networking parameters
    
    I have been finding that some UML command line networking parameters are
    being generated incorrectly.