From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53264) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wvfvk-0008WV-5R for qemu-devel@nongnu.org; Sat, 14 Jun 2014 00:51:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wvfve-0000hv-0b for qemu-devel@nongnu.org; Sat, 14 Jun 2014 00:51:04 -0400 Received: from [59.151.112.132] (port=33998 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wvfvd-0000h4-Kz for qemu-devel@nongnu.org; Sat, 14 Jun 2014 00:50:57 -0400 From: Hu Tao Date: Sat, 14 Jun 2014 12:48:55 +0800 Message-ID: In-Reply-To: <20140613085417.GC2414@redhat.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PATCH RFC 0/4] fixes for pci tree List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Yasunori Goto , Paolo Bonzini , Igor Mammedov , "Michael S. Tsirkin" Michael, This is fixes for your pci tree. patch 1 remove signed range as requested. There are 3 problems in current pci tree, as follows: 1. pc-dimm specified on command line but only -m size (aka not -m size,maxmem,slots) ./x86_64-softmmu/qemu-system-x86_64 -hda /home/data/libvirt-images/f18.img -smp 2 -object memory-backend-ram,size=512M,id=ram-node0,prealloc=y,policy=bind,host-nodes=0 -device pc-dimm,id=d0,memdev=ram-node0 -m 640M -qmp unix:/tmp/m,server,nowait -monitor stdio -enable-kvm result: qemu/hw/mem/pc-dimm.c:110: pc_dimm_get_free_addr: Assertion `address_space_end > address_space_size' failed. Aborted (core dumped) patch 2 fixes this. 2. using qemu monitor command object-add to add a memory-backend-ram object whose's size is too big ./x86_64-softmmu/qemu-system-x86_64 -hda /home/data/libvirt-images/f18.img -smp 2 -m 512M -qmp unix:/tmp/m,server,nowait -monitor stdio -enable-kvm in monitor: (qemu)object_add memory-backend-ram,size=40960G,id=mem0 result: qemu just exits with message: Cannot set up guest memory 'mem0': Cannot allocate memory patch 3 fixes this. 3. specifying a non-existing directory for memory-backend-file ./x86_64-softmmu/qemu-system-x86_64 -hda /home/data/libvirt-images/f18.img -smp 2 -m 512M,maxmem=1000G,slots=100 -qmp unix:/tmp/m,server,nowait -monitor stdio -enable-kvm -object memory-backend-file,size=512M,id=mem0,mem-path=/nonexistingdir -device pc-dimm,id=d0,memdev=mem0 result: /nonexistingdir: No such file or directory Bad ram offset fffffffffffff000 Aborted (core dumped) patch 4 fixes this. please review. Thanks! Hu Tao (4): get rid of signed range check if we have space left for hotplugged memory exec: don't exit unconditionally if failed to allocate memory memory-backend-file: error out if failed to allocate memory backends/hostmem-file.c | 3 + backends/hostmem-ram.c | 3 + exec.c | 6 +- hw/mem/pc-dimm.c | 7 +- include/qemu/range.h | 144 ++++++++++++------------------------- qapi/string-input-visitor.c | 116 +++++++++++++++++------------- qapi/string-output-visitor.c | 97 +++++++++++++------------ tests/test-string-input-visitor.c | 4 +- tests/test-string-output-visitor.c | 8 +-- 9 files changed, 182 insertions(+), 206 deletions(-) -- 1.9.3