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 602277 - Can 'virsh edit' append a '.xml' suffix to tempfile edited by vim?
Summary: Can 'virsh edit' append a '.xml' suffix to tempfile edited by vim?
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.0
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Jiri Denemark
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-06-09 14:12 UTC by Kirby Zhou
Modified: 2011-05-19 13:19 UTC (History)
7 users (show)

Fixed In Version: libvirt-0.8.6-1.el6
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-05-19 13:19:07 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:0596 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2011-05-18 17:56:36 UTC

Description Kirby Zhou 2010-06-09 14:12:29 UTC
Description of problem:

Can 'virsh edit' append a '.xml' suffix to tempfile edited by vim?
So vim can recognize the tmepfile as a xml file and set filetype=xml for it.

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

libvirt-0.7.6-2.el6.x86_64

Comment 2 RHEL Program Management 2010-06-09 14:32:57 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.

Comment 3 Jiri Denemark 2010-06-14 15:31:16 UTC
This could probably be implemented upstream quite easily using gnulib's mkstemps instead of starndard mkstemp which doesn't support suffixes in temp files. However, I'm not sure if this is anything we can easily do for rhel6.

Although, it's something which can be worked around by configuring vim to detect all /tmp/virsh* files as XML files.

Comment 6 Jiri Denemark 2010-11-09 13:37:52 UTC
This is now committed upstream as fb76151c28df0fa07a35219ae7455cefd1c41199

Comment 7 Jiri Denemark 2010-11-17 14:46:38 UTC
Fixed in v0.8.5-50-gfb76151 upstream:

commit fb76151c28df0fa07a35219ae7455cefd1c41199
Author: Jiri Denemark <jdenemar>
Date:   Tue Nov 9 10:27:09 2010 +0100

    virsh: Add .xml suffix to tmp files used in *edit commands
    
    This helps editors with detecting the temporary files as XML since the
    temporary files do not contain <?xml ...?> declaration.
    
    Requested by https://bugzilla.redhat.com/show_bug.cgi?id=602277

Comment 8 Jiri Denemark 2010-12-23 23:48:30 UTC
Fixed by a rebase to libvirt-0.8.6

Comment 9 Cui Chun 2010-12-24 09:51:59 UTC
Verified it. Passed.

Test enviorment:
    RHEL6,
    kernel-2.6.32-92.el6, 
    qemu-kvm-0.12.1.2-2.128.el6, 
    libvirt-0.8.6-1.el6


Steps:

1. Check the domain
  # virsh list 
 Id Name                 State
 ----------------------------------
  1 graph                running
  2 qcow2                running
 
2. Edit domain
  # virsh edit graph
  The file "/tmp/virsh3RespQ.xml" can be shown correctly. 

3. Check the domain configration with .xml suffix from /tmp during run "virsh edit".
   The domain configration with .xml suffix can be listed and opened correctly.

4. Check the domain configration with .xml suffix from /tmp after exit "virsh edit".
    The domain configration with .xml suffix can be removed.

5. Repeat step 1-4 on libvirt-0.8.1-27.el6
    The domain configration didn't includ .xml suffix

Comment 11 Cui Chun 2011-02-09 06:40:58 UTC
Rechecked it on the following test environment according to comment 9. It is passed.

Test environment:
libvirt-0.8.7-5.el6
qemu-kvm-0.12.1.2-2.144.el6
kernel-2.6.32-94.el6

Comment 14 errata-xmlrpc 2011-05-19 13:19:07 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0596.html


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