From nobody Fri May 16 07:47:51 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1496654837002233.08154433461038; Mon, 5 Jun 2017 02:27:17 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B6D29C04F4C1; Mon, 5 Jun 2017 09:27:14 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EC1DA83FE1; Mon, 5 Jun 2017 09:27:13 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 602F14A48C; Mon, 5 Jun 2017 09:27:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v559RAKn001996 for ; Mon, 5 Jun 2017 05:27:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id F3FB68401F; Mon, 5 Jun 2017 09:27:09 +0000 (UTC) Received: from virval.usersys.redhat.com (dhcp129-92.brq.redhat.com [10.34.129.92]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C904B81A7C for ; Mon, 5 Jun 2017 09:27:09 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id A23A810CCFA; Mon, 5 Jun 2017 11:27:04 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B6D29C04F4C1 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com B6D29C04F4C1 From: Jiri Denemark To: libvir-list@redhat.com Date: Mon, 5 Jun 2017 11:26:53 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: Mail-Followup-To: libvir-list@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 05/15] qemu: Rename xml_len in virQEMUSaveHeader as data_len X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 05 Jun 2017 09:27:15 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiri Denemark --- src/qemu/qemu_driver.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index f97d41030..b0d67adc1 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -2805,7 +2805,7 @@ typedef virQEMUSaveHeader *virQEMUSaveHeaderPtr; struct _virQEMUSaveHeader { char magic[sizeof(QEMU_SAVE_MAGIC)-1]; uint32_t version; - uint32_t xml_len; + uint32_t data_len; uint32_t was_running; uint32_t compressed; uint32_t unused[15]; @@ -2815,7 +2815,7 @@ static inline void bswap_header(virQEMUSaveHeaderPtr hdr) { hdr->version =3D bswap_32(hdr->version); - hdr->xml_len =3D bswap_32(hdr->xml_len); + hdr->data_len =3D bswap_32(hdr->data_len); hdr->was_running =3D bswap_32(hdr->was_running); hdr->compressed =3D bswap_32(hdr->compressed); } @@ -2836,7 +2836,7 @@ qemuDomainSaveHeader(int fd, const char *path, const = char *xml, goto endjob; } =20 - if (safewrite(fd, xml, header->xml_len) !=3D header->xml_len) { + if (safewrite(fd, xml, header->data_len) !=3D header->data_len) { ret =3D -errno; virReportError(VIR_ERR_OPERATION_FAILED, _("failed to write xml to '%s'"), path); @@ -3082,7 +3082,7 @@ qemuDomainSaveMemory(virQEMUDriverPtr driver, header.version =3D QEMU_SAVE_VERSION; header.was_running =3D was_running ? 1 : 0; header.compressed =3D compressed; - header.xml_len =3D strlen(domXML) + 1; + header.data_len =3D strlen(domXML) + 1; =20 /* Obtain the file handle. */ if ((flags & VIR_DOMAIN_SAVE_BYPASS_CACHE)) { @@ -6276,16 +6276,16 @@ qemuDomainSaveImageOpen(virQEMUDriverPtr driver, goto error; } =20 - if (header.xml_len <=3D 0) { + if (header.data_len <=3D 0) { virReportError(VIR_ERR_OPERATION_FAILED, - _("invalid XML length: %d"), header.xml_len); + _("invalid XML length: %d"), header.data_len); goto error; } =20 - if (VIR_ALLOC_N(xml, header.xml_len) < 0) + if (VIR_ALLOC_N(xml, header.data_len) < 0) goto error; =20 - if (saferead(fd, xml, header.xml_len) !=3D header.xml_len) { + if (saferead(fd, xml, header.data_len) !=3D header.data_len) { virReportError(VIR_ERR_OPERATION_FAILED, "%s", _("failed to read XML")); goto error; @@ -6629,12 +6629,12 @@ qemuDomainSaveImageDefineXML(virConnectPtr conn, co= nst char *path, goto cleanup; len =3D strlen(xml) + 1; =20 - if (len > header.xml_len) { + if (len > header.data_len) { virReportError(VIR_ERR_OPERATION_FAILED, "%s", _("new xml too large to fit in file")); goto cleanup; } - if (VIR_EXPAND_N(xml, len, header.xml_len - len) < 0) + if (VIR_EXPAND_N(xml, len, header.data_len - len) < 0) goto cleanup; =20 if (lseek(fd, 0, SEEK_SET) !=3D 0) { --=20 2.13.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list