Bug 998513 - guestfish does not work when you mix --remote and --add options
Summary: guestfish does not work when you mix --remote and --add options
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libguestfs
Version: unspecified
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 996039
TreeView+ depends on / blocked
 
Reported: 2013-08-19 13:13 UTC by Richard W.M. Jones
Modified: 2013-08-19 13:19 UTC (History)
5 users (show)

Fixed In Version:
Clone Of: 996039
Environment:
Last Closed: 2013-08-19 13:18:57 UTC
Embargoed:


Attachments (Terms of Use)

Description Richard W.M. Jones 2013-08-19 13:13:09 UTC
+++ 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 13:14:15 UTC
This is tricky to fix.  I suspect we should just document it
for now.

Comment 2 Richard W.M. Jones 2013-08-19 13:18:57 UTC
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.