提交 34f51477 编写于 作者: M Martin Kletzander

minor shmem clean-ups

Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
上级 8f17d0ea
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册