From nobody Thu May 15 13:56:27 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.zohomail.com; dkim=fail; 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 1510080608280357.0330609938078; Tue, 7 Nov 2017 10:50:08 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C56E6C0050CB; Tue, 7 Nov 2017 18:50:06 +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 A0F8E6BF78; Tue, 7 Nov 2017 18:50:06 +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 602B43D385; Tue, 7 Nov 2017 18:50:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vA7Ineah024857 for ; Tue, 7 Nov 2017 13:49:40 -0500 Received: by smtp.corp.redhat.com (Postfix) id 63AD160BEF; Tue, 7 Nov 2017 18:49:40 +0000 (UTC) Received: from mx1.redhat.com (ext-mx06.extmail.prod.ext.phx2.redhat.com [10.5.110.30]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5C80E1B429 for ; Tue, 7 Nov 2017 18:49:38 +0000 (UTC) Received: from mail-qt0-f194.google.com (mail-qt0-f194.google.com [209.85.216.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E2E65267CF for ; Tue, 7 Nov 2017 18:49:37 +0000 (UTC) Received: by mail-qt0-f194.google.com with SMTP id h4so275953qtk.8 for ; Tue, 07 Nov 2017 10:49:37 -0800 (PST) Received: from dawid-fedora.datto.lan ([47.19.105.250]) by smtp.gmail.com with ESMTPSA id t34sm1313175qtb.79.2017.11.07.10.49.36 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Nov 2017 10:49:36 -0800 (PST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C56E6C0050CB Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=fail (p=none dis=none) header.from=datto.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com C56E6C0050CB Authentication-Results: mx1.redhat.com; dkim=fail reason="signature verification failed" (2048-bit key) header.d=datto-com.20150623.gappssmtp.com header.i=@datto-com.20150623.gappssmtp.com header.b="HO1U0u50" DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E2E65267CF Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=pass (p=none dis=none) header.from=datto.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=dzamirski@datto.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com E2E65267CF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datto-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=KG/33TLRfronz8EsbERNrhVK4K/NTNIVpOiWTm3jdA8=; b=HO1U0u50u2YIA1M91GjmOA9CPgjJDYiIQ0h/EoGvQV2cHhWKZQktINSMopup+OM+oK ciUKARU4D34NmPY0TPfSLt7a6ORexxb20jVmpeHDzWFgXxzlBQj8GLNAlvrNM1JvASfX jxB4i4yX2GgthuX7gTSdcYtfO+EqoJ01yDQc731JTO3Y8osuMeMcd1q5QJR6gxzyADKB w7pefEJrdCR4XjaST+zZXJZDGBpa87boGVCNIMac7ygJc2YMhWFrKEh0utV/++5DNZLK J6hNnUztRBj2o6MPkmqgY3LnVmzxh0Nnsell5CyWWrV/rDkTS5Tvif50eQUlhN7Sc8du 0vTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=KG/33TLRfronz8EsbERNrhVK4K/NTNIVpOiWTm3jdA8=; b=RiB1zhc1Fc/DCaKIJCRjP6ou7Shzgyx/sHgiZFAKQwi44KTke91mGpWgKnXwh92R8p ISrN+GcBSVLJbkbrL427BV/M5t487ovilhy/XLo4V2rU36k/qIFFCXwm6NIphwhHcCdV ClBINlVIeDEf8IUC+IHVTflGxUm3nymOQroM7ulGWrzMUlFLeOP9pf2mri5r2FZMRb9M NFhAxJMR6fLR8kFR7TqinSS7qgxVNR9oPiztLCfbmUxoGU022ad5QXfNEwvVD4/apjjE oxiZtQPHTf5AIeRzgyqkGuxPxri9M4OiUzUT2shwCXgjvv5uLAsRTOhv/2ZR0ICqE6Lu WRyA== X-Gm-Message-State: AMCzsaXsB1CR+oSnZmWW7KG9FIcHp2cFgITd9k7pyBCGW0bH8G/fsbSt 5IQNkIJ1h+0yJ/cjpQ1Ytm95frXpIw8= X-Google-Smtp-Source: ABhQp+Tt/BhD1ee7Jwu/Z2RHJkHjVf+RBFWLDFLzP9QsJihFLP6ujHP8rZhxqQE+06ks7yp7uE89SQ== X-Received: by 10.200.7.74 with SMTP id k10mr28229902qth.279.1510080577005; Tue, 07 Nov 2017 10:49:37 -0800 (PST) From: Dawid Zamirski To: libvir-list@redhat.com Date: Tue, 7 Nov 2017 13:49:23 -0500 Message-Id: <20171107184930.12769-7-dzamirski@datto.com> In-Reply-To: <20171107184930.12769-1-dzamirski@datto.com> References: <20171107184930.12769-1-dzamirski@datto.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 07 Nov 2017 18:49:38 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 07 Nov 2017 18:49:38 +0000 (UTC) for IP:'209.85.216.194' DOMAIN:'mail-qt0-f194.google.com' HELO:'mail-qt0-f194.google.com' FROM:'dzamirski@datto.com' RCPT:'' X-RedHat-Spam-Score: 0.469 (DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SORBS_SPAM, SPF_PASS) 209.85.216.194 mail-qt0-f194.google.com 209.85.216.194 mail-qt0-f194.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.30 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 06/13] vbox: Do not free disk definitions on cleanup 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 07 Nov 2017 18:50:07 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Both vboxSnapshotGetReadWriteDisks and vboxSnapshotGetReadWriteDisks do not need to free the def->disks on cleanup because it's being done by the caller via virDomainSnaphotDefFree --- src/vbox/vbox_common.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c index d26ce1bce..79030e36e 100644 --- a/src/vbox/vbox_common.c +++ b/src/vbox/vbox_common.c @@ -5883,13 +5883,8 @@ vboxSnapshotGetReadWriteDisks(virDomainSnapshotDefPt= r def, ret =3D 0; =20 cleanup: - if (ret < 0) { - for (i =3D 0; i < def->ndisks; i++) - VIR_FREE(def->disks[i].src); - VIR_FREE(def->disks); - def->ndisks =3D 0; - } VBOX_RELEASE(snap); + return ret; } =20 @@ -6105,16 +6100,11 @@ vboxSnapshotGetReadOnlyDisks(virDomainSnapshotPtr s= napshot, ret =3D 0; =20 cleanup: - if (ret < 0) { - for (i =3D 0; i < def->dom->ndisks; i++) - virDomainDiskDefFree(def->dom->disks[i]); - VIR_FREE(def->dom->disks); - def->dom->ndisks =3D 0; - } VBOX_RELEASE(disk); VBOX_RELEASE(storageController); gVBoxAPI.UArray.vboxArrayRelease(&mediumAttachments); VBOX_RELEASE(snap); + return ret; } =20 --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list