From patchwork Tue Jul 24 21:23:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 142826 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp55838ljj; Tue, 24 Jul 2018 14:24:07 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdznUYmXl5ZavD0CNNWhsdxa18StRLqSgGX8mX8cwA5iWZ6M+SOzgmcKBd0qMNkbAquDkh8 X-Received: by 2002:a0c:b65a:: with SMTP id q26-v6mr16933822qvf.43.1532467447882; Tue, 24 Jul 2018 14:24:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532467447; cv=none; d=google.com; s=arc-20160816; b=YPTDAawXo+NJrt9+ygLe2yc7UIRYOXcVuTtJriMe6YCVjtng5MhXxmr4LMhaZXZaGw hjZgwOcRKgk2tCyS9BZvWFt3zToFjtI8xvX7H98H2biqp9Dhbd96eXezStSpI3K1dS1K ihLEqQKJAhVCZbwXL/TtA8mNtQaumNOKJtuilNIqoPKaZjbaBnXVG9INkUKX7qeEKkNe 5rb5YA0UVf4KcPlIbxeYPGzLxKO9YZKzS9hFhJ+wi6TJ7uXUuBw4jKwsH9IbrQTPFe9S otAUZBD3yQaJXOWQ8zOvVQ47pyv93beKsCP1DNjPUnyVc8unxTaEGtlYVWuLI0NiZwuj B1aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:references :in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=zUkH6mFz9rMt6AgVv2GkDbXYtPryc37MaPlugj4pYYE=; b=0i2MJoYenl5hAbBrB9KYH4r+9ryWON8iZpHJ60X4s1phDJRONh5hDIufrmZJaVznpQ DbPVzC+TZ67nDEGHyMMZOi4yxVqkaI9kQQ/tGRNb9flQyBf0dSwIxk+mfc1hSWCDybh0 UfhbpLZ3OdpIxTyqQGMAhrQdH0qFArHXX5fd9M2WQZ79rlp5a8rsPPzDset3RkTtUpqD OSYMZFiVzS+6bfnee5SmbIBPpwHaw4mI9ZQ/+AbtktIwSpPl44RRHTo2/6umgnk4z7GT elTolPZv04eRHa/hE3OicdRsF4a0K8Ljy04k9kESQ9IaFA2+gd05v7gH4a9F3IodTNad Jq2A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id l6-v6si5510313qvc.189.2018.07.24.14.24.07 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Jul 2018 14:24:07 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EDCFC300177C; Tue, 24 Jul 2018 21:24:05 +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 A1DAB6017D; Tue, 24 Jul 2018 21:24: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 143314BB78; Tue, 24 Jul 2018 21:24:05 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w6OLNpE8018727 for ; Tue, 24 Jul 2018 17:23:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id AE16D2026E1A; Tue, 24 Jul 2018 21:23:51 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.bos.redhat.com (wlan-196-187.bos.redhat.com [10.16.196.187]) by smtp.corp.redhat.com (Postfix) with ESMTP id 93CA82026D68; Tue, 24 Jul 2018 21:23:51 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Tue, 24 Jul 2018 17:23:44 -0400 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/7] tests: qemuhotplug: Fix segfault when XML loading fails 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 Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Tue, 24 Jul 2018 21:24:06 +0000 (UTC) Some tests use the same VM state multiple times in a row. But if we failed loading the VM XML, subsequent tests crash on the NULL def pointer Signed-off-by: Cole Robinson --- I hit this with failing tests while writing this series tests/qemuhotplugtest.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index 674ba92b27..4f9e127f88 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -268,6 +268,8 @@ testQemuHotplug(const void *data) if (test->vm) { vm = test->vm; + if (!vm->def) + goto cleanup; } else { if (qemuHotplugCreateObjects(driver.xmlopt, &vm, domain_xml, test->deviceDeletedEvent) < 0)