Bug 589832 - [LXC] Changing current memory works for shutoff guest
[LXC] Changing current memory works for shutoff guest
Status: CLOSED DUPLICATE of bug 586361
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.0
i386 Linux
low Severity medium
: rc
: ---
Assigned To: Daniel Veillard
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-05-06 23:24 EDT by zhanghaiyan
Modified: 2010-12-15 00:06 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-05-10 05:05:23 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description zhanghaiyan 2010-05-06 23:24:06 EDT
Description of problem:
Could change current memory for rhel6 lxc shutoff guest, which should be NOT allowed according to https://bugzilla.redhat.com/show_bug.cgi?id=572474#c5

Version-Release number of selected component (if applicable):
rhel6-server-i386
kernel-2.6.32-24.el6.i686
libvirt-0.8.1-1.el6.i686

How reproducible:
Always

Steps to Reproduce:
1. # virsh define vm1.xml
2. # virsh list --all
 Id Name                 State
----------------------------------
  - vm1                  shut off
3. # virsh dumpxml vm1
<domain type='lxc'>
  <name>vm1</name>
  <uuid>386f5b25-43ee-9d62-4ce2-58c3809e47c1</uuid>
  <memory>400000</memory>
  <currentMemory>300000</currentMemory>
  <vcpu>1</vcpu>
  <os>
    <type arch='i686'>exe</type>
    <init>/bin/sh</init>
  </os>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <emulator>/usr/libexec/libvirt_lxc</emulator>
    <interface type='network'>
      <mac address='52:54:00:f2:2c:ac'/>
      <source network='default'/>
      <target dev='veth0'/>
    </interface>
    <console type='pty'>
      <target port='0'/>
    </console>
  </devices>
</domain>
4. # virsh setmem vm1 350000
5. # virsh dumpxml vml
<domain type='lxc'>
  <name>vm1</name>
  <uuid>386f5b25-43ee-9d62-4ce2-58c3809e47c1</uuid>
  <memory>400000</memory>
  <currentMemory>350000</currentMemory>
  <vcpu>1</vcpu>
..............
6. # virsh start vm1
Domain vm1 started
7. # virsh dumpxml vm1
<domain type='lxc' id='3380'>
  <name>vm1</name>
  <uuid>386f5b25-43ee-9d62-4ce2-58c3809e47c1</uuid>
  <memory>400000</memory>
  <currentMemory>350000</currentMemory>
  <vcpu>1</vcpu>
...........

  
Actual results:
After step4, shutoff guest current memory is changed successfully.

Expected results:
Should not allow to change shutoff guest current memory

Additional info:
Comment 2 RHEL Product and Program Management 2010-05-07 01:26:05 EDT
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 dyuan 2010-05-10 04:04:50 EDT
arch:x86_64, use '-c lxc', the result is different from i386.

# virsh -c lxc:///

virsh # list --all
 Id Name                 State
----------------------------------
  - toy                  shut off

virsh # setmem toy 300000
error: Requested operation is not valid: Domain is not running
Comment 4 Jiri Denemark 2010-05-10 04:58:24 EDT
> arch:x86_64, use '-c lxc', the result is different from i386.
> 
> # virsh -c lxc:///
> 
> virsh # list --all
>  Id Name                 State
> ----------------------------------
>   - toy                  shut off
> 
> virsh # setmem toy 300000
> error: Requested operation is not valid: Domain is not running    

I guess you have a newer libvirt (libvirt-0.8.1-2.el6), right?
Comment 5 Jiri Denemark 2010-05-10 05:05:23 EDT
This was already fixed by the patch set which improved error handling in lxc driver (bug 586361)

*** This bug has been marked as a duplicate of bug 586361 ***
Comment 6 zhanghaiyan 2010-05-11 03:22:37 EDT
This bug is verified PASS with libvirt-0.8.1-2.el6.i686 by lxc on
rhel6-server-i386 (kernel-2.6.32-24.el6.i686)

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