From nobody Mon Apr 29 14:31:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 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=1598020498; cv=none; d=zohomail.com; s=zohoarc; b=Tvxwv/MOef0YgMl+QrjjDlkhOwtYOOl+Nga+Adi04EQUSVy9ZF7cflhESTtcRjI2siBKAH+6xoeqny8C16kTZy6YilQo16CBFW7C+mXYMFGoIPRRdFAvlV5C6grn/0JhFAePr6NrTgTlpONUUaRyphku0ABxyfvr/OIXPsOSqQI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598020498; 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=+oQHmKRm798o5yIMAsdsdOkVlhOan5LCSrjLoDKTxGo=; b=Wv0riMSrqXnNPLtlk3jHmcc9zAKzY/10pA70zjJ/p+ptLlh+u9wpPZrcb6Whjr8tIXRhdUhpEjHoHPmxDXuPe/ZFst/GqToS7D415ulvRNutQ6TsuqHA6fJZNrtnrc787LrPHt5jtPbWzjPllmXHXtOp9tgQWXiCs2GhPBhR8WU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 15980204985173.3290773016905177; Fri, 21 Aug 2020 07:34:58 -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-198-3Uy9qGB2MdSEYem55DQN4g-1; Fri, 21 Aug 2020 10:34:54 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B6EB780F043; Fri, 21 Aug 2020 14:34:47 +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 E75C7101417C; Fri, 21 Aug 2020 14:34:46 +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 344D3181A06B; Fri, 21 Aug 2020 14:34:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 07LEYdUX006741 for ; Fri, 21 Aug 2020 10:34:39 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6B258756DF; Fri, 21 Aug 2020 14:34:39 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.147]) by smtp.corp.redhat.com (Postfix) with ESMTP id DB18E60BF1 for ; Fri, 21 Aug 2020 14:34:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598020497; 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=+oQHmKRm798o5yIMAsdsdOkVlhOan5LCSrjLoDKTxGo=; b=BtAMtoboxPEtPVF2gR0OO9YCSdrvOstbnmmUS8vlMJphSZ15zUnm1Ee/52N4B4hj/a1JjT 12qVymwynRYOqCrFsPhgUrl464TTe+oAo8t3fhkafTpipNt0A3baJKWgqegCqmqdmAuMCT pNLUCDWiu3PkGjSlOsvabWIm1XFHogo= X-MC-Unique: 3Uy9qGB2MdSEYem55DQN4g-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH] qemu_namespace: Don't build namespace if domain doesn't have it enabled Date: Fri, 21 Aug 2020 16:34:30 +0200 Message-Id: <5ca5300c3610b71cd476043575751dcb971c91a8.1598020470.git.mprivozn@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 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.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Even if namespaces are disabled, then due to a missing check at the beginning of qemuDomainBuildNamespace(), the domain startup code still tries to populate (nonexistent) domain's namespace. Fixes: 8da362fe62766b4eee209cd3ce591ceb62299d13 Signed-off-by: Michal Privoznik Reviewed-by: Jiri Denemark --- src/qemu/qemu_namespace.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/qemu/qemu_namespace.c b/src/qemu/qemu_namespace.c index 797722b714..b6724a095f 100644 --- a/src/qemu/qemu_namespace.c +++ b/src/qemu/qemu_namespace.c @@ -616,6 +616,11 @@ qemuDomainBuildNamespace(virQEMUDriverConfigPtr cfg, { VIR_AUTOSTRINGLIST paths =3D NULL; =20 + if (!qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT)) { + VIR_DEBUG("namespaces disabled for domain %s", vm->def->name); + return 0; + } + if (qemuDomainPopulateDevices(cfg, &paths) < 0) return -1; =20 --=20 2.26.2