diff options
author | David Hildenbrand <david@redhat.com> | 2018-12-14 14:10:43 +0100 |
---|---|---|
committer | Eduardo Habkost <ehabkost@redhat.com> | 2019-01-09 22:09:31 -0200 |
commit | e3213eb5ecd541f182e1a5a719feed99d6b225af (patch) | |
tree | c41f6b9d9afbd6580322c9ae6b9c2293fdc99c1f /qemu-nbd.c | |
parent | f3b0b626f615c6155d0cbb2f1781e1d1476144fc (diff) | |
download | qemu-e3213eb5ecd541f182e1a5a719feed99d6b225af.zip qemu-e3213eb5ecd541f182e1a5a719feed99d6b225af.tar.gz qemu-e3213eb5ecd541f182e1a5a719feed99d6b225af.tar.bz2 |
memory-device: rewrite address assignment using ranges
Let's rewrite it properly using ranges. This fixes certain overflows that
are right now possible. E.g.
qemu-system-x86_64 -m 4G,slots=20,maxmem=40G -M pc \
-object memory-backend-file,id=mem1,share,mem-path=/dev/zero,size=2G
-device pc-dimm,memdev=mem1,id=dimm1,addr=-0x40000000
Now properly errors out instead of succeeding. (Note that qapi
parsing of huge uint64_t values is broken and fixes are on the way)
"can't add memory device [0xffffffffa0000000:0x80000000], usable range for
memory devices [0x140000000:0xe00000000]"
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20181214131043.25071-3-david@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'qemu-nbd.c')
0 files changed, 0 insertions, 0 deletions