From nobody Mon Sep 23 16:44:29 2024 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XC83K4qXWz5WCSM; Mon, 23 Sep 2024 16:44:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XC83K44Pqz4PhK; Mon, 23 Sep 2024 16:44:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727109869; h=from:from: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; bh=Yh/OZRQBond+yfdz9ccyeFKBNPh5lp1AsNSEBk1xlM4=; b=vq86jv8z5RfHfGJR491ci3AQZyn+cUl6KdiCh6pDPDT4tfBHMh8BTbjjDxYd0De894O84C M6D2OIubvhW+FJlgsSe8dT7ASGbp2t/F5/POus0O22e5leMOE1DsPTAuw/UpyfGVApQf9R lV6C1aAig91ezCZefyE/v3MkcJ8G3ZNKDG1Z2DjDivYBha74rtUcxEAD9O2cvO7MxOQyT9 WirH5rbhKKcSu8tu1al9sCWHoNF8HSTMvCxdHKTYtMs+FjjP+gpeCE2H2BnDSoRiwmw+Ui GIVAcTpp8kd+jDcVXU9889gO5IQUST831pHDOMXEEnY54U7TUo9WZdh+tT+07A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727109869; a=rsa-sha256; cv=none; b=eYqnyCQtd8NrzP8AeiFif8VRHD3xfQ8NaYVVL6aiJZky15h/R/oxGTg/oFb3flL2u/ZJ+V iIYsVJsz3ejjfPyPl+iVHAJuhg00aezroCoQiCRG+YMuhexDZHubp8q89zLjNypn1Fsgzg u5GKXIENEif+LWZB1YdblqGE+rxFD03HsGXO9zjNCka1hY+tHsqdRhIH1ESY0W9r8mQdqD j0XyxpGIrXkmbP/q2YtMzgdqLMjpp2mApdig3PBw8zA6cjLdTuBpDY7o5+OicaSuLMEXSZ xpTOU4SH0sjpgC4ZLyVTOp69Gf7KBMWej73Hv9kKBzoZ7yE3Hfh9mjafUKq4fQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727109869; h=from:from: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; bh=Yh/OZRQBond+yfdz9ccyeFKBNPh5lp1AsNSEBk1xlM4=; b=hqQH3GdDJ3rSxJNdA+Vp2PED03KIL+RcH6cwVMgBOn788kQ6UZKDkQIAzqN+UGaIb8EKD8 PfkInR+PrDzEKL8f7p4/+mZttyNHQUe/O1+Acxjf6DCnV6kX5VVYh83ZGqofn5zH1ZZ4CU 6zpu3ZQtwT7muCiZOu/Gk1t8Odn53V63AnqI5uXDLiPthEAuS9UnJREiuc4F89p0LFseoo BFnvW4xf/KiSHbhPzzHNQDDVNllB6NAgDLuxJh1uvKHcTaEgMF+Cyd10eu5WbWpI79cG/o aiPU3tZHfF+ZzFT80XiGbShvZg/25imbxgzMN5g3rkZDHu4FpT3a3wD3cABKSA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XC83K3Yq2zsrr; Mon, 23 Sep 2024 16:44:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48NGiTMO081969; Mon, 23 Sep 2024 16:44:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48NGiTwZ081966; Mon, 23 Sep 2024 16:44:29 GMT (envelope-from git) Date: Mon, 23 Sep 2024 16:44:29 GMT Message-Id: <202409231644.48NGiTwZ081966@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Mark Felder Subject: git: e172102c8c48 - main - sysutils/xe-guest-utilities: Update to 6.3.0 List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-main@freebsd.org Sender: owner-dev-commits-ports-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: feld X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e172102c8c481b266b7650278bd2147055a942e4 Auto-Submitted: auto-generated The branch main has been updated by feld: URL: https://cgit.FreeBSD.org/ports/commit/?id=e172102c8c481b266b7650278bd2147055a942e4 commit e172102c8c481b266b7650278bd2147055a942e4 Author: Mark Felder AuthorDate: 2024-09-23 16:44:24 +0000 Commit: Mark Felder CommitDate: 2024-09-23 16:44:24 +0000 sysutils/xe-guest-utilities: Update to 6.3.0 This update changes the way IP addresses and interfaces are reported to adhere to the newer XAPI syntax and will now report IPv6 addresses. PR: 281256 Reported by: freebsd@filter.paco.to --- sysutils/xe-guest-utilities/Makefile | 3 +- .../files/patch-xe-update-guest-attrs | 150 ++++++++++++++++++++- 2 files changed, 144 insertions(+), 9 deletions(-) diff --git a/sysutils/xe-guest-utilities/Makefile b/sysutils/xe-guest-utilities/Makefile index c7bc5c2b87d9..553d6552651a 100644 --- a/sysutils/xe-guest-utilities/Makefile +++ b/sysutils/xe-guest-utilities/Makefile @@ -1,6 +1,5 @@ PORTNAME= xe-guest-utilities -PORTVERSION= 6.2.0 -PORTREVISION= 3 +PORTVERSION= 6.3.0 CATEGORIES= sysutils MASTER_SITES= LOCAL/feld DISTNAME= ${PORTNAME}-6.0.2 diff --git a/sysutils/xe-guest-utilities/files/patch-xe-update-guest-attrs b/sysutils/xe-guest-utilities/files/patch-xe-update-guest-attrs index 9b572de87bd1..681e47fa016b 100644 --- a/sysutils/xe-guest-utilities/files/patch-xe-update-guest-attrs +++ b/sysutils/xe-guest-utilities/files/patch-xe-update-guest-attrs @@ -1,16 +1,152 @@ ---- src/sbin/xe-update-guest-attrs.orig 2014-07-07 15:45:10.000000000 +0200 -+++ src/sbin/xe-update-guest-attrs 2015-01-30 10:24:05.000000000 +0100 -@@ -173,10 +173,10 @@ - xenstore_write_cached "control/feature-balloon" "1" +--- src/sbin/xe-update-guest-attrs.orig 2024-09-03 15:39:43.133537000 -0400 ++++ src/sbin/xe-update-guest-attrs 2024-09-03 15:42:09.862675000 -0400 +@@ -39,7 +39,7 @@ XENSTORE=${XENSTORE:-/usr/local/bin/xenstore} + + export PATH=/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/sbin + XENSTORE=${XENSTORE:-/usr/local/bin/xenstore} +- ++CACHEROOT="/var/cache/xenstore" + XENSTORE_UPDATED=0 + + # parse command line opts +@@ -54,7 +54,7 @@ xenstore_write_cached() { + + xenstore_write_cached() { + key="$1" newval="$2" +- cache=/var/cache/xenstore/$key ++ cache=${CACHEROOT}/$key + if [ -f $cache ] ; then + # cache exists + oldval=$(cat "$cache") +@@ -82,13 +82,13 @@ domid=$(/usr/local/bin/xenstore-read "domid") + + # If we detect a domain change then delete our cache and force a refresh + domid=$(/usr/local/bin/xenstore-read "domid") +-cache=/var/cache/xenstore/unique-domain-id ++cache=${CACHEROOT}/unique-domain-id + newval=$(/usr/local/bin/xenstore-read "/local/domain/${domid}/unique-domain-id") + if [ -e $cache ]; then + oldval=$(cat "$cache") + if [ "$oldval" != "$newval" ]; then + # domain changed +- rm -rf /var/cache/xenstore ++ rm -rf xenstore + fi + fi + mkdir -p $(dirname "$cache") +@@ -96,7 +96,7 @@ xenstore_rm_cached() { + + xenstore_rm_cached() { + key="$1" +- cache=/var/cache/xenstore/$key ++ cache=${CACHEROOT}/$key + if [ ! -e $cache ] ; then + return 1 + fi +@@ -109,21 +109,46 @@ xenstore_rm_cached() { + return 1 + } + ++# read cache, using xen-style integers (e.g., "0", "1") ++# return bsd names like xn0 + xenstore_list_interfaces_cached() { +- topdir=/var/cache/xenstore/attr ++ topdir=${CACHEROOT}/attr + if [ -d $topdir ] ; then + cd $topdir +- for dir in * ; do +- [ -f $dir/ip ] && echo $dir ++ # if a file named like vif/0/ipv4/0 exists, then xn0 is a valid interface ++ # sort -u to get only unique interfaces ++ iflist=$(ls vif/*/ipv?/* | cut -d / -f 2 | sort -u | xargs echo) ++ for n in $iflist ++ do ++ echo "xn${n}" + done + fi + } + ++# XAPI expects things like attr/vif/0/ipv4/0 = 172.30.0.2 ++# So this tries to map BSD names like xn0 to attr/vif/0 + xe_ip_if() { +-interfaces=$(/sbin/ifconfig -u | grep ': flags=' | grep xn | cut -d ':' -f1) +-for if in $interfaces ; do +- echo $(echo $if | sed 's/xn/eth/g') "|" $(/sbin/ifconfig $if | grep 'inet ' | cut -d ' ' -f2) +-done ++ interfaces=$(/sbin/ifconfig -u | grep ': flags=' | grep xn | cut -d ':' -f1) ++ n=0 ++ for ifacename in $interfaces ; do ++ v4ips=$(/sbin/ifconfig $ifacename | grep 'inet ' | cut -d ' ' -f2) ++ # FreeBSD reports some IPv6 addrs like fe80:1234::abcd%xn0, the `cut` strips that off ++ v6ips=$(/sbin/ifconfig $ifacename | grep 'inet6 ' | cut -d ' ' -f2 | cut -d % -f 1 ) ++ i=0 ++ for v4ip in $v4ips ++ do ++ echo "vif/$n/ipv4/$i | $v4ip" ++ i=$(($i+1)) ++ done ++ ++ i=0 ++ for v6ip in $v6ips ++ do ++ echo "vif/$n/ipv6/$i | $v6ip" ++ i=$(($i+1)) ++ done ++ n=$(($n+1)) ++ done + } + + if [ $MEMORY_MODE -eq 1 ] ; then +@@ -140,22 +165,33 @@ fi + xenstore_write_cached "data/meminfo_free" "$memavail" + fi + ++# xe_ip_if | while read linea ++# do ++# if=$(echo $linea | cut -d '|' -f1 | sed 's/ //g') ++# inet=$(echo $linea | cut -d '|' -f2 | sed 's/^ //') ++# xenstore_write_cached "attr/${if}/ip" "${inet}" ++# done ++ ++# This breaks apart a string like "vif/0/ipv4/0 | 172.16.0.8" into 2 arguments for ++# xenstore_write_cached + xe_ip_if | while read linea + do +- if=$(echo $linea | cut -d '|' -f1 | sed 's/ //g') +- inet=$(echo $linea | cut -d '|' -f2 | sed 's/^ //') +- xenstore_write_cached "attr/${if}/ip" "${inet}" ++ if=$(echo $linea | cut -d '|' -f1 | tr -d ' ' ) ++ inet=$(echo $linea | cut -d '|' -f2 | tr -d ' ' ) ++ xenstore_write_cached "attr/${if}" "${inet}" + done + + # remove any interfaces that have been unplugged or downed +-for at in $(xenstore_list_interfaces_cached) ; do ++for xn in $(xenstore_list_interfaces_cached) ; do + link=1 +- xn=$(echo $at | sed 's/eth/xn/') +- iface=$(/sbin/ifconfig $xn | grep UP | cut -d ':' -f1) ++ iface=$(/sbin/ifconfig $xn | grep "UP," | cut -d ':' -f1) + [ "${iface}" = "${xn}" ] && link=0 + + if [ "$link" -gt "0" ] ; then +- xenstore_rm_cached "attr/${at}" ++ # bsd-named interface is gone, remove attr from xenstore ++ vifnum=$(echo $xn | sed 's/xn//g') ++ echo "removing vif $vifnum" ++ xenstore_rm_cached "attr/vif/${vifnum}" + fi + done + +@@ -174,9 +210,9 @@ xenstore_write_cached "attr/PVAddons/MajorVersion" "6" # build time addons --xenstore_write_cached "attr/PVAddons/MajorVersion" "6" + xenstore_write_cached "attr/PVAddons/MajorVersion" "6" -xenstore_write_cached "attr/PVAddons/MinorVersion" "0" -xenstore_write_cached "attr/PVAddons/MicroVersion" "2" -xenstore_write_cached "attr/PVAddons/BuildVersion" "54078" -+xenstore_write_cached "attr/PVAddons/MajorVersion" "6" +xenstore_write_cached "attr/PVAddons/MinorVersion" "2" -+xenstore_write_cached "attr/PVAddons/MicroVersion" "0" ++xenstore_write_cached "attr/PVAddons/MicroVersion" "1" +xenstore_write_cached "attr/PVAddons/BuildVersion" "76888" xenstore_write_cached "attr/PVAddons/Installed" "1"