<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=x-gbk" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
On 12/23/2011 10:14 AM, hero wrote:
<blockquote
cite="mid:5e1629f4.3499.13468b30e70.Coremail.515801610@163.com"
type="cite">
<div style="line-height: 1.7; color: rgb(0, 0, 0); font-size:
14px; font-family: arial;">
<div>hello everyone:</div>
<div>during the days I use kvm,I have got some questions I want
to know,please read the following questions.</div>
<div> </div>
<div>1.When a kvm VM is running, I use 'virsh setvcpus
<domain> <count>' to change the cpu numbers of the
VM, and when I use 'virsh dumpxml <domain>',there is a
change from '<vcpus>count</vcpus>' to '<vcpus
current="currentcount">count</vcpus>', just because
of this I can't start the VM after I shutdown it. could you
help me about this.</div>
</div>
</blockquote>
It works well for me, the guest can be successfully started after
shutdowning, what's the libvirt version? <br>
<blockquote
cite="mid:5e1629f4.3499.13468b30e70.Coremail.515801610@163.com"
type="cite">
<div style="line-height: 1.7; color: rgb(0, 0, 0); font-size:
14px; font-family: arial;">
<div>2. when I use "virsh setmaxmem <domain>
<value>" to change the max memory of the kvm VM, it says
"error: Unable to change MaxMemorySize<br>
error: this function is not supported by the connection
driver: virDomainSetMaxMemory", I want to know if libvirt has
bugs or not.</div>
</div>
</blockquote>
Also work for me, for a running domain, will meet the following
error as expected:<br>
<br>
# virsh setmaxmem vr-rhel5u7-x86_64-kvm 1048576<br>
error: Unable to change MaxMemorySize<br>
error: Requested operation is not valid: cannot resize the maximum
memory on an active domain<br>
<br>
For a inactive domain, original Max memory is 524288 kB, the change
is valid:<br>
<br>
# virsh dominfo vr-rhel5u7-x86_64-kvm<br>
Id: -<br>
Name: vr-rhel5u7-x86_64-kvm<br>
UUID: 663ce18a-e257-2b05-91ae-fe29381b3a2f<br>
OS Type: hvm<br>
State: shut off<br>
CPU(s): 3<br>
Max memory: 1048576 kB<br>
Used memory: 524288 kB<br>
Persistent: yes<br>
Autostart: disable<br>
Managed save: no<br>
Security model: selinux<br>
Security DOI: 0<br>
<blockquote
cite="mid:5e1629f4.3499.13468b30e70.Coremail.515801610@163.com"
type="cite">
<div style="line-height: 1.7; color: rgb(0, 0, 0); font-size:
14px; font-family: arial;">
<div>3.It works fine except I reboot the VM after I use "virsh
setmem <domain> <value>" to change the kvm VM boot
memory, for example, I change the memory 3000000k, but it can
not save the value the next time to reboot.</div>
</div>
</blockquote>
You should see options family of virsh setmem such as --live,
--config and --current:<br>
<br>
--config affect next boot
Note: it is a option what you want. <br>
--live affect running domain<br>
--current affect current domain<br>
<br>
<br>
Good Luck!<br>
Alex<br>
<blockquote
cite="mid:5e1629f4.3499.13468b30e70.Coremail.515801610@163.com"
type="cite">
<div style="line-height: 1.7; color: rgb(0, 0, 0); font-size:
14px; font-family: arial;">
<div> </div>
<div>Best wishes and Merry Christmas!</div>
<div>SunYongGang</div>
</div>
<br>
<br>
<span title="neteasefooter"><span id="netease_mail_footer"></span></span>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
--
libvir-list mailing list
<a class="moz-txt-link-abbreviated" href="mailto:libvir-list@redhat.com">libvir-list@redhat.com</a>
<a class="moz-txt-link-freetext" href="https://www.redhat.com/mailman/listinfo/libvir-list">https://www.redhat.com/mailman/listinfo/libvir-list</a></pre>
</blockquote>
<br>
</body>
</html>