Bug 892272

Summary: RFE: Allow interface to be specified with libvirt attach-method
Product: Red Hat Enterprise Linux 7 Reporter: Mohua Li <moli>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED WONTFIX QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 7.0CC: bfan, leiwang, qguan, wshi
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
: 895898 (view as bug list) Environment:
Last Closed: 2013-07-18 16:56:19 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 895898    
Bug Blocks:    

Description Mohua Li 2013-01-06 09:05:09 UTC
Description of problem:

Specify QEMU interface emulation  with add-drive-with-if(add-drive $file iface:ide) break libguestfs, the parameter translate to libvirt xml file is incorrect, 

supermin helper [00000ms] finished creating kernel
supermin helper [00000ms] visiting /usr/lib64/guestfs/supermin.d
supermin helper [00000ms] visiting /usr/lib64/guestfs/supermin.d/base.img
supermin helper [00000ms] visiting /usr/lib64/guestfs/supermin.d/daemon.img
supermin helper [00000ms] visiting /usr/lib64/guestfs/supermin.d/hostfiles
supermin helper [00023ms] visiting /usr/lib64/guestfs/supermin.d/init.img
supermin helper [00023ms] visiting /usr/lib64/guestfs/supermin.d/ntfs.hostfiles
supermin helper [00024ms] visiting /usr/lib64/guestfs/supermin.d/ntfs.img
supermin helper [00024ms] visiting /usr/lib64/guestfs/supermin.d/udev-rules.img
supermin helper [00024ms] adding kernel modules
supermin helper [00053ms] finished creating appliance
libguestfs: checksum of existing appliance: 138a4a0202de035445cab9d54cd31237b2f29cfabc109ad06528b04c1e9b
20fd
libguestfs: trace: get_cachedir
libguestfs: trace: get_cachedir = "/var/tmp"
libguestfs: command: run: qemu-img
libguestfs: command: run: \ create
libguestfs: command: run: \ -f qcow2
libguestfs: command: run: \ -b /var/tmp/.guestfs-0/root.26443
libguestfs: command: run: \ -o backing_fmt=raw
libguestfs: command: run: \ /tmp/libguestfslrGiSI/snapshot2
Formatting '/tmp/libguestfslrGiSI/snapshot2', fmt=qcow2 size=4294967296 backing_file='/var/tmp/.guestfs-
0/root.26443' backing_fmt='raw' encryption=off cluster_size=65536 lazy_refcounts=off 
libguestfs: [00090ms] create libvirt XML
libguestfs: error: 'iface' parameter is not supported by the libvirt attach-method
libguestfs: trace: launch = -1 (error)




the correct xml should be like below, 

    <disk type='file' snapshot='external'>
      <driver name="tap" type="aio" cache="default"/>
      <source file='/var/lib/xen/images/fv0' startupPolicy='optional'>
        <seclabel relabel='no'/>
      </source>
      <target dev='hda' bus='ide'/>
      <iotune>
        <total_bytes_sec>10000000</total_bytes_sec>
        <read_iops_sec>400000</read_iops_sec>
        <write_iops_sec>100000</write_iops_sec>
      </iotune>
      <boot order='2'/>
      <encryption type='...'>


Version-Release number of selected component (if applicable):
libguestfs-1.20.1-4.el7.x86_64

How reproducible:
always

Steps to Reproduce:
1. #guestfish -x -v 
2. #add-drive $file iface:ide 
3. #run
  
Actual results:


Expected results:


Additional info:

Comment 3 Richard W.M. Jones 2013-07-18 16:56:19 UTC
I've no intention of fixing this in RHEL 7 unless guestconv/virt-v2v/
a customer genuinely needs it.