From nobody Mon Feb 9 17:06:49 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1698832393; cv=none; d=zohomail.com; s=zohoarc; b=dmOIBKL8xivyybcPbr/BAujvxI/pJOSz1r7i5ENaECy1KFHrFL9gX/gyKiydwyGfBxxNVvUsIQ3Y79NDQI1HP5VDLohWWtJwtoO1edZeie3zCm8xdgaAa3PwOxkS/5QFQXvVA5uy/5a9AuGuNzSZctDsI+r1X4FXgb8dggbW1fU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698832393; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=e4bHBd5w4b6aQN5bSnfLHyQxglpMW3POgwkEjblrS94=; b=fH/Nm8yJwwy08GH1oqEpTwnvpfwlVZ6G3e3T4smfVtpJ8qHUMmGB8w70C9IlYggdk56y+Vcqvb6uNSg1k/Vc9TuGQqEr68AkaklYZc5bOPHSNmNA7eBlfHOLIUgqxBKGEZF9mpc4cCqrEWQwZk8kLCvHnI/IVnErzkT3Psr2LPM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1698832393699292.56319890644465; Wed, 1 Nov 2023 02:53:13 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.626331.976529 (Exim 4.92) (envelope-from ) id 1qy7uC-0005u3-1n; Wed, 01 Nov 2023 09:52:56 +0000 Received: by outflank-mailman (output) from mailman id 626331.976529; Wed, 01 Nov 2023 09:52:56 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qy7uB-0005tq-V8; Wed, 01 Nov 2023 09:52:55 +0000 Received: by outflank-mailman (input) for mailman id 626331; Wed, 01 Nov 2023 09:52:54 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qy7cH-0005E0-8O for xen-devel@lists.xenproject.org; Wed, 01 Nov 2023 09:34:25 +0000 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id d824886c-7899-11ee-98d6-6d05b1d4d9a1; Wed, 01 Nov 2023 10:34:24 +0100 (CET) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 807111F750; Wed, 1 Nov 2023 09:34:24 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 4EADC13460; Wed, 1 Nov 2023 09:34:24 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id fJrgEaAbQmUACQAAMHmgww (envelope-from ); Wed, 01 Nov 2023 09:34:24 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: d824886c-7899-11ee-98d6-6d05b1d4d9a1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1698831264; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=e4bHBd5w4b6aQN5bSnfLHyQxglpMW3POgwkEjblrS94=; b=hJA/P0wkac8sPulY6IFoArEkSp4JUf+Jp8+95iSrMEE2CB7C5mH/IgWP5kHvVsIckCrvnR KbJLD/kgHa9VNtMQeRX6+mJglF8Rn2ZtFq3463+rmq5U2muuXv6LO1DT68iv3IyYCvnwk4 kIJUmvf+BzpvOF5ZX5YijN+KcGPU6dg= From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Wei Liu , Anthony PERARD Subject: [PATCH 10/29] tools/xenlogd: add 9pfs clunk request support Date: Wed, 1 Nov 2023 10:33:06 +0100 Message-Id: <20231101093325.30302-11-jgross@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20231101093325.30302-1-jgross@suse.com> References: <20231101093325.30302-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1698832394453100001 Content-Type: text/plain; charset="utf-8" Add the clunk request of the 9pfs protocol. Signed-off-by: Juergen Gross Reviewed-by: Jason Andryuk --- tools/xenlogd/io.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/tools/xenlogd/io.c b/tools/xenlogd/io.c index c2b259f42e..2607095e51 100644 --- a/tools/xenlogd/io.c +++ b/tools/xenlogd/io.c @@ -31,6 +31,7 @@ #define P9_CMD_ERROR 107 #define P9_CMD_WALK 110 #define P9_CMD_OPEN 112 +#define P9_CMD_CLUNK 120 =20 /* P9 protocol open flags. */ #define P9_OREAD 0 /* read */ @@ -860,6 +861,38 @@ static void p9_open(device *device, struct p9_header *= hdr) fill_buffer(device, hdr->cmd + 1, hdr->tag, "QU", &qid, &iounit); } =20 +static void p9_clunk(device *device, struct p9_header *hdr) +{ + uint32_t fid; + struct p9_fid *fidp; + int ret; + + ret =3D fill_data(device, "U", &fid); + if ( ret !=3D 1 ) + { + p9_error(device, hdr->tag, EINVAL); + return; + } + + fidp =3D find_fid(device, fid); + if ( !fidp ) + { + p9_error(device, hdr->tag, ENOENT); + return; + } + + if ( fidp->opened ) + { + close(fidp->fd); + if ( fidp->mode & P9_OREMOVE ) + unlink(fidp->path); + } + + free_fid(device, fidp); + + fill_buffer(device, hdr->cmd + 1, hdr->tag, ""); +} + void *io_thread(void *arg) { device *device =3D arg; @@ -931,6 +964,10 @@ void *io_thread(void *arg) p9_open(device, &hdr); break; =20 + case P9_CMD_CLUNK: + p9_clunk(device, &hdr); + break; + default: syslog(LOG_DEBUG, "%u.%u sent unhandled command %u\n", device->domid, device->devid, hdr.cmd); --=20 2.35.3