Bug 961443 - virsh fails to report --persistent parameter error or it is undocumented
virsh fails to report --persistent parameter error or it is undocumented
Status: CLOSED DUPLICATE of bug 921407
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.4
x86_64 Linux
unspecified Severity low
: rc
: 6.5
Assigned To: Peter Krempa
Virtualization Bugs
: Upstream
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-09 12:01 EDT by Chris Evich
Modified: 2014-03-31 10:46 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-03-31 10:46:42 EDT
Type: Bug
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 Chris Evich 2013-05-09 12:01:25 EDT
Description of problem:
virsh is either not reporting error as an invalid parameter, or parameter is valid but undocumented.

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

How reproducible:
Very Easy

Steps to Reproduce:
1. Use virsh dumpxml to obtain some device XML and make small change
2. use virsh update-device command with --persistent parameter
  
Actual results:
[root@localhost virt]# virsh update-device vm1 asdf.xml --persistent --dogfood --error
error: command 'update-device' doesn't support option --dogfood
[root@localhost virt]# virsh update-device vm1 asdf.xml --persistent --error
error: command 'update-device' doesn't support option --error
[root@localhost virt]# virsh update-device vm1 asdf.xml --persistent
Device updated successfully

Expected results:
[root@localhost virt]# virsh update-device vm1 asdf.xml --persistent
error: command 'update-device' doesn't support option --persistent

Additional info:
This could just be a documentation bug since it is a valid option for later releases.

[root@localhost virt]# virsh help update-device
  NAME
    update-device - update device from an XML file

  SYNOPSIS
    update-device <domain> <file> [--config] [--force]

  DESCRIPTION
    Update device from an XML <file>.

  OPTIONS
    [--domain] <string>  domain name, id or uuid
    [--file] <string>  XML file
    --config         affect next boot
    --force          force device update

This does not appear to be a problem in later versions.
Comment 1 Jiri Denemark 2013-05-10 09:51:59 EDT
This bug report is a pretty strange one. It's filed against RHEL 5 but mentions libvirt 0.10.2-18, which is from RHEL 6.4. The latest RHEL 5 package is libvirt-0.8.2-29.el5_9.1. So what is the right RHEL release and libvirt version? Also you mention this is fixed in "later versions", what version do you mean exactly?
Comment 2 Chris Evich 2013-05-10 10:13:18 EDT
Terribly sorry, my fault.  You are correct, this is RHEL 6.4, I recently reinstalled the box but forgot.  I'll update the bug.
Comment 3 Chris Evich 2013-05-10 10:15:04 EDT
I marked this as 6.5 target, but I think it's probably very low priority (IMHO), so feel free to change it if 6.5 isn't practical.  Thanks.
Comment 5 Peter Krempa 2013-05-10 10:51:18 EDT
The --persistent flag was changed to be backcompat alias for --config and stopped to be documented (this was expected).

Since [1] the --persistent flag is documented again with slightly different semantics than it used to have. This should be backwards compatible with the previous semantics. Please see the man page for additional info about it's behavior.

[1]:
commit 69ce3ffa8d431e9810607c6e00b7cfcc481b491d
Author: Peter Krempa <pkrempa@redhat.com>
Date:   Fri Mar 15 17:11:28 2013 +0100

    virsh: Fix semantics of --config for "update-device" command
    
    The man page states that with --config the next boot is affected. This
    can be understood as if _only_ the next boot was affected. This isn't
    true if the machine is running.
    
    This patch adds the full --live, --config, --current infrastructure and
    tweaks stuff to correctly support the obsolete --persistent flag.
    
    Note that this patch changes the the behavior of the --config flag to match the
    use of this flag in rest of libvirt. This flag was mistakenly renamed from
    --persistent that originaly had different semantics.
Comment 6 Peter Krempa 2013-05-10 10:52:02 EDT
Moving to POST as I believe the commit mentioned above fixes the reported issue.
Comment 7 Chris Evich 2013-05-10 11:24:09 EDT
(In reply to comment #5)
> The --persistent flag was changed to be backcompat alias for --config and
> stopped to be documented (this was expected).

Are you meaning 'virsh help update-device' not mentioning --persistent was on purpose?


Yes, I do see what you describe is in the man page, that looks good.

Thanks.
Comment 8 Peter Krempa 2013-05-10 11:30:48 EDT
(In reply to comment #7)
> (In reply to comment #5)
> > The --persistent flag was changed to be backcompat alias for --config and
> > stopped to be documented (this was expected).
> 
> Are you meaning 'virsh help update-device' not mentioning --persistent was
> on purpose?

Yes, it was on purpose, introduced by commit:

commit 1e31b8356047f2275e772f79309e9e94e15dcc6e
Author: Osier Yang <jyang@redhat.com>
Date:   Thu Mar 8 19:38:57 2012 +0800

    virsh: Use option alias for outmoded "--persistent"
    
    Since VIR_DOMAIN_AFFECT_{LIVE,CONFIG,CURRENT} was created,
    all new virsh commands use "--config" to represents the
    persistent changing. This patch add "--config" option
    for the old commands which still use "--persistent",
    and "--persistent" is now alias of "--config".
    
    tools/virsh.c: (use "--config", and "--persistent" is
        alias of "--config" now).
        cmdDomIfSetLink, cmdDomIfGetLink, cmdAttachDevice,
        cmdDetachDevice, cmdUpdateDevice, cmdAttachInterface,
        cmdDetachInterface, cmdAttachDisk, cmdDetachDisk
    
    toos/virsh.pod: Update docs of the changed commands, and
        add some missed docs for "--config" (detach-interface,
        detach-disk, and detach-device).
Comment 9 Chris Evich 2013-05-10 11:49:07 EDT
Great, thanks.
Comment 13 Jiri Denemark 2014-03-31 10:46:42 EDT
The patch from comment #5 is for bug 921407.

*** This bug has been marked as a duplicate of bug 921407 ***

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