From nobody Fri May 3 22:26:13 2024 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=1639727490; cv=none; d=zohomail.com; s=zohoarc; b=N8RKIDRn4sHkmPAO0oN9EponUb2hm3m3XDmnTIY3dN5SfQrdUQP8iAaZJs4Y63P52afqsgSxcoOh9iG/RYXIzhOm4lRZUvze3/fITJUKfU5X33FIdGFBQt/brZkmFWAPEhsiMgdLPk4N2fhyH2iE/+Tp6XPXpT1OiVOAxEK2bfE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1639727490; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=Ge/T7sfWxdaImWMIF/IC9l8ofgbDkde6Zgt9g58mXQs=; b=gPQJe2vuQTefYWeBWCXg8/NTwGjWxiwEl7mX58nErl11ajqcGh/gy5wOqvBC3SqV6RrecAavav0sYV09XC8gv4sy6Q+lQvihymnHSDDXZQqaHTjA59DfY/wUFbJ0++Xq4qKjaRPj3xa2mgOVllqNjMOLcDhTU3NeqnGohFsHl3g= 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 1639727490600289.4643526993177; Thu, 16 Dec 2021 23:51:30 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.248456.428577 (Exim 4.92) (envelope-from ) id 1my81B-0007eB-H1; Fri, 17 Dec 2021 07:51:05 +0000 Received: by outflank-mailman (output) from mailman id 248456.428577; Fri, 17 Dec 2021 07:51:05 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1my81B-0007e4-Dk; Fri, 17 Dec 2021 07:51:05 +0000 Received: by outflank-mailman (input) for mailman id 248456; Fri, 17 Dec 2021 07:51:03 +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 1my819-0007dy-QQ for xen-devel@lists.xenproject.org; Fri, 17 Dec 2021 07:51:03 +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 149a42a2-5f0e-11ec-9e60-abaf8a552007; Fri, 17 Dec 2021 08:51:02 +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 E0A171F3AD; Fri, 17 Dec 2021 07:51:01 +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 B0BFB13F21; Fri, 17 Dec 2021 07:51:01 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id jrLdKWVBvGFWZQAAMHmgww (envelope-from ); Fri, 17 Dec 2021 07:51:01 +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: 149a42a2-5f0e-11ec-9e60-abaf8a552007 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1639727461; 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; bh=Ge/T7sfWxdaImWMIF/IC9l8ofgbDkde6Zgt9g58mXQs=; b=mc6XG7Xx3c4gssU/JCCnlbwMieWQYmYFZxhyT/UnUwG0Cxmdd3wZVMrE6FJ/dw0SsYw3wu rckMdGcrQ5NSlnEW1wgNqPrlxMP+2B9V+VJPKLpswpRNSqtCXH+HFG7gkuPVHxasX3e8uy Lcf85BSiqIcKTgMLPUdkAan5VucdaiE= From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Wei Liu , Julien Grall , Anthony PERARD Subject: [PATCH] tools/xenstore: drop support for running under SunOS Date: Fri, 17 Dec 2021 08:50:59 +0100 Message-Id: <20211217075059.14466-1-jgross@suse.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1639727492732100001 Content-Type: text/plain; charset="utf-8" Since several years now xenstored is no longer capable to run under SunOS, as the needed libxengnttab interfaces are not available there. Several attempts to let the SunOS maintainers address this situation didn't change anything in this regard. For those reasons drop SunOS support in xenstored by removing the SunOS specific code. Signed-off-by: Juergen Gross Reviewed-by: Julien Grall --- tools/xenstore/Makefile | 15 +-- tools/xenstore/xenstored_core.c | 7 -- tools/xenstore/xenstored_core.h | 4 - tools/xenstore/xenstored_minios.c | 4 - tools/xenstore/xenstored_posix.c | 6 -- tools/xenstore/xenstored_probes.d | 28 ----- tools/xenstore/xenstored_solaris.c | 168 ----------------------------- 7 files changed, 1 insertion(+), 231 deletions(-) delete mode 100644 tools/xenstore/xenstored_probes.d delete mode 100644 tools/xenstore/xenstored_solaris.c diff --git a/tools/xenstore/Makefile b/tools/xenstore/Makefile index 292b478fa1..c86278fdb1 100644 --- a/tools/xenstore/Makefile +++ b/tools/xenstore/Makefile @@ -27,7 +27,6 @@ XENSTORED_OBJS +=3D xenstored_transaction.o xenstored_con= trol.o XENSTORED_OBJS +=3D xs_lib.o talloc.o utils.o tdb.o hashtable.o =20 XENSTORED_OBJS_$(CONFIG_Linux) =3D xenstored_posix.o -XENSTORED_OBJS_$(CONFIG_SunOS) =3D xenstored_solaris.o xenstored_posix.o x= enstored_probes.o XENSTORED_OBJS_$(CONFIG_NetBSD) =3D xenstored_posix.o XENSTORED_OBJS_$(CONFIG_FreeBSD) =3D xenstored_posix.o XENSTORED_OBJS_$(CONFIG_MiniOS) =3D xenstored_minios.o @@ -50,18 +49,6 @@ all: $(ALL_TARGETS) .PHONY: clients clients: xenstore $(CLIENTS) xenstore-control =20 -ifeq ($(CONFIG_SunOS),y) -xenstored_probes.h: xenstored_probes.d - dtrace -C -h -s xenstored_probes.d - -xenstored_solaris.o: xenstored_probes.h - -xenstored_probes.o: xenstored_solaris.o - dtrace -C -G -s xenstored_probes.d xenstored_solaris.o=20 - -CFLAGS +=3D -DHAVE_DTRACE=3D1 -endif - ifeq ($(CONFIG_SYSTEMD),y) $(XENSTORED_OBJS): CFLAGS +=3D $(SYSTEMD_CFLAGS) xenstored: LDFLAGS +=3D $(SYSTEMD_LIBS) @@ -89,7 +76,7 @@ xs_tdb_dump: xs_tdb_dump.o utils.o tdb.o talloc.o =20 .PHONY: clean clean: - rm -f *.a *.o xenstored_probes.h + rm -f *.a *.o rm -f xenstored rm -f xs_tdb_dump xenstore-control init-xenstore-domain rm -f xenstore $(CLIENTS) diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_cor= e.c index 91d093a12e..c386ae6129 100644 --- a/tools/xenstore/xenstored_core.c +++ b/tools/xenstore/xenstored_core.c @@ -146,10 +146,6 @@ static void trace_io(const struct connection *conn, time_t now; struct tm *tm; =20 -#ifdef HAVE_DTRACE - dtrace_io(conn, data, out); -#endif - if (tracefd < 0) return; =20 @@ -2337,9 +2333,6 @@ int main(int argc, char *argv[]) /* Get ready to listen to the tools. */ initialize_fds(&sock_pollfd_idx, &timeout); =20 - /* Tell the kernel we're up and running. */ - xenbus_notify_running(); - #if defined(XEN_SYSTEMD_ENABLED) if (!live_update) { sd_notify(1, "READY=3D1"); diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_cor= e.h index 07d861d924..190d2447cd 100644 --- a/tools/xenstore/xenstored_core.h +++ b/tools/xenstore/xenstored_core.h @@ -225,7 +225,6 @@ int delay_request(struct connection *conn, struct buffe= red_data *in, void trace_create(const void *data, const char *type); void trace_destroy(const void *data, const char *type); void trace(const char *fmt, ...) __attribute__ ((format (printf, 1, 2))); -void dtrace_io(const struct connection *conn, const struct buffered_data *= data, int out); void reopen_log(void); void close_log(void); =20 @@ -250,9 +249,6 @@ static inline int xenbus_master_domid(void) { return do= m0_domid; } /* Return the event channel used by xenbus. */ evtchn_port_t xenbus_evtchn(void); =20 -/* Tell the kernel xenstored is running. */ -void xenbus_notify_running(void); - /* Write out the pidfile */ void write_pidfile(const char *pidfile); =20 diff --git a/tools/xenstore/xenstored_minios.c b/tools/xenstore/xenstored_m= inios.c index c94493e52a..aa384e50c8 100644 --- a/tools/xenstore/xenstored_minios.c +++ b/tools/xenstore/xenstored_minios.c @@ -38,10 +38,6 @@ void init_pipe(int reopen_log_pipe[2]) reopen_log_pipe[1] =3D -1; } =20 -void xenbus_notify_running(void) -{ -} - evtchn_port_t xenbus_evtchn(void) { return dom0_event; diff --git a/tools/xenstore/xenstored_posix.c b/tools/xenstore/xenstored_po= six.c index 48c37ffe3e..b20504d1b6 100644 --- a/tools/xenstore/xenstored_posix.c +++ b/tools/xenstore/xenstored_posix.c @@ -111,7 +111,6 @@ void unmap_xenbus(void *interface) munmap(interface, getpagesize()); } =20 -#ifndef __sun__ evtchn_port_t xenbus_evtchn(void) { int fd; @@ -158,8 +157,3 @@ void *xenbus_map(void) =20 return addr; } - -void xenbus_notify_running(void) -{ -} -#endif /* !__sun__ */ diff --git a/tools/xenstore/xenstored_probes.d b/tools/xenstore/xenstored_p= robes.d deleted file mode 100644 index f72d38f935..0000000000 --- a/tools/xenstore/xenstored_probes.d +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, version 2 of the License. - */ - -#include - -provider xenstore { - /* tx id, dom id, pid, type, msg */ - probe msg(uint32_t, unsigned int, pid_t, int, const char *); - /* tx id, dom id, pid, type, reply */ - probe reply(uint32_t, unsigned int, pid_t, int, const char *); - /* tx id, dom id, pid, reply */ - probe error(uint32_t, unsigned int, pid_t, const char *); - /* dom id, pid, watch details */ - probe watch_event(unsigned int, pid_t, const char *); -}; - -#pragma D attributes Evolving/Evolving/Common provider xenstore provider -#pragma D attributes Private/Private/Unknown provider xenstore module -#pragma D attributes Private/Private/Unknown provider xenstore function -#pragma D attributes Evolving/Evolving/Common provider xenstore name -#pragma D attributes Evolving/Evolving/Common provider xenstore args - diff --git a/tools/xenstore/xenstored_solaris.c b/tools/xenstore/xenstored_= solaris.c deleted file mode 100644 index 06052d124a..0000000000 --- a/tools/xenstore/xenstored_solaris.c +++ /dev/null @@ -1,168 +0,0 @@ -/*************************************************************************= ***** - * - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - * - * Copyright (C) 2005 Rusty Russell IBM Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation, version 2 of the - * License. - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "talloc.h" -#include "xenstored_core.h" -#include "xenstored_probes.h" - -evtchn_port_t xenbus_evtchn(void) -{ - int fd; - evtchn_port_t port;=20 - - fd =3D open("/dev/xen/xenbus", O_RDONLY);=20 - if (fd =3D=3D -1) - return -1; - - port =3D ioctl(fd, IOCTL_XENBUS_XENSTORE_EVTCHN); - - close(fd);=20 - return port; -} - -void *xenbus_map(void) -{ - int fd; - void *addr; - - fd =3D open("/dev/xen/xenbus", O_RDWR); - if (fd =3D=3D -1) - return NULL; - - addr =3D mmap(NULL, getpagesize(), PROT_READ|PROT_WRITE, - MAP_SHARED, fd, 0); - - if (addr =3D=3D MAP_FAILED) - addr =3D NULL; - - close(fd); - - return addr; -} - -void xenbus_notify_running(void) -{ - int fd; - - fd =3D open("/dev/xen/xenbus", O_RDONLY); - - (void) ioctl(fd, IOCTL_XENBUS_NOTIFY_UP); - - close(fd); -} - -static pid_t cred(const struct connection *conn) -{ - ucred_t *ucred =3D NULL; - pid_t pid; - - if (conn->domain) - return (0); - - if (getpeerucred(conn->fd, &ucred) =3D=3D -1) - return (0); - - pid =3D ucred_getpid(ucred); - - ucred_free(ucred); - return (pid); -} - -/* - * The strings are often a number of nil-separated strings. We'll just - * replace the separators with spaces - not quite right, but good - * enough. - */ -static char * -mangle(const struct connection *conn, const struct buffered_data *in) -{ - char *str; - int i; - - if (in->hdr.msg.len =3D=3D 0) - return (talloc_strdup(conn, "")); - - if ((str =3D talloc_zero_size(conn, in->hdr.msg.len + 1)) =3D=3D NULL) - return (NULL); - - memcpy(str, in->buffer, in->hdr.msg.len); -=09 - /* - * The protocol is absurdly inconsistent in whether the length - * includes the terminating nil or not; replace all nils that - * aren't the last one. - */ - for (i =3D 0; i < (in->hdr.msg.len - 1); i++) { - if (str[i] =3D=3D '\0') - str[i] =3D ' '; - } - - return (str); -} - -void -dtrace_io(const struct connection *conn, const struct buffered_data *in, - int io_out) -{ - if (!io_out) { - if (XENSTORE_MSG_ENABLED()) { - char *mangled =3D mangle(conn, in); - XENSTORE_MSG(in->hdr.msg.tx_id, conn->id, cred(conn), - in->hdr.msg.type, mangled); - } - - goto out; - } - - switch (in->hdr.msg.type) { - case XS_ERROR: - if (XENSTORE_ERROR_ENABLED()) { - char *mangled =3D mangle(conn, in); - XENSTORE_ERROR(in->hdr.msg.tx_id, conn->id, - cred(conn), mangled); - } - break; - - case XS_WATCH_EVENT: - if (XENSTORE_WATCH_EVENT_ENABLED()) { - char *mangled =3D mangle(conn, in); - XENSTORE_WATCH_EVENT(conn->id, cred(conn), mangled); - } - break; - - default: - if (XENSTORE_REPLY_ENABLED()) { - char *mangled =3D mangle(conn, in); - XENSTORE_REPLY(in->hdr.msg.tx_id, conn->id, cred(conn), - in->hdr.msg.type, mangled); - } - break; - } - -out: - /* - * 6589130 dtrace -G fails for certain tail-calls on x86 - */ - asm("nop"); -} --=20 2.26.2