From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49287) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0UBZ-00040m-7B for qemu-devel@nongnu.org; Mon, 15 Dec 2014 06:51:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y0UBR-0002YT-Ir for qemu-devel@nongnu.org; Mon, 15 Dec 2014 06:51:33 -0500 Received: from relay.parallels.com ([195.214.232.42]:57447) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0UBR-0002Y6-BF for qemu-devel@nongnu.org; Mon, 15 Dec 2014 06:51:25 -0500 Message-ID: <548ECB31.4010306@openvz.org> Date: Mon, 15 Dec 2014 14:51:13 +0300 From: "Denis V. Lunev" MIME-Version: 1.0 References: <1418632081-20667-1-git-send-email-den@openvz.org> <1418632081-20667-3-git-send-email-den@openvz.org> <20141215104515.GB4411@noname.str.redhat.com> In-Reply-To: <20141215104515.GB4411@noname.str.redhat.com> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 02/16] block/parallels: allow to specify DiskDescriptor.xml instead of image file List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: Jeff Cody , qemu-devel@nongnu.org, Stefan Hajnoczi On 15/12/14 13:45, Kevin Wolf wrote: > Am 15.12.2014 um 09:27 hat Denis V. Lunev geschrieben: > > An explicit error check should make gcc happy and would also improve the > error message for corrupt images without such an element (currently > "Parallels images with snapshots are not supported"). > >> + for (size = 0; image != NULL; image = image->next) { >> + if (image->type != XML_ELEMENT_NODE) { >> + continue; >> + } >> + >> + size++; >> + data = xml_get_text(image, "Type", NULL); >> + if (data != NULL && strcmp(data, "Compressed")) { >> + error_setg(errp, "Only compressed Parallels images are supported"); >> + goto done; >> + } > Does a spec for the format exist that I could check the code against? > > This seems to imply that the default, if no "Type" element exists, is > compressed images. Correct? Unfortunately, there is no formal spec in my hands. The check itself is made to avoid "Plain" Parallels image. I have consulted with the original author and from his opinion the check was made "just to ensure". Images without this element was never seen by him and by me. As for the rest of your comments, "sure, will fix on next submission". Thank you for the prompt reply. Regards, Den