mirror of https://gitee.com/openkylin/libvirt.git
minor shmem clean-ups
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
8f17d0eaae
commit
34f514778b
|
@ -5587,7 +5587,7 @@ qemu-kvm -net nic,model=? /dev/null
|
|||
<p>
|
||||
A shared memory device allows to share a memory region between
|
||||
different virtual machines and the host.
|
||||
<span class="since">Since 1.2.9, QEMU and KVM only</span>
|
||||
<span class="since">Since 1.2.10, QEMU and KVM only</span>
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
|
|
|
@ -17603,7 +17603,7 @@ virDomainShmemDefFormat(virBufferPtr buf,
|
|||
virDomainShmemDefPtr def,
|
||||
unsigned int flags)
|
||||
{
|
||||
virBufferAsprintf(buf, "<shmem name='%s'", def->name);
|
||||
virBufferEscapeString(buf, "<shmem name='%s'", def->name);
|
||||
|
||||
if (!def->size &&
|
||||
!def->server.enabled &&
|
||||
|
@ -17618,8 +17618,7 @@ virDomainShmemDefFormat(virBufferPtr buf,
|
|||
virBufferAdjustIndent(buf, 2);
|
||||
|
||||
if (def->size)
|
||||
virBufferAsprintf(buf, "<size unit='M'>%llu</size>\n",
|
||||
VIR_DIV_UP(def->size, 1024 * 1024));
|
||||
virBufferAsprintf(buf, "<size unit='M'>%llu</size>\n", def->size >> 20);
|
||||
|
||||
if (def->server.enabled) {
|
||||
virBufferAddLit(buf, "<server");
|
||||
|
|
|
@ -7549,7 +7549,7 @@ qemuBuildShmemDevCmd(virCommandPtr cmd,
|
|||
/*
|
||||
* Thanks to our parsing code, we have a guarantee that the
|
||||
* size is power of two and is at least a mebibyte in size.
|
||||
* But because it may change inthe future, the checks are
|
||||
* But because it may change in the future, the checks are
|
||||
* doubled in here.
|
||||
*/
|
||||
if (shmem->size & (shmem->size - 1)) {
|
||||
|
@ -7562,8 +7562,7 @@ qemuBuildShmemDevCmd(virCommandPtr cmd,
|
|||
_("shmem size must be at least 1 MiB"));
|
||||
goto error;
|
||||
}
|
||||
virBufferAsprintf(&buf, ",size=%llum",
|
||||
VIR_DIV_UP(shmem->size, 1024 * 1024));
|
||||
virBufferAsprintf(&buf, ",size=%llum", shmem->size >> 20);
|
||||
}
|
||||
|
||||
if (!shmem->server.enabled) {
|
||||
|
|
Loading…
Reference in New Issue