From nobody Tue May 7 15:36:26 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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 170.10.129.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=1675768645; cv=none; d=zohomail.com; s=zohoarc; b=Gssu/0N1d9KIOrkACJY0I1YI1jVJatCd9YYBl/yzMCtnocNqY5THrNLFHy3mMLo0lhyTD9fU30GsiC8W69VI8nNc47azZrcUQn9hYducqgETPvxF8MaGL8ijQJfbW5eaEFrC1Die9IVEhidtKpPbiEscQW1KJczJXxtb3yJEHxI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675768645; 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=mG0s6ig0EXahLtgRyV3Y7HFiW4yPvOsb+VKKEfkCCPY=; b=GWiqLhDsa24j/ZNiiStiWSwc0lOvc9u4XafXDxM4+p4kq4nz5FC8j8igwdhdiTCgRHSU028+bhcIRPhvzKQwlGqueYJaIbAWilc7kIK9uqk0+IyRKLQDAs4u0jLVpHpva4qRMtHvf8KTLxuYTyWuuAe8XSZZmqH2+uvGUQRESfE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1675768645146158.09864973320884; Tue, 7 Feb 2023 03:17:25 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-189-ru0qcibuOZWbpMLL0-xAwA-1; Tue, 07 Feb 2023 06:17:20 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E831585CBE6; Tue, 7 Feb 2023 11:17:17 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 45DD240CF8EF; Tue, 7 Feb 2023 11:17:16 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 13388194658C; Tue, 7 Feb 2023 11:17:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 691971946589 for ; Tue, 7 Feb 2023 11:17:14 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 3E22940B42D4; Tue, 7 Feb 2023 11:17:14 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id DAC4640CF8EF for ; Tue, 7 Feb 2023 11:17:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675768644; 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=mG0s6ig0EXahLtgRyV3Y7HFiW4yPvOsb+VKKEfkCCPY=; b=UNjfM94HwamXhIzk+Nrj9j/ZxhnnBIywKGnLr3JAgUEz2Q9Nh/6/5IqmAExuvKVlJdT7+6 tE//tX+j0n2fPhCmFwMlDAGsj5jomYSd6piJXDP3QkaupwBTE21HPUULurdgDnrsqihLP1 ZbWnUFn3q7d9T/zivKCBGuml2sOwdWE= X-MC-Unique: ru0qcibuOZWbpMLL0-xAwA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH] qemu_process: Produce better debug message wrt domain namespaces Date: Tue, 7 Feb 2023 12:17:12 +0100 Message-Id: <370997ebf37e7c5e00482d1fdaf6fc03e2de4cbd.1675768632.git.mprivozn@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1675768645510100001 Content-Type: text/plain; charset="utf-8"; x-default="true" When going through debug log of a domain startup process, one can meet the following line: debug : qemuProcessLaunch:7668 : Building mount namespace But this is in fact wrong. Firstly, domain namespaces are just enabled in domain's privateData. Secondly, the debug message says nothing about actual state of namespace - whether it was enabled or not. Therefore, move the debug printing into qemuProcessEnableDomainNamespaces() and tweak it so that the actual value is reflected. Signed-off-by: Michal Privoznik Reviewed-by: Jim Fehlig --- src/qemu/qemu_process.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index e96b7689a3..68ced01ab2 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -7378,11 +7378,17 @@ qemuProcessEnableDomainNamespaces(virQEMUDriver *dr= iver, virDomainObj *vm) { g_autoptr(virQEMUDriverConfig) cfg =3D virQEMUDriverGetConfig(driver); + const char *state =3D "disabled"; =20 if (virBitmapIsBitSet(cfg->namespaces, QEMU_DOMAIN_NS_MOUNT) && qemuDomainEnableNamespace(vm, QEMU_DOMAIN_NS_MOUNT) < 0) return -1; =20 + if (qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT)) + state =3D "enabled"; + + VIR_DEBUG("Mount namespace for domain name=3D%s are %s", + vm->def->name, state); return 0; } =20 @@ -7706,8 +7712,6 @@ qemuProcessLaunch(virConnectPtr conn, =20 qemuDomainLogContextMarkPosition(logCtxt); =20 - VIR_DEBUG("Building mount namespace"); - if (qemuProcessEnableDomainNamespaces(driver, vm) < 0) goto cleanup; =20 --=20 2.39.1