Description of problem: When use "virsh restore vm.img --xml vm.xml" to restore vm, if vm.xml size is over 8192, command will fail with error "Value too large for defined data type" Version-Release number of selected component (if applicable): all versions How reproducible: restore a vm with "virsh restore vm.img --xml vm.xml", while vm.xml size is over 8192. Actual results: command will fail with error "Value too large for defined data type" Expected results: command succeeds Additional info: in tools/virsh-domain.c:4768,virFileReadAll(xmlfile, 8192, &xml) < 0,the second parameter is too small, shall use "VSH_MAX_XML_FILE" constant instead.
I've proposed a fix upstream: http://www.redhat.com/archives/libvir-list/2014-October/msg00427.html
Fixed upstream: commit 4d1852c48541a29e3c47caf0f2b801dfcb6579db Author: Peter Krempa <pkrempa> Date: Tue Oct 14 10:04:31 2014 +0200 virsh: domain: Use global constant for XML file size limit Few places still used hardcoded limit for maximum XML size for commands that accept XML files. The hardcoded limits ranged from 8k to 1M. Use VSH_MAX_XML_FILE to express this limit in a unified way. This will bump the limit for the commands that used hardcoded string lengths to 10M. The patch will be part of the next release.