Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1127045

Summary: Libvirt should provide more accurate help messages of iface/net/pool-define in manpage and help
Product: Red Hat Enterprise Linux 7 Reporter: Hu Jianwei <jiahu>
Component: libvirtAssignee: Pavel Hrdina <phrdina>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 7.0CC: dyuan, fjin, honzhang, mzhan, rbalakri
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-1.2.14-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-19 05:47:25 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:

Description Hu Jianwei 2014-08-06 03:13:14 UTC
Description of problem:
 Libvirt should provide more accurate help messages of iface/net/pool-define in man vish and virsh help
Version-Release number of selected component (if applicable):
libvirt-1.2.6-1.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
<1> For iface-define:
[root@localhost network-scripts]# man virsh
       iface-define file
           Define a host interface from an XML file, the interface is just defined but not started.

[root@localhost network-scripts]# virsh help iface-define
  NAME
    iface-define - define (but don't start) a physical host interface from an XML file

  SYNOPSIS
    iface-define <file>

  DESCRIPTION
    Define a physical host interface.

  OPTIONS
    [--file] <string>  file containing an XML interface description

<2> For pool-define:
[root@localhost ~]# man virsh
pool-define file
           Create, but do not start, a pool object from the XML file.

[root@localhost ~]# virsh help pool-define
  NAME
    pool-define - define (but don't start) a pool from an XML file

  SYNOPSIS
    pool-define <file>

  DESCRIPTION
    Define a pool.

  OPTIONS
    [--file] <string>  file containing an XML pool description

<3> For net-define:
[root@localhost ~]# man virsh
net-define file
           Define a persistent virtual network from an XML file, the network is just defined but not instantiated (started).

[root@localhost ~]# virsh help net-define
  NAME
    net-define - define (but don't start) a network from an XML file

  SYNOPSIS
    net-define <file>

  DESCRIPTION
    Define a network.

  OPTIONS
    [--file] <string>  file containing an XML network description


Actual results:
As shown above help message, for example:

iface-define have a default function to update an existing physical host interface.

[root@localhost network-scripts]# virsh iface-list --all
Name                 State      MAC Address
--------------------------------------------
enp2s0               active     00:1b:21:27:4e:ce

[root@localhost network-scripts]# virsh iface-dumpxml enp2s0 --inactive
<interface type='ethernet' name='enp2s0'>
  <start mode='onboot'/>
  <protocol family='ipv4'>
    <ip address='10.66.70.108' prefix='23'/>
  </protocol>
</interface>

[root@localhost network-scripts]# cat enp2s0.xml
<interface type='ethernet' name='enp2s0'>
  <start mode='onboot'/>
  <mtu size='1500'/>
  <protocol family='ipv4'>
    <ip address='10.66.70.108' prefix='23'/>
  </protocol>
</interface>

[root@localhost network-scripts]# virsh iface-define enp2s0.xml
Interface enp2s0 defined from enp2s0.xml

[root@localhost network-scripts]# virsh iface-dumpxml enp2s0 --inactive
<interface type='ethernet' name='enp2s0'>
  <start mode='onboot'/>
  <mtu size='1500'/>
  <protocol family='ipv4'>
    <ip address='10.66.70.108' prefix='23'/>
  </protocol>
</interface>

Aslo, on net and pool, define command can update a net or pool with the same name and UUID exists.

Expected results:
For example on iface-define 
In man virsh
       iface-define file
           Define a host interface from an XML file, the interface is just defined but not started, or update an existing one.

In virsh help
 NAME
    iface-define - define (but don't start) or update a physical host interface from an XML file

  DESCRIPTION
    Define a physical host interface or update an existing one.

For net/pool-define should have similar updates.

Comment 1 Hu Jianwei 2014-08-06 03:14:27 UTC
Upstream patch:
http://www.redhat.com/archives/libvir-list/2014-July/msg01381.html

Comment 4 Pavel Hrdina 2015-02-25 15:58:11 UTC
Patches proposed upstream:

https://www.redhat.com/archives/libvir-list/2015-February/msg01075.html

Comment 5 Pavel Hrdina 2015-03-09 14:17:47 UTC
Upstream patches:

commit b7d027b6a8b5a3c4094920d59f61d820ccbc0b0f
Author: Pavel Hrdina <phrdina>
Date:   Wed Feb 25 16:01:09 2015 +0100

    net-define: update or unify documentation
    
    Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1127045
    
    Signed-off-by: Pavel Hrdina <phrdina>

commit 03369d9643a1d96b385455bcbd13f9fcc9bd7470
Author: Pavel Hrdina <phrdina>
Date:   Wed Feb 25 15:51:41 2015 +0100

    pool-define: update and unify documentation
    
    Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1127045
    
    Signed-off-by: Pavel Hrdina <phrdina>

commit 0632555927ac2822bf0997394643bb9d1b8e6d71
Author: Pavel Hrdina <phrdina>
Date:   Wed Feb 25 15:37:00 2015 +0100

    iface-define: update and unify documentation
    
    Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1127045
    
    Signed-off-by: Pavel Hrdina <phrdina>

Comment 9 Fangge Jin 2015-08-31 09:51:19 UTC
I can reproduce on build libvirt-1.2.13-1.el7.x86_64

Verify this on build libvirt-1.2.17-6.el7.x86_64

Steps:
# virsh iface-define --help
  NAME
    iface-define - define an inactive persistent physical host interface or modify an existing persistent one from an XML file

  SYNOPSIS
    iface-define <file>

  DESCRIPTION
    Define or modify a persistent physical host interface.

  OPTIONS
    [--file] <string>  file containing an XML interface description

# virsh net-define --help
  NAME
    net-define - define an inactive persistent virtual network or modify an existing persistent one from an XML file

  SYNOPSIS
    net-define <file>

  DESCRIPTION
    Define or modify a persistent virtual network.

  OPTIONS
    [--file] <string>  file containing an XML network description


# virsh pool-define --help
  NAME
    pool-define - define an inactive persistent storage pool or modify an existing persistent one from an XML file

  SYNOPSIS
    pool-define <file>

  DESCRIPTION
    Define or modify a persistent storage pool.

  OPTIONS
    [--file] <string>  file containing an XML pool description

Comment 11 errata-xmlrpc 2015-11-19 05:47:25 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-2202.html