Bug 998513 - guestfish does not work when you mix --remote and --add options
guestfish does not work when you mix --remote and --add options
Status: CLOSED UPSTREAM
Product: Virtualization Tools
Classification: Community
Component: libguestfs (Show other bugs)
unspecified
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Richard W.M. Jones
:
Depends On:
Blocks: 996039
  Show dependency treegraph
 
Reported: 2013-08-19 09:13 EDT by Richard W.M. Jones
Modified: 2013-08-19 09:19 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 996039
Environment:
Last Closed: 2013-08-19 09:18:57 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 Richard W.M. Jones 2013-08-19 09:13:09 EDT
+++ This bug was initially created as a clone of Bug #996039 +++

Description of problem:

  eval `guestfish --listen`
  guestfish --remote --add test.img

The '--add' flag for the second command adds the disk to the second
local guestfs handle, not to the remote handle as you might expect.

You can prove this by adding -x options and running the two commands in
separate windows:

  t1$ guestfish --listen -x
  libguestfs: trace: set_pgroup true
  libguestfs: trace: set_pgroup = 0
  GUESTFISH_PID=20662; export GUESTFISH_PID

  t2$  GUESTFISH_PID=20668 guestfish --remote --add debian.img -x
  libguestfs: trace: set_pgroup true
  libguestfs: trace: set_pgroup = 0
  libguestfs: trace: add_drive "debian.img"   <-- note added here, not in t1$
  libguestfs: trace: add_drive = 0

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

libguestfs-1.20.10-2.el6.x86_64
Also happens upstream (1.23.17).

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:14:15 EDT
This is tricky to fix.  I suspect we should just document it
for now.
Comment 2 Richard W.M. Jones 2013-08-19 09:18:57 EDT
Fixed (by documentation) upstream:
https://github.com/libguestfs/libguestfs/commit/7e396954611d827dc236a114ed22a781687c002d

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