From nobody Tue May 21 02:32:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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.133.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=1659610376; cv=none; d=zohomail.com; s=zohoarc; b=MDaoWx7+sfEE6Zibk2CaxhRd/IiVo2wZIX3Pkh6jwZGSQZXkfkvjDIl2vvsjPBG3owBGiCV4CDG86D60dXByY8X69X5XbyR4LjMcJ5i6vQW+TP1RV5kpAnPpGJWpy9o339hEfWqt2LbRuFvY9KSMFUgCiEEjeZ37UxMTEOS2Hac= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1659610376; 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=z986KXWFGlzxAmmU8+NxyPuyjV9hmte2IyAQzONH1GI=; b=OVD7Qx/BCpIr/EPFAjOA5fnX4K65qrrA2mnWAH/c4CgbLlEafL0S+LvopWUdxzrDaybKYhYQRlbfh8AbeL0C3dlwHlWe/ry6QApY9zFDbCUj3wFfbzMlphPvDh/lpPTms1qBaVgDh/ozr6R2ckYy2sxTDhNoZvc9Ou5csvFThUE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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.133.124]) by mx.zohomail.com with SMTPS id 1659610376416595.9940682679935; Thu, 4 Aug 2022 03:52:56 -0700 (PDT) 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-278-QwV6aR8VOIyNcQmomOfCXQ-1; Thu, 04 Aug 2022 06:52:49 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 721BD8039A1; Thu, 4 Aug 2022 10:52:47 +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 BE29C1121314; Thu, 4 Aug 2022 10:52:46 +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 74C441946A53; Thu, 4 Aug 2022 10:52:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 2A5DD1946A52 for ; Thu, 4 Aug 2022 10:52:45 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 0ABECC27DB3; Thu, 4 Aug 2022 10:52:45 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.88]) by smtp.corp.redhat.com (Postfix) with ESMTP id AA87CC28129 for ; Thu, 4 Aug 2022 10:52:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1659610375; 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=z986KXWFGlzxAmmU8+NxyPuyjV9hmte2IyAQzONH1GI=; b=dN19R0un8m5WbI273bwuHqfTlU6cpmd79KcbYRBpllLPEKxoA4Q07gAUTY4eNKRwM+KlEs QfQ7gGHq0WW8k8M+0DPsRcWvvcm2vRbsxfAD+g5xSLKwOH54zN590o4wJtKnoQbsQPfumQ q0MSm9NirfnVBK4MnhvnqogyyMfhLF0= X-MC-Unique: QwV6aR8VOIyNcQmomOfCXQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH] qemu_process: Destroy domain's namespace after killing QEMU Date: Thu, 4 Aug 2022 12:52:43 +0200 Message-Id: <19e2675e75cd58f0444558a72e733a0c86390994.1659610363.git.mprivozn@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 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 2.78 on 10.11.54.3 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: 1659610378445100001 Content-Type: text/plain; charset="utf-8"; x-default="true" After QEMU is killed in qemuProcessStop() its mount namespace doesn't exist anymore, because it was the only process running there. Thus we should clear our internal flag that the domain has namespace enabled so that seclabel restore code does not try to enter it. We do the same in qemuProcessHandleMonitorEOF() but when it is us, who decides to kill QEMU rather than QEMU quitting we haven't seen EOF by the time qemuProcessStop() is called. Signed-off-by: Michal Privoznik Reviewed-by: Martin Kletzander --- src/qemu/qemu_process.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index d29da63242..fbf460595b 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -8265,6 +8265,9 @@ void qemuProcessStop(virQEMUDriver *driver, VIR_QEMU_PROCESS_KILL_FORCE| VIR_QEMU_PROCESS_KILL_NOCHECK)); =20 + /* Its namespace is also gone then. */ + qemuDomainDestroyNamespace(driver, vm); + qemuDomainCleanupRun(driver, vm); =20 qemuExtDevicesStop(driver, vm); --=20 2.35.1