From nobody Sat May 4 16:20:53 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1592482455; cv=none; d=zohomail.com; s=zohoarc; b=BeFa5/LNHiahvefPGldlbVQYJLMJpa+/MAqKAeOspRcGROa4Y4kKix4wAfbypUrsbF3zmf7J987FLeg7aeTZEMt+B6m+rKKaUjd0sEGiK3SXKC3xUmexVTAM0dSHxuixr+NaGqLZnDi3iMd6bYqGyWRnhpxTy0z76ZKDOUm2ccA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592482455; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=TeOYv/pYI+vPdpedLlmMwVxvN6VRW217E1Tbrvk3obI=; b=IJAiXuhadcSQTvxM4eVOoUtHnkZ9KTmNxsm4jX9mHaRL3x4AYEEnPO3Qn9P039Y0qxOLF7gOH0nR1htSKY0qVD/jrKvA82Di/PNqja/5k1z2MqyukS+YRaEdj2/PARcpqv+HDPlthcNX1PyCcKpU+RhzlCDMlAPRchFEoqNA5Zw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1592482455288642.9296156590952; Thu, 18 Jun 2020 05:14:15 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-297-hHNxiqF8OuCoxyJc2wzJWA-1; Thu, 18 Jun 2020 08:14:11 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E0D9C872FE1; Thu, 18 Jun 2020 12:14:05 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 585E919C79; Thu, 18 Jun 2020 12:14:05 +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 5622B1809547; Thu, 18 Jun 2020 12:14:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05ICE0AF024493 for ; Thu, 18 Jun 2020 08:14:00 -0400 Received: by smtp.corp.redhat.com (Postfix) id D5AD97931E; Thu, 18 Jun 2020 12:14:00 +0000 (UTC) Received: from lpt.redhat.com (unknown [10.40.208.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4C65D90324 for ; Thu, 18 Jun 2020 12:13:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592482454; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=TeOYv/pYI+vPdpedLlmMwVxvN6VRW217E1Tbrvk3obI=; b=gaYzB0tkgbLpa25sywD2PZvqS4AzoYiGOlAuHzfXPnvFbyixY+pgGyQugo4Bml6q/+N10E yVzhzcPJ6y43MwlJ6CyDom1RBjMvIUPFxe2JN2CiaW5g+TlrE9/S/mYygADQllQVp9eJam z0fnMxzh5WTCT14XadVmqKvFTzFZH3g= X-MC-Unique: hHNxiqF8OuCoxyJc2wzJWA-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH] Fix allocation of virDomainFSDef Date: Thu, 18 Jun 2020 14:13:53 +0200 Message-Id: <98906af921c2ec516ce84eddcde4a9f69a22629e.1592482374.git.jtomko@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Some less commonly used drivers were omitted when we switched the allocator from a plain VIR_ALLOC to virDomainFSDefNew. Signed-off-by: J=C3=A1n Tomko Fixes: da665fbd4858890fbb3bbf5da2a7b6ca37bb3220 https://bugzilla.redhat.com/show_bug.cgi?id=3D1846450 --- src/openvz/openvz_conf.c | 2 +- src/vbox/vbox_common.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c index 190c57b622..db3df5ed5a 100644 --- a/src/openvz/openvz_conf.c +++ b/src/openvz/openvz_conf.c @@ -357,7 +357,7 @@ openvzReadFSConf(virDomainDefPtr def, goto error; } =20 - if (VIR_ALLOC(fs) < 0) + if (!(fs =3D virDomainFSDefNew(NULL))) goto error; =20 veid_str =3D g_strdup_printf("%d", veid); diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c index 85935ba731..15f8eb074a 100644 --- a/src/vbox/vbox_common.c +++ b/src/vbox/vbox_common.c @@ -3626,7 +3626,7 @@ vboxDumpSharedFolders(virDomainDefPtr def, vboxDriver= Ptr data, IMachine *machine char *hostPath =3D NULL; PRBool writable =3D PR_FALSE; =20 - if (VIR_ALLOC(def->fss[i]) < 0) + if (!(def->fss[i] =3D virDomainFSDefNew(data->xmlopt))) goto cleanup; =20 def->fss[i]->type =3D VIR_DOMAIN_FS_TYPE_MOUNT; --=20 2.25.4