Bug 1024703

Summary: Feature state attribute of off in the virtual image descriptor doesn't work.
Product: Red Hat Enterprise Linux 7 Reporter: hyao <hyao>
Component: virt-managerAssignee: Giuseppe Scrivano <gscrivan>
Status: CLOSED UPSTREAM QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: codong, cwei, dallan, dyuan, lcui, mzhan, tzheng, zsong
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1024700 Environment:
Last Closed: 2014-04-18 10:32:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1024700    
Bug Blocks:    

Description hyao@redhat.com 2013-10-30 09:41:17 UTC
Clone the bug to rhel7 due to reproduce it with packages: 

# rpm -qa libvirt virt-manager
libvirt-1.1.1-10.el7.x86_64
virt-manager-0.10.0-4.el7.noarch


+++ This bug was initially created as a clone of Bug #1024700 +++

Description
Feature state attribute of off in the virtual image descriptor doesn't work.
Version:
# rpm -qa python-virtinst libvirt
python-virtinst-0.600.0-18.el6.noarch
libvirt-0.10.2-29.el6.x86_64


How reproducible:
100%

Steps to Reproduce:
1.Prepare a virtual image XML descriptor file with feature acpi and apic state off included.
# cat image.xml
<image>
<name>do1</name>
<domain>
<boot type="hvm">
<guest>
<arch>x86_64</arch>
<feature>
    <acpi state="off"/>
    <apic state="off"/>
</feature>
</guest>
<os>
...
</image>

2. Create a virtual machine from image.xml
#virt-image  image.xml

3. Check the domain configuration file
# virsh dumpxml do1
<domain type='kvm' id='88'>
  <name>do1</name>
  <uuid>0fb9974d-05e4-a326-d5d4-be768e644278</uuid>
  <memory unit='KiB'>262144</memory>
  <currentMemory unit='KiB'>262144</currentMemory>
  <vcpu placement='static'>1</vcpu>
  <os>
    <type arch='x86_64' machine='rhel6.5.0'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
....


4. Check the feature description in manual.
#man 5 virt-image
...
           The features element indicates whether certain platform features should be on or off. Currently, the platform
           features are pae, acpi, and apic. They can be turned on or off by giving a state attribute of either "on" or "off".
           When a feature is mentioned in the features element, it defaults to "on".

5. Destroy and undefine the domain do1. Turn off the feature by  --noapic and --noacpi options.
# virt-image --noapic --noacpi image.xml
Creating guest do1...
Creating domain...                                       |    0 B     00:00    

# virsh dumpxml do1
<domain type='kvm' id='89'>
  <name>do1</name>
  <uuid>9e1b44a0-a97e-b395-eaf8-2662c474475f</uuid>
  <memory unit='KiB'>262144</memory>
  <currentMemory unit='KiB'>262144</currentMemory>
  <vcpu placement='static'>1</vcpu>
  <os>
    <type arch='x86_64' machine='rhel6.5.0'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <pae/>
  </features>


Actual results:
State attribute of off in the virtual image descriptor doesn't work for virt-image, and --noapic and --noacpi options work well.

Expected results:
According to the description in the manual 5, state attribute of off in the virtual image descriptor doesn't work for virt-image

Additional info:

Comment 3 Giuseppe Scrivano 2014-04-18 10:32:16 UTC
fixed upstream by:

commit 8c5b1de33c4e10684a2840e0eddcfd8b851abb74
Author: Giuseppe Scrivano <gscrivan>
Date:   Wed Jan 29 12:50:51 2014 +0100

    doc: do not mention state="on|off" for features
    
    Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1024700
    
    Signed-off-by: Giuseppe Scrivano <gscrivan>