Bug 616721 - RFE: Introduce API for XML normalization
RFE: Introduce API for XML normalization
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
7.0
All Linux
low Severity medium
: rc
: 7.1
Assigned To: Michal Privoznik
Virtualization Bugs
: FutureFeature
: 840344 (view as bug list)
Depends On:
Blocks: 813191
  Show dependency treegraph
 
Reported: 2010-07-21 05:34 EDT by xhu
Modified: 2016-04-26 11:22 EDT (History)
12 users (show)

See Also:
Fixed In Version: libvirt-0.9.9-1.el6
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-08-07 08:13:12 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description xhu 2010-07-21 05:34:37 EDT
Description of problem:
Errors as follows occurs when dettach device from xml file without mac field:
error: Failed to detach device from interface.xml
error: operation failed: network device 52:54:00:4f:58:1a not found 
Note:
it seems that that "52:54:00:4f:58:1a" is a random sequence num and it will change every time you executed it.

Version-Release number of selected component (if applicable):
libvirt-0.8.1-15.el6.x86_64
kernel-2.6.32-44.1.el6.x86_64
qemu-img-0.12.1.2-2.96.el6.x86_64
qemu-kvm-0.12.1.2-2.96.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1.Start a kvm guest
2.Prepare a interface xml as following:
# more interface.xml
   <interface type='network'>
      <source network='default'/>
      <model type='virtio'/>
    </interface>
3. Issue below command :
   # virsh attach-device <guest name> interface.xml
4. Issue below command:
  # virsh dumpxml rhel5u4_x86_64_xenpv
5. Log into guest, make sure the newly added interface works fine.
6. Issue below command in gnome-terminal:
   # virsh detach-device <guest name> interface.xml
  
Actual results:
Step 6: Errors as follows occurs when dettach device from xml file without mac feild:
error: Failed to detach device from interface.xml
error: operation failed: network device 52:54:00:4f:58:1a not found 
if I mofify interface,xml as follows, the device can be detached successfully:
<interface type='network'>
<mac address='52:54:00:5b:c1:59'/>
      <source network='default'/>
      <model type='virtio'/>
</interface>


Expected results:
Step 6: If there must be mac feild in xml file when dettaching device, the errors should be "You must specify mac address in xml file" not "error: Failed to detach device from interface.xml
error: operation failed: network device 52:54:00:4f:58:1a not found "
Note:
it seems that that "52:54:00:4f:58:1a" is a random sequence num and it will change every time you executed it.


Additional info:
Comment 4 Michal Privoznik 2011-04-18 08:36:55 EDT
Patches sent upstream. Waiting for review:

https://www.redhat.com/archives/libvir-list/2011-March/msg01188.html
Comment 7 Michal Privoznik 2011-11-22 05:29:38 EST
Another try:

https://www.redhat.com/archives/libvir-list/2011-November/msg01172.html
Comment 8 Michal Privoznik 2011-11-23 04:58:24 EST
Moving to POST:

commit ea7182c29f185e7c1527b10fbe16dc4ba1f45a88
Author:     Michal Prívozník <mprivozn@redhat.com>
AuthorDate: Mon Jun 6 12:20:11 2011 +0200
Commit:     Michal Privoznik <mprivozn@redhat.com>
CommitDate: Wed Nov 23 10:24:43 2011 +0100

    virsh: Increase device-detach intelligence
    
    Up to now users have to give a full XML description on input when
    device-detaching. If they omitted something it lead to unclear
    error messages (like generated MAC wasn't found, etc.).
    With this patch users can specify only those information which
    specify one device sufficiently precise. Remaining information is
    completed from domain.

v0.9.7-130-gea7182c
Comment 10 xhu 2012-01-10 03:21:11 EST
Verify it with libvirt-0.9.9-1.el6 and it passed.
Comment 11 Dave Allan 2012-01-10 10:33:05 EST
We are reverting this patch because it causes a regression BZ 768268
Comment 17 Michal Privoznik 2013-09-17 10:50:11 EDT
Patches proposed upstream:

https://www.redhat.com/archives/libvir-list/2013-September/msg00982.html
Comment 18 Michal Privoznik 2013-10-16 04:48:59 EDT
*** Bug 840344 has been marked as a duplicate of this bug. ***
Comment 19 Jiri Denemark 2014-08-07 08:13:12 EDT
The discussion initiated by the patch from comment 17 had the following outcome:

- there's no real use case for this API
- part of the reasons may be covered by RNG validation (bug 888748)

Let's close this RFE.

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