From patchwork Mon Dec 9 18:15:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 181085 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp4695994ile; Mon, 9 Dec 2019 10:13:58 -0800 (PST) X-Google-Smtp-Source: APXvYqwLtf3qZO8vTCEz5/HD9V8siXfvM5K46Bo8WV1FVhuyy/lJfJStZY+nplOyj4AYeh2/88OA X-Received: by 2002:ac8:7b9b:: with SMTP id p27mr27013616qtu.2.1575915238169; Mon, 09 Dec 2019 10:13:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575915238; cv=none; d=google.com; s=arc-20160816; b=FyCLacwXNX0Rw91CuhUS9NQw6kK9bnN1eWUtwdAuASJM7oGLwJzE2TCgbTI4PjfQ+g VV0GOkDlNarACwfA4it2FrXGM/OctInX0CD2s5J3ImD0d50k0eKZVK6J4vYW32KXJhTj vR9nvzD2Wmx5Ipnv6L/Mw9/74AMS79c8ftph6OxmKp8BEFrK2EujaqG40k5bqbayq4+p 6iepxTCetfWaYxM2jSr+2GKIZUiEeRzl1T5lsfXRNpuMCKEryulaCbSxlyaOUUrwD0Sv Zhe4lo8izACMwCt69qv6w2pnfioMx9okcnnl7LY+37+rJLWSnVSexaw8QGVImkI6uNkF ii9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:errors-to:sender:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :cc:mime-version:message-id:date:to:from:delivered-to:dkim-signature; bh=6BVxNg0xRMaLSNzBdbAzkKilYs9g6Du5U085FrsyU78=; b=LKCZQUZa68zpkgPivPOxkuPw8/cJejGHdUrpCnUErg7xwxVCc7lORp73LDFkDPgnI1 8a2rfUQjfR8DuvOwzJG7OM8+Wp8vwJjzsNhUQ1sGYeHJVSF49zkCbCAXpT2hbO+dgCga GPCvpCysJ3ZSJZN1wkbKou1dSA0Gx9xVNnX+gOH+q52ajiX/M8yCRg59ySkjOtelCGyF uD7EY9Le37xSk1Y0n1ev6B1OyXNW5i4uINHFYPy9oZoXvm3bMCmKJbGO2K9EoS1Re/mf JmLyP3Qvct+VMIxMbFeJBchYrNjAcK2uZ6g8R239pl67Qd4Yte4GYX5OADUhjyI5RZ9p /9Yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DsX5Hfi1; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 205.139.110.61 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 us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com. [205.139.110.61]) by mx.google.com with ESMTPS id e16si358911qvy.123.2019.12.09.10.13.58 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Dec 2019 10:13:58 -0800 (PST) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DsX5Hfi1; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575915237; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=6BVxNg0xRMaLSNzBdbAzkKilYs9g6Du5U085FrsyU78=; b=DsX5Hfi1pELAVt0ac3JDa4AxkRacmDXxtwHT1Q7Fw1vKxQaU4t6o+1amNNb4iVMcfqBVx8 6jbPbAsEuKlmAMxL36W4h50XZpwsy3+x2mkTHXzStx1LpAONx60/cK9o0r0oCQLfUcAMUr Ox7BYzyR6ZhKV8m+GC+Iiw5s4XqFrmA= 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-368-k9R8GvJCOOijkcW6byixig-1; Mon, 09 Dec 2019 13:13:56 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id BF68310054E3; Mon, 9 Dec 2019 18:13:50 +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 900A160476; Mon, 9 Dec 2019 18:13:50 +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 367B48354C; Mon, 9 Dec 2019 18:13:50 +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 xB9IDm4O020060 for ; Mon, 9 Dec 2019 13:13:48 -0500 Received: by smtp.corp.redhat.com (Postfix) id C170660496; Mon, 9 Dec 2019 18:13:48 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.redhat.com (ovpn-123-82.rdu2.redhat.com [10.10.123.82]) by smtp.corp.redhat.com (Postfix) with ESMTP id CBFD260476; Mon, 9 Dec 2019 18:13:45 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Mon, 9 Dec 2019 13:15:02 -0500 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: Cole Robinson Subject: [libvirt] [PATCH] lxc: Refresh capabilities if they have never been initalized 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.79 on 10.5.11.11 X-MC-Unique: k9R8GvJCOOijkcW6byixig-1 X-Mimecast-Spam-Score: 0 Adjust virLXCDriverGetCapabilities to fill in driver->caps if it has never been set, regardless of the passed 'refresh' boolean. This fixes LXC XML startup parsing for me Signed-off-by: Cole Robinson --- src/lxc/lxc_conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/src/lxc/lxc_conf.c b/src/lxc/lxc_conf.c index 2df1537b22..803176f52b 100644 --- a/src/lxc/lxc_conf.c +++ b/src/lxc/lxc_conf.c @@ -186,7 +186,7 @@ virCapsPtr virLXCDriverGetCapabilities(virLXCDriverPtr driver, bool refresh) { virCapsPtr ret; - if (refresh) { + if (refresh || !driver->caps) { virCapsPtr caps = NULL; if ((caps = virLXCDriverCapsInit(driver)) == NULL) return NULL;