From nobody Mon May 6 08:40:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1574244126; cv=none; d=zoho.com; s=zohoarc; b=I0UnQe7KrnnPPMq0fFlRoo8fgaUDffqdR9ec+OA1UvRh0pqGS2ieO7EZwN5DnqhWnZ+X3lLnWThPY4MCGO5MqmD8m5eg4XyuellUGkfw1fl0kMBSnraA0/5Mjrf9DpMVYXTi2GCxm3dyLxPCoY+UkC5n9b9VS0tpCi8OaoaXH6s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1574244126; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=oarDnP90Afnb43mO4u2yKQgzH/TrOzm1gjqPWa9S4BA=; b=R7g4R/YldHkaUV7fWvIvJXJv+mdkUyGtuT34Sx9U8HW5xvlX660soynj8IIquvweLA1EXUclmPBCuSDnHGZ2mIuWjBWmLQ4gg05QQmtfq3TwZrfBT5Gwwr/ETP76/0llBzakE9qBwn3uHpnl7GsiC/mk9sg2XZOkfXxoeLqQ4U4= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1574244126872271.27379979612317; Wed, 20 Nov 2019 02:02:06 -0800 (PST) Received: from localhost ([::1]:55406 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iXMoH-0006Cj-P9 for importer@patchew.org; Wed, 20 Nov 2019 05:02:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49512) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iXMlx-0003jV-OB for qemu-devel@nongnu.org; Wed, 20 Nov 2019 04:59:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iXMlw-0004id-KS for qemu-devel@nongnu.org; Wed, 20 Nov 2019 04:59:41 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:27742 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iXMlw-0004i1-GO for qemu-devel@nongnu.org; Wed, 20 Nov 2019 04:59:40 -0500 Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-158-65zqoU0HPuKmRQV__Ywj3w-1; Wed, 20 Nov 2019 04:59:38 -0500 Received: by mail-qt1-f198.google.com with SMTP id x50so16740478qth.4 for ; Wed, 20 Nov 2019 01:59:38 -0800 (PST) Received: from redhat.com (bzq-79-176-6-42.red.bezeqint.net. [79.176.6.42]) by smtp.gmail.com with ESMTPSA id p59sm13945623qtd.2.2019.11.20.01.59.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Nov 2019 01:59:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574243979; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oarDnP90Afnb43mO4u2yKQgzH/TrOzm1gjqPWa9S4BA=; b=BY1AejRafo0ae4SUow8+XRgkPBlJcLSzYx/YyQrHHL7qlWCF3kcM5YwouV7miAx+CxFYjW Ne7Ml8CofXkj4v11dsGleTj7+LK7HTZuk05H2yCW+rG/4KuVwrrdcSdJCvXz4i5rV6kN1L DKOW2Okda0/kpIDTvYRxnuD9PplykNA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=3AVbLd6xjAB+NFS8fzE/fQA+6B5PATtOwgAshllb0wE=; b=OwIdoa3hltuEomEHvQjoXSftQSfqB+dp00McKovTBPqQpZnIVOXWWNANwAmwz1q+gz HXzMsJIcX5fjf0EUjNMqDfLT2rXBvrjPHRtxuzNuCuhkGNnbq/mpD7Ea6akeudUr0+/o Nngh/g5i5MLfVP49WRGV/iMQh0t9AQrofomN7EqolMTFH5SpWukTsRtMf8o0AiSOpVMp bjxloxxcim0X45JVBugB//CF5OQPkHXk1MsRXi5d18ChQhudg5aELry4qbp/JE+VhZW6 5dXuM3+c5dExYclEcfMgaZLn6K8RPeXyiqhxH4th5jdnvf0W9uVOB8HpBUIL3YGIvH1k r3Uw== X-Gm-Message-State: APjAAAWPN+SG5tOFfK2bPdhXihfQVCmXwRbZ7oU+TIyrePfKwz8ic87x oeINyLb3OIB5RUC4dQlewcSE5WsBEicWyjTd4nEEXxa4kvzVaingzdk8oKVUo7Sah4zMEXBKRzJ W03g/wJBUrhwdxCs= X-Received: by 2002:ac8:6bd9:: with SMTP id b25mr1739559qtt.295.1574243977495; Wed, 20 Nov 2019 01:59:37 -0800 (PST) X-Google-Smtp-Source: APXvYqwaiVgul7wa2lB1BaRr2O9QMlmBf+3jyAeSOOLLuchvCrd62ve+1hvxDkOBmMDqr29s2f+dLA== X-Received: by 2002:ac8:6bd9:: with SMTP id b25mr1739553qtt.295.1574243977353; Wed, 20 Nov 2019 01:59:37 -0800 (PST) Date: Wed, 20 Nov 2019 04:59:32 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 1/3] libvhost-user: Zero memory allocated for VuVirtqInflightDesc Message-ID: <20191120095904.11384-2-mst@redhat.com> References: <20191120095904.11384-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20191120095904.11384-1-mst@redhat.com> X-Mailer: git-send-email 2.22.0.678.g13338e74b8 X-Mutt-Fcc: =sent X-MC-Unique: 65zqoU0HPuKmRQV__Ywj3w-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 205.139.110.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Xie Yongji , Zhang Yu , Gerd Hoffmann , =?utf-8?Q?Marc-Andr=C3=A9?= Lureau Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Xie Yongji Use a zero-initialized VuVirtqInflightDesc struct to avoid that scan-build reports that vq->resubmit_list[0].counter may be garbage value in vu_check_queue_inflights(). Fixes: 5f9ff1eff ("libvhost-user: Support tracking inflight I/O in shared memory") Reported-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Xie Yongji Message-Id: <20191119075759.4334-1-xieyongji@baidu.com> Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- contrib/libvhost-user/libvhost-user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/libvhost-user/libvhost-user.c b/contrib/libvhost-user/= libvhost-user.c index 68c27136ae..ec27b78ff1 100644 --- a/contrib/libvhost-user/libvhost-user.c +++ b/contrib/libvhost-user/libvhost-user.c @@ -992,7 +992,7 @@ vu_check_queue_inflights(VuDev *dev, VuVirtq *vq) vq->shadow_avail_idx =3D vq->last_avail_idx =3D vq->inuse + vq->used_i= dx; =20 if (vq->inuse) { - vq->resubmit_list =3D malloc(sizeof(VuVirtqInflightDesc) * vq->inu= se); + vq->resubmit_list =3D calloc(vq->inuse, sizeof(VuVirtqInflightDesc= )); if (!vq->resubmit_list) { return -1; } --=20 MST From nobody Mon May 6 08:40:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1574244231; cv=none; d=zoho.com; s=zohoarc; b=Nx2yxpmzp/KxQHqzL7+5q54a2Q7hBjccW4GUO9nE2cr5Wn+8KqnTSP40EFCVmioOtLAaiIUqsq6SK8hyA5U03uQ1CRZ//vRV1rIdXmVz5kOx83U4O3ByLgA/R7zQFVjN4QJIRIrOLHQxyFxb9DFjXx84BGAaijSMLjUG6ir4A+s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1574244231; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=1N0YO9aq8dPMLduzr+NixeVuzUQBBWmON9U10Qp9kz8=; b=bISzt/2eTomUpyVDmgPXZNzQZ8SLVCQqMIeECamxPopkHNLPu5y2w16A1XLCQnfzy5+JIvfgEtiJix6Dk8V0oal3+1/IzQsK9CXL7VoWUzRDSTVXr2WSGoUe8iGNFJ0HnVyaOP5o8lTO5fvgxIZXrCJxiN8OH2ZwLA2URmrQVHc= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1574244231431752.4127707881042; Wed, 20 Nov 2019 02:03:51 -0800 (PST) Received: from localhost ([::1]:55534 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iXMpx-0007tR-Fy for importer@patchew.org; Wed, 20 Nov 2019 05:03:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50491) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iXMpE-0007Bi-A8 for qemu-devel@nongnu.org; Wed, 20 Nov 2019 05:03:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iXMpD-00072k-B6 for qemu-devel@nongnu.org; Wed, 20 Nov 2019 05:03:04 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:29515 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iXMpD-00072S-7A for qemu-devel@nongnu.org; Wed, 20 Nov 2019 05:03:03 -0500 Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-175-UGAP9IPKOYSbI54x7D4wow-1; Wed, 20 Nov 2019 04:59:43 -0500 Received: by mail-qt1-f199.google.com with SMTP id h15so16692216qtn.6 for ; Wed, 20 Nov 2019 01:59:43 -0800 (PST) Received: from redhat.com (bzq-79-176-6-42.red.bezeqint.net. [79.176.6.42]) by smtp.gmail.com with ESMTPSA id m186sm634642qkc.39.2019.11.20.01.59.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Nov 2019 01:59:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574244182; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1N0YO9aq8dPMLduzr+NixeVuzUQBBWmON9U10Qp9kz8=; b=MLxH4U2HQT5gzd4cVsnbjrePREWpjVMO6KGm+O6xF11j4N5hP2t5bNSraaAcH4ZDGdP4jV 1/TMhjqhwRGxCAApBJTK1NXb4gJpKsAFnX4LfA+fn8DOc/Jrk8bHcNssAe/GRW+PCMO2Mq LKtwXQCId8LDOhv/2p1KCSbhQgon2eM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=OQFdwkIthF4kIPw5/zTWhuJUEuuTMGScbyEP0azu+ZE=; b=BEbshRgd41idHM4uKO1wbW5b742gJID9k4zI1ClBgVFjzHoOXW6DkKNcMgikZZcwF/ 9KO/4ku7G+gVMTGg/NzllYN9sZd4jbHD2j9RL0XbeHBPoaQ6HYasown1Y/x60hFbEVMX uIsalWrs3b4v2EVRieQvwXu/esvgBW2zkUOQcAiJREjIPtaPPL+9TXuX2hKsWNfNCrCg akL7N6aDO+6QiY0VNNOUYm7wNW21sTK88l5JD7GS2XyyHgIV4Ik3y68/VNefVRaZXvaL USgOUAr4MiApKVfgY9bZE2w54kA6FhQRkkbjfOOteEroYOai4jpwBs5grR0YUIG+KsQN evPw== X-Gm-Message-State: APjAAAUSdrTeH1DFR/6oN4KZRo0igNZi3B3vPXLKZ9OiXKZBfzpQThwq 7zdVAu816/K4NYGpMZWSBNJ7xT+CBSFhGMRY63PYMUERv0vFxyg/grn674v6PNrOXNMXwrKmr2d QE+Bsf7CNJmHEfOQ= X-Received: by 2002:ac8:53c1:: with SMTP id c1mr1702393qtq.328.1574243982692; Wed, 20 Nov 2019 01:59:42 -0800 (PST) X-Google-Smtp-Source: APXvYqwi6pSI+nCkSX+Xo7OQWjcSYlb7mj5Ad8yKiZozFAemOMhtyZA/hEpop2vEmDwBfySsI6FmzA== X-Received: by 2002:ac8:53c1:: with SMTP id c1mr1702382qtq.328.1574243982542; Wed, 20 Nov 2019 01:59:42 -0800 (PST) Date: Wed, 20 Nov 2019 04:59:37 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 2/3] vhost-user-input: use free(elem) instead of g_free(elem) Message-ID: <20191120095904.11384-3-mst@redhat.com> References: <20191120095904.11384-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20191120095904.11384-1-mst@redhat.com> X-Mailer: git-send-email 2.22.0.678.g13338e74b8 X-Mutt-Fcc: =sent X-MC-Unique: UGAP9IPKOYSbI54x7D4wow-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 205.139.110.61 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Gerd Hoffmann , Stefan Hajnoczi Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Stefan Hajnoczi The virtqueue element returned by vu_queue_pop() is allocated using malloc(3) by virtqueue_alloc_element(). Use the matching free(3) function instead of glib's g_free(). Signed-off-by: Stefan Hajnoczi Message-Id: <20191119111626.112206-1-stefanha@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- contrib/vhost-user-input/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/vhost-user-input/main.c b/contrib/vhost-user-input/mai= n.c index 449fd2171a..ef4b7769f2 100644 --- a/contrib/vhost-user-input/main.c +++ b/contrib/vhost-user-input/main.c @@ -77,7 +77,7 @@ static void vi_input_send(VuInput *vi, struct virtio_inpu= t_event *event) len =3D iov_from_buf(elem->in_sg, elem->in_num, 0, &vi->queue[i].event, sizeof(virtio_input_eve= nt)); vu_queue_push(dev, vq, elem, len); - g_free(elem); + free(elem); } =20 vu_queue_notify(&vi->dev.parent, vq); @@ -153,7 +153,7 @@ static void vi_handle_sts(VuDev *dev, int qidx) 0, &event, sizeof(event)); vi_handle_status(vi, &event); vu_queue_push(dev, vq, elem, len); - g_free(elem); + free(elem); } =20 vu_queue_notify(&vi->dev.parent, vq); --=20 MST From nobody Mon May 6 08:40:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1574244068; cv=none; d=zoho.com; s=zohoarc; b=fdEVralCktir9hyotpWyuBj5Zik7rIsQVVHaKZjipXT6Vuf5sWfBRTQgZHEdJupTJXjvIzYLXI4ogBYylviK2Opw5S0oODUmLejyYPOpij6LCq9NYk/3l8rPBg/sVbV7mo+5FgPJtxaCuNT4mBK25hiz4g3r4vxRxddVgkp5dTA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1574244068; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=BZskGUfyn7jaYYd2DvEDC0RMUYMrzQsxfievlb9z0CI=; b=ZowkC7DI71/OHkhlZlrGqYlmqOuKxu+XYR01gKHG4NTYlHEBqJdTiXH2I8JBcMtfK11M2pkFX+mSVAGrzlQM7A8SRXuvv1cX+5KbM2LpSjUIVwEiBTadRXbFIpCHnoFTwA2393PIWzqNuKpyok4QWP4aDxMTMFbDSyFXxM23SF0= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1574244068235184.7745982973271; Wed, 20 Nov 2019 02:01:08 -0800 (PST) Received: from localhost ([::1]:55398 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iXMnL-0004tx-3P for importer@patchew.org; Wed, 20 Nov 2019 05:01:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:49569) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iXMm7-0003sf-Kc for qemu-devel@nongnu.org; Wed, 20 Nov 2019 04:59:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iXMm6-0004qb-L7 for qemu-devel@nongnu.org; Wed, 20 Nov 2019 04:59:51 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:56578 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iXMm6-0004qO-HX for qemu-devel@nongnu.org; Wed, 20 Nov 2019 04:59:50 -0500 Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-213-gtZULBH2MjGt6fOweS5Duw-1; Wed, 20 Nov 2019 04:59:48 -0500 Received: by mail-qt1-f199.google.com with SMTP id r12so16664567qtp.21 for ; Wed, 20 Nov 2019 01:59:48 -0800 (PST) Received: from redhat.com (bzq-79-176-6-42.red.bezeqint.net. [79.176.6.42]) by smtp.gmail.com with ESMTPSA id z3sm13956555qtu.83.2019.11.20.01.59.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Nov 2019 01:59:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574243990; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BZskGUfyn7jaYYd2DvEDC0RMUYMrzQsxfievlb9z0CI=; b=Zy11f+mpwhOMAd9e3CN5girSX5C/OkkTqwdYmbd0KQvkQZsnUEN7AsxtNNedHRg1fuBeXH imfS+Auuf6px9ma9N+bEpPYafcIyHdLODMkZ2a4SCAKDgTUBL4ZM5es7UjMLL80PhszYh9 PGgfz9qJCAIwcJAziIlbhNsoYmlXz9o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=udlnRDFsi+KkBvtwSXFal5HYXw9hrZuZTWTmkZClDRA=; b=d0mtSZjPOrkLqGHOIKT+cKQqDEqR40Ww+yweniuoUoq6T54ZPU/VitKZQhp29jpeVd heW9K2tHlu7uxaK8zTIPNUNlhQL7+Ks6A5MvpYlJwrG6z+Wm2BW6MvsdMmqB9SPbQaNK W24UVsDo2LJcAsw2+xyaQmOQrSbRv4Eoa70A4dWjKiQr8g6X8jyrbUqloRazQeIbUxqd vsgOfQmj7lbQ3DwzZOSiMc3JiY6U0r1U1XZNvZ6MDbdPlwPIoOJAVP+yB250yBOJP2Hg DsP7VUcLU+fo4hkD7jDCwyrk774bnP7Tra7Al06TcMckyVqMX3zrMzuNv2Ik/L6tBKe+ qWcw== X-Gm-Message-State: APjAAAUsFWwBORD5EZ/F20KmN3VdLHAdHSiQu9SdadBgrzQIX4NouEXV iaZoFqznqM/t/A9hgAkCzmTwZZdIgY3jueNu31vmMovJ19I8pm8Huc7kJ+WWC7q+O9FZTIeV0IX 4GAtFWQSsM53CRiI= X-Received: by 2002:a37:a00f:: with SMTP id j15mr1551955qke.103.1574243988040; Wed, 20 Nov 2019 01:59:48 -0800 (PST) X-Google-Smtp-Source: APXvYqz9cBCiWJEKY2AIJhD/SsJc4F1TmMBwH6bEFAQanVevdLCGq68OEa2EW4k9dNp9pEqK2VrPyg== X-Received: by 2002:a37:a00f:: with SMTP id j15mr1551949qke.103.1574243987806; Wed, 20 Nov 2019 01:59:47 -0800 (PST) Date: Wed, 20 Nov 2019 04:59:43 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 3/3] tests: acpi: always retain dumped ACPI tables in case of error Message-ID: <20191120095904.11384-4-mst@redhat.com> References: <20191120095904.11384-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20191120095904.11384-1-mst@redhat.com> X-Mailer: git-send-email 2.22.0.678.g13338e74b8 X-Mutt-Fcc: =sent X-MC-Unique: gtZULBH2MjGt6fOweS5Duw-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Peter Maydell , Thomas Huth , Paolo Bonzini , Igor Mammedov Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Igor Mammedov If IASL wasn't able to parse expected file, test will just print warning "Warning! iasl couldn't parse the expected aml\n" and remove temporary table dumped from guest. Typically expected tables are always valid, with an exception when patchset introduces new tables. Make sure dumped tables are retained even if expected files are not valid, so one could have a chance to manualy check new tables. Signed-off-by: Igor Mammedov Message-Id: <1574240560-12538-1-git-send-email-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/bios-tables-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c index 0b33fb265f..79f5da092f 100644 --- a/tests/bios-tables-test.c +++ b/tests/bios-tables-test.c @@ -437,11 +437,11 @@ static void test_acpi_asl(test_data *data) g_assert(!err || exp_err); =20 if (g_strcmp0(asl->str, exp_asl->str)) { + sdt->tmp_files_retain =3D true; if (exp_err) { fprintf(stderr, "Warning! iasl couldn't parse the expected aml\n"); } else { - sdt->tmp_files_retain =3D true; exp_sdt->tmp_files_retain =3D true; fprintf(stderr, "acpi-test: Warning! %.4s mismatch. " --=20 MST