Bug 996039

Summary: guestfish does not work due to conflict of remote and interactive mode
Product: Red Hat Enterprise Linux 6 Reporter: bfan
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.5CC: leiwang, lkong, wshi
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libguestfs-1.20.10-3.el6 Doc Type: Bug Fix
Doc Text:
Cause: Using guestfish --remote & --add options together. Consequence: This gives unexpected results. Fix: No fix, we have just documented that you're not supposed to use these options together in the guestfish manual.
Story Points: ---
Clone Of:
: 998513 998750 (view as bug list) Environment:
Last Closed: 2013-11-21 04:46: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:
Bug Depends On: 998513    
Bug Blocks:    

Description bfan 2013-08-12 09:39:18 UTC
Description of problem:
guestfish dose not work due to conflict of remote and ineractive mode.

Code of fish/fish.c

  /* Interactive, shell script, or command(s) on the command line? */
  if (optind >= argc) {
    if (is_interactive)
      interactive ();
    else
      shell_script ();
  }
  else
    cmdline (argv, optind, argc);

If gives this command "guestfish --remote --add test.img", guestfish looks like executing in interactive mode, but actually it try to connect the remote server.


Version-Release number of selected component (if applicable):
libguestfs-1.20.10-2.el6.x86_64


How reproducible:
100%


Steps to Reproduce:
1. create a disk
[root@intel-8400-8-2 home]# dd if=/dev/zero of=test.img bs=1M count=50
50+0 records in
50+0 records out
52428800 bytes (52 MB) copied, 0.0447178 s, 1.2 GB/s

2. guestfish remote control
[root@intel-8400-8-2 home]# eval "`guestfish --listen`"
[root@intel-8400-8-2 home]# guestfish --remote --add test.img

Welcome to guestfish, the libguestfs filesystem interactive shell for
editing virtual machine filesystems.

Type: 'help' for help on commands
      'man' to read the manual
      'quit' to quit the shell

><fs> quit
><fs> quit
guestfish: remote: looks like the server is not running
><fs> quit
guestfish: remote: looks like the server is not running
><fs>

We have to use "ctrl + d" to quit


Actual results:
guestfish does not work because of conflict


Expected results:
guestfish can work well with one method (remote or interactive)


Additional info:
Following is correct
1.
[root@intel-8400-8-2 home]# eval "`guestfish --listen`"
[root@intel-8400-8-2 home]# guestfish --remote -- add test.img

2.[root@intel-8400-8-2 home]# eval "`guestfish --listen`"
[root@intel-8400-8-2 home]# guestfish --remote add test.img

same issue in rhel7, libguestfs-1.22.5-3.el7.x86_64

Comment 1 Richard W.M. Jones 2013-08-19 13:19:41 UTC
Fixed (by documenting the problem) upstream:
https://github.com/libguestfs/libguestfs/commit/7e396954611d827dc236a114ed22a781687c002d

Comment 3 Lingfei Kong 2013-10-17 08:06:10 UTC
Reproduce:
1. Create a raw image:
[host]#dd if=/dev/zero of=test.img bs=1M count=50
2. guestfish remote control
[host]#eval "`guestfish --listen`"
[host]#guestfish --remote --add test.img
Welcome to guestfish, the libguestfs filesystem interactive shell for
editing virtual machine filesystems.

Type: 'help' for help on commands
      'man' to read the manual
      'quit' to quit the shell

><fs> quit
><fs> quit
guestfish: remote: looks like the server is not running
><fs> quit
guestfish: remote: looks like the server is not running

3. Check man page:
In man page for libguestfs-1.20.10-2.el6.x86_64 I can not find some thing that prompt you do not use
--remote & --add options together.



Verified:
libguestfs version: libguestfs-1.20.10-3.el6

1. Install libguestfs-1.20.10-3.el6 on RHEL6.5 host
2. [guest]#man guestfish,  I can find the following content in man page:

 REMOTE CONTROL DOES NOT WORK WITH -a ETC. OPTIONS
       Options such as -a, --add, -N, --new etc don’t interact properly with remote
       support.  They are processed locally, and not sent through to the remote
       guestfish.  In particular this won’t do what you expect:

        guestfish --remote --add disk.img

       Don’t use these options.  Use the equivalent commands instead, eg:

        guestfish --remote add-drive disk.img

       or:

        guestfish --remote
        ><fs> add disk.img

Comment 5 errata-xmlrpc 2013-11-21 04:46: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.

http://rhn.redhat.com/errata/RHSA-2013-1536.html