From nobody Sun Dec 22 01:42:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1734393973; cv=none; d=zohomail.com; s=zohoarc; b=a8UQdJMuEBzvfZYh9rkaZgyXKEZamQqnTGpzCyIJtYSOZOytrdmetgwUaPlSoq7S+ERtvqB87vDa19GEtrsgdmOSG6lQCAikA8Uqe41+rTunjjbUSiamBHpdftWwD4eSj/02Ar+5phf55cvBaV/+swGl1CmDiFvTcFqnCwbQzR8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734393973; h=Content-Transfer-Encoding:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:Subject:Subject:To:To:Message-Id:Cc; bh=pC/0R2UIu+Grur3h7KpuQ+8BWC1mgeDpslL84AR1M3E=; b=iTX0MbqKIv1GyM0ppqxfRE5uYndBvzeEtr1hUFHOTLAjB4l4C3Aaj4RqFsE95k2JrKB/aWINR5XXkf+FYVPBNsaY/J59SLaVcLZu6eJdcMoZcPy2v7iCoPKj4qlEhpnp/W2yuF2SW8qhFaC/4KfvaXYHFi8R6RYYxKk+VRBWhIY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1734393973353736.528611486887; Mon, 16 Dec 2024 16:06:13 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 5D3751532; Mon, 16 Dec 2024 19:06:12 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 11755151E; Mon, 16 Dec 2024 19:05:50 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 81CE31481; Mon, 16 Dec 2024 19:05:46 -0500 (EST) Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 8E40514F5 for ; Mon, 16 Dec 2024 19:05:44 -0500 (EST) Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-388cae9eb9fso1449926f8f.3 for ; Mon, 16 Dec 2024 16:05:44 -0800 (PST) Received: from localhost (75-169-8-111.slkc.qwest.net. [75.169.8.111]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-467b2ca372asm33500871cf.21.2024.12.16.16.05.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Dec 2024 16:05:41 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1734393942; x=1734998742; darn=lists.libvirt.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=34NmZBYfWZjnUmS2OmGoQl+VRglKlEfGYCjEvtMqiGg=; b=Ih8gZQpwMKmM0xNZv8f06TUonHHnjtcpJliDSeBMEyPqX7WHZjPCVYpfrPeqbh7lP1 Wfm0uil/iGejrUSqp2p5ckW5z4vK6ctnwhQxF03de2Ilh7NXLGdEXKfcPup2B6vpUMzy 40K0lZ1fhX8sI6VrwPs09esHWOGjA/Hmm1VFr5xUpn7LS46hhz5imT8jsUJxwq6FKT9h p5Td92iR4KHqiks9y+JDNL5lDsqqipn7ldGE4tW1h3ZutPrd3icOUKCNCc9xn2txZByZ s+Xzacal4T836DdM6I9eeCVivR52kLRhGCEbTfgYYgs4Z23qOFK+e0vNgIdWnxgDrsmS 5lqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734393942; x=1734998742; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=34NmZBYfWZjnUmS2OmGoQl+VRglKlEfGYCjEvtMqiGg=; b=ZV4d9Q5eQ0lkWhh9kIkZEYmaOnz1zC8GXdvd4201St6i5kG47ldNOaBuVFzhBjIvXK IoowpoEKoZqZ0MFHHgNu6UWUR8qMdYad922j2YSLOcy6B8sAS+NPMcwDaEwZdDkHLXO6 5s7brEoA/F8FyeclGKQ8+gaEcifoU7ZhZLJyjJrriwi/2mTL16b78RppWgNKL14WdWDl 61FdFgB0GBJuwdlGHwm0wtj1a2/9SPilnLGE5Z6B+4K2bWs+ybbpQqt+uqyuhxwy25/Z hTt1823fqOLHFzEEuIzTE8aWe5LxNoVmKDlwTQH0TJHsPcrBvXbcS0B/a1gOZJrGJoG3 y8ig== X-Gm-Message-State: AOJu0Yx+/L79obWvESqS+LqE9LDM4JhHaGiFAbbnbrzzc56Dte3pA3Qg 89BZ5sg5YUEWPL+irQKwrlXdcA9N09zqK2/ph41EpNNGFk6LJGyfYmlkJs29hZaX2dQIGvav4k/ L X-Gm-Gg: ASbGncuyp3dNSoJFwbzdYb5DQ6InBrOBHxpMBvH1QyuU4yvOHovwLq7wOLYC2mwnnVd 0GRIsCdoUvLKSdosSaucPhhFIERrD3+a+L+go+x6wCDwdwNXAKIQUEPRlj1Jg4ZphbCJ4h40C/t A8yzC1hPQryX+te/9YT8x0YDDG53NLfuL8IyvfsQr6lXFdYrJMW1aQ9Wmuic56FrLYQHmTZXo/5 LKkkDNFQbFxirqiEdMn4Ngm0q+4GHqaOpa8WgR3ketWNqnWaLIkmeYJDuIW+xXAWfsuzc3Xl3s= X-Google-Smtp-Source: AGHT+IHV6zWSfLTWp+CSTxrjFFuodphguyh9bHDl5LVG0MHgQ5HnyiS1ZFqzKkm6zxwAnPun4bxANg== X-Received: by 2002:a5d:6daa:0:b0:385:e38f:8dd with SMTP id ffacd0b85a97d-3888e0b8e56mr13261093f8f.46.1734393942498; Mon, 16 Dec 2024 16:05:42 -0800 (PST) To: devel@lists.libvirt.org Subject: [PATCH] qemu: Add audit entries for suspend and resume Date: Mon, 16 Dec 2024 16:56:31 -0700 Message-ID: <20241217000540.9815-1-jfehlig@suse.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: E3EW6KKVQJ5NBUE4CIYF5DRTTYKPGXNV X-Message-ID-Hash: E3EW6KKVQJ5NBUE4CIYF5DRTTYKPGXNV X-MailFrom: jfehlig@suse.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: From: Jim Fehlig via Devel Reply-To: Jim Fehlig X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1734393974621116600 Content-Type: text/plain; charset="utf-8" We recently received a request from certification auditors to provide audit entries for suspend and resume. This small patch uses the existing virtDomainAudit{Start,Stop} functions with new reasons "suspended" and "resumed". Signed-off-by: Jim Fehlig --- For suspend, I initially wrote the following virDomainAuditStart(vm, virDomainPausedReasonTypeToString(reason), true); but I'm not sure it makes sense in resume, where we have reasons such as VIR_DOMAIN_CRASHED_PANICKED. For symmetry, it seemed best to go with "suspended" and "resumed". src/qemu/qemu_driver.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index f1a633fdd3..c670bb681e 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -1682,6 +1682,7 @@ static int qemuDomainSuspend(virDomainPtr dom) goto endjob; } qemuDomainSaveStatus(vm); + virDomainAuditStart(vm, "suspended", true); ret =3D 0; =20 endjob: @@ -1738,6 +1739,7 @@ static int qemuDomainResume(virDomainPtr dom) } } qemuDomainSaveStatus(vm); + virDomainAuditStop(vm, "resumed"); ret =3D 0; =20 endjob: --=20 2.43.0