Bug 638968 - [6.0] 'virsh start' succeeds even if an invalid serial type is specified in an xml file
Summary: [6.0] 'virsh start' succeeds even if an invalid serial type is specified in ...
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: Osier Yang
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-09-30 14:13 UTC by Sadique Puthen
Modified: 2018-11-14 19:48 UTC (History)
6 users (show)

Fixed In Version: libvirt-0.8.7-3.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-05-19 13:22:01 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 Sadique Puthen 2010-09-30 14:13:52 UTC
Description of problem:

"virsh start" succeeds even if a nonexistent serial type (e.g. 'xyz') is
specified in an xml file. If invalid serial types are specified, virsh uses the "null" serial type. Instead it should report and error message to that effect and fail to start the guest.

Version-Release number of selected component:

Red Hat Enterprise Linux Version Number: 6
Release Number: snapshot13
Architecture: x86_64
Kernel Version: kernel-2.6.32-70.el6.x86_64

How reproducible:

always

Steps to Reproduce:

1. Add an invalid serial type and port number to the configuration file.

Eg,

    <serial type='xyz'>
      <target port='0'/>
     </serial>

2. Start the guest

# virsh start rhel6
Domain rhel6 started

3.

# virsh dumpxml rhel6 | grep serial
    <serial type='null'>   -----------------------------------It's this one
      <alias name='serial0'/>
    </serial>
    <serial type='dev'>
      <alias name='serial1'/>
    </serial>
      <alias name='serial0'/>

The invalid serial type specified has been converted to "null". Instead it should fail to start the guest and report the error.
  
Actual results:

Guest successfully starts with virsh even while specifying an invalid serial type.

Expected results:

Guest should fail to start using virsh if an invalid serial type is specified.

Additional info:

Comment 2 Osier Yang 2011-01-11 03:17:16 UTC
patch got pushed upstream:

http://www.redhat.com/archives/libvir-list/2011-January/msg00294.html

Comment 4 Cui Chun 2011-01-21 02:35:52 UTC
Verified. Pass.

Test environment:
libvirt-0.8.7-3.el6
qemu-kvm-0.12.1.2-2.128.el6
kernel-2.6.32-94.el6

Steps:

1. Edit a domain "serial" part in xml file with the invaild serial types.
   The error message can be reported and domain still keeps the original serial type.
  
# virsh  edit cc
error: XML description for unknown type presented to host for character device: # is not well formed or invalid
# virsh  edit cc
error: XML description for unknown type presented to host for character device: abcdfafa is not well formed or invalid
# virsh  edit cc
error: XML description for unknown type presented to host for character device: .... is not well formed or invalid
# virsh  edit cc
error: XML description for unknown type presented to host for character device: pty1 is not well formed or invalid


2. Edit a domain "serial" part in xml file with the vaild serial types. 
   The serial type can be changed to the specified type.

# virsh  edit cc
Domain cc XML configuration edited.

Comment 5 Cui Chun 2011-01-21 08:21:27 UTC
Sorry, qemu-kvm version is qemu-kvm-0.12.1.2-2.129.el6.

Comment 8 errata-xmlrpc 2011-05-19 13:22:01 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.