RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1001078 - virsh net-update delete ip-dhcp-host fails with incomplete XML
Summary: virsh net-update delete ip-dhcp-host fails with incomplete XML
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.0
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: rc
: ---
Assignee: Ján Tomko
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-08-26 13:02 UTC by Ján Tomko
Modified: 2014-06-18 00:54 UTC (History)
5 users (show)

Fixed In Version: libvirt-1.1.1-3.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-13 11:50:47 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Ján Tomko 2013-08-26 13:02:05 UTC
Description of problem:
deleting a host with incomplete XML 

Version-Release number of selected component (if applicable):
libvirt-1.1.1-2.el7.x86_64

How reproducible:
You may rely on it.

Steps to Reproduce:
1. Have a network with a host in the dhcp section:
<network>
  <name>default</name>
...
  <ip address='192.168.122.1' netmask='255.255.255.0'>
    <dhcp>
      <range start='192.168.122.2' end='192.168.122.254' />
      <host mac='12:34:56:78:90:ab' name='aaa' ip='192.168.122.123' />
    </dhcp>
  </ip>
</network>

2. virsh # net-update default delete ip-dhcp-host "<host ip='192.168.122.123'/>"
error: Failed to update network default
error: XML error: Static host definition in IPv4 network 'default' must have mac or name attribute

Expected results:
The host is deleted since it's uniquely identified by the IP.

Additional info:
Fixed upstream by:
commit cf602e7c597830a2d949017fe71f06b5f542c805
Author:     Ján Tomko <jtomko>
AuthorDate: 2013-07-31 13:25:59 +0200
Commit:     Ján Tomko <jtomko>
CommitDate: 2013-08-07 16:31:12 +0200

    Reverse logic allowing partial DHCP host XML
    
    Before, missing attributes were only OK when adding entries;
    modification and deletion required all of them.
    
    Now, only deletion works with missing attributes, as long as
    the host is uniquely identified.

git describe: v1.1.1-76-gcf602e7

The commit message is not completely accurate: Even though partial entries were parsed as correct when adding hosts by the function the commit is fixing, they were rejected later when the whole network XML was verified.

Comment 3 Jincheng Miao 2013-09-03 06:27:11 UTC
# rpm -q libvirt
libvirt-1.1.1-3.el7.x86_64

# virsh net-dumpxml default
<network>
  <name>default</name>
  <uuid>a04a5f8f-1f1a-45f6-ad95-e9d7cc07cf5f</uuid>
  <forward mode='nat'>
    <nat>
      <port start='1024' end='65535'/>
    </nat>
  </forward>
  <bridge name='virbr0' stp='on' delay='0' />
  <mac address='52:54:00:71:f8:62'/>
  <ip address='192.168.122.1' netmask='255.255.255.0'>
    <dhcp>
      <range start='192.168.122.2' end='192.168.122.254' />
      <host mac='12:34:56:78:90:ab' name='aaa' ip='192.168.122.123' />
    </dhcp>
  </ip>
</network>

# virsh net-update default delete ip-dhcp-host "<host ip='192.168.122.123'/>"
Updated network default live state

# virsh net-dumpxml default<network>
  <name>default</name>
  <uuid>a04a5f8f-1f1a-45f6-ad95-e9d7cc07cf5f</uuid>
  <forward mode='nat'>
    <nat>
      <port start='1024' end='65535'/>
    </nat>
  </forward>
  <bridge name='virbr0' stp='on' delay='0' />
  <mac address='52:54:00:71:f8:62'/>
  <ip address='192.168.122.1' netmask='255.255.255.0'>
    <dhcp>
      <range start='192.168.122.2' end='192.168.122.254' />
    </dhcp>
  </ip>
</network>

host part is removed correctly, so I change the status to VERIFIED.

Comment 4 Ludek Smid 2014-06-13 11:50:47 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.


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