RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 801286 - qemu-kvm is terminated when interrupt a guestfish command
Summary: qemu-kvm is terminated when interrupt a guestfish command
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libguestfs
Version: 6.2
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Richard W.M. Jones
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-03-08 07:50 UTC by Qixiang Wan
Modified: 2012-03-09 07:43 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-03-08 10:31:15 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Qixiang Wan 2012-03-08 07:50:57 UTC
Description of problem:
When pgroup is set to "false", users can interrupt a guestfish command by pressing "Ctrl-C", but the qemu-kvm could also be terminated.

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

How reproducible:
100%

Steps to Reproduce:
1. Launch the guestfish with pgroup set to "false"
2. Run a command which can take a few seconds to finish, like "compress-device-out", then interrupt it by "^C" while it's running.
  
Actual results:
The qemu-kvm process also be terminated

Expected results:
Only the command should be cancelled and qemu-kvm process should keep running well.

Additional info:

verbose log:

$ guestfish -a /images/guest.img -v
><fs> set-pgroup 0
><fs> run
libguestfs: [00000ms] febootstrap-supermin-helper --verbose -f checksum '/usr/lib64/guestfs/supermin.d' x86_64
[...]
libguestfs: recv_from_daemon: received GUESTFS_LAUNCH_FLAG
libguestfs: [03763ms] appliance is up
><fs> compress-device-out gzip /dev/vda vda.zip
libguestfs: send_to_daemon: 68 bytes: 00 00 00 40 | 20 00 f5 f5 | 00 00 00 04 | 00 00 01 24 | 00 00 00 00 | ...
guestfsd: main_loop: proc 7 (list_devices) took 0.00 seconds
guestfsd: main_loop: new request, len 0x40
gzip -c < /dev/vda
libguestfs: recv_from_daemon: 40 bytes: 20 00 f5 f5 | 00 00 00 04 | 00 00 01 24 | 00 00 00 01 | 00 12 34 01 | ...
libguestfs: recv_from_daemon: 8200 bytes: 00 00 00 00 | 00 00 20 00 | 1f 8b 08 00 | e3 aa 58 4f | 00 03 ec dc | ...
libguestfs: recv_from_daemon: 8200 bytes: 00 00 00 00 | 00 00 20 00 | 00 00 00 00 | 00 00 00 00 | 00 00 00 00 | ...
^Cqemu: terminating on signal 2
libguestfs: error: unexpected end of file when reading from daemon.
See earlier debug messages.
Or you can run 'libguestfs-test-tool' and post the complete output into
a bug report or message to the libguestfs mailing list.
libguestfs: child_cleanup: 0x27cb370: child process died
libguestfs: error: receive_file_data: parse error in reply callback
libguestfs: error: vda.zip: error in chunked encoding
><fs> ping-daemon 
libguestfs: error: ping_daemon: call launch before using this function
(in guestfish, don't forget to use the 'run' command)
><fs>

Comment 2 Qixiang Wan 2012-03-08 07:55:07 UTC
But we're not very sure whether this is a bug. Is the qemu-kvm exactly the subprocess which should receive the SIGINT signal, and there is no subprocess for the guestfish sub-commands?

Please feel free to close this if you think this is the expected result, and there is no necessary to improve the behaviour.

Comment 3 Richard W.M. Jones 2012-03-08 10:31:15 UTC
If users set the pgroup flag to false (which they shouldn't do)
then ^C is delivered to guestfish and to the subprocess (kvm),
killing both.

That's the reason why guestfish sets this flag to true: so that
guestfish can catch ^C during long-running commands and cancel
them properly.

https://github.com/libguestfs/libguestfs/blob/4504f424f5589f81086f5250674b55708e162e5f/fish/fish.c#L399


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