Bug 996039 - guestfish does not work due to conflict of remote and interactive mode
guestfish does not work due to conflict of remote and interactive mode
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libguestfs (Show other bugs)
6.5
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Richard W.M. Jones
Virtualization Bugs
:
Depends On: 998513
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-12 05:39 EDT by bfan
Modified: 2013-12-25 19:13 EST (History)
3 users (show)

See Also:
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-20 23:46:25 EST
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 bfan 2013-08-12 05:39:18 EDT
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 09:19:41 EDT
Fixed (by documenting the problem) upstream:
https://github.com/libguestfs/libguestfs/commit/7e396954611d827dc236a114ed22a781687c002d
Comment 3 Lingfei Kong 2013-10-17 04:06:10 EDT
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-20 23:46:25 EST
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

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