From nobody Sat Feb 7 08:44:21 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1643019778; cv=none; d=zohomail.com; s=zohoarc; b=OijYFoPhIuap8pvEcp8Nf6ZfsiV5TqK2P/WtjjFl33bMt7vr9CFZMKj+uBDCFLYshvserkj1viQ8xnFppvxJzysnsArlecHT605PKR+f6UHaLCRYK9kuOBPBjPY+DLIMmezjt7Z9nhEWw2FWPbO2SgiHCVKbqaowsl/Wk9hl4mE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1643019778; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=3+0md9az7qVGOq6ns7hMrPL1YC84U2kkSoagCUhx+1Y=; b=IPa4swrUhUjU5c8k1BtfqpG15DZQEkt4bnGxU4ZLyG5XC6rHufNGVq471SSfrFnRakO5f1jucLXhT9D9YMyiDPklgIIAu0HJqax4ldnBsXVlMoP/V1pSR+DTlWJ+rH5k3qv0UKN7xM82ovlh9UI7sKGnzZkzVPRQt1KV95VfkvI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1643019778956455.9127110886898; Mon, 24 Jan 2022 02:22:58 -0800 (PST) Received: from localhost ([::1]:49706 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nBwV0-00012e-8c for importer@patchew.org; Mon, 24 Jan 2022 05:22:58 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43698) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nBwSN-0007KC-Aw for qemu-devel@nongnu.org; Mon, 24 Jan 2022 05:20:16 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:23906) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nBwSI-0006yd-Rj for qemu-devel@nongnu.org; Mon, 24 Jan 2022 05:20:13 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-496-2d-iaW0IMW-zhLFusz10Nw-1; Mon, 24 Jan 2022 05:20:06 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4E6691018726; Mon, 24 Jan 2022 10:20:05 +0000 (UTC) Received: from thuth.com (unknown [10.39.193.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id E125F73177; Mon, 24 Jan 2022 10:20:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643019608; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3+0md9az7qVGOq6ns7hMrPL1YC84U2kkSoagCUhx+1Y=; b=PG2yKYDUXqPE09HugVx1UMDwyJTLqIJuJGMU7+sSd9BkmwtczSZbi7IPiZQt/4X1RKBO+G 7YLs3+7+Kh5tsnP8z8ZBqczcHxwWiXe6id71nPP+bW+rKrPVDnF8YKJXkM4Py+oETci5/m sGmvWpsshPacKf5V5QrBGz5FKbCZFUc= X-MC-Unique: 2d-iaW0IMW-zhLFusz10Nw-1 From: Thomas Huth To: qemu-devel@nongnu.org Subject: [PATCH] scripts: Remove the old switch-timer-api script Date: Mon, 24 Jan 2022 11:20:01 +0100 Message-Id: <20220124102001.35930-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=thuth@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.158, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Peter Maydell Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1643019780814100001 Content-Type: text/plain; charset="utf-8" This script has been useful for the timer API rewrite in 2013, but it is of no use anymore today. Let's remove it now. Signed-off-by: Thomas Huth --- scripts/switch-timer-api | 178 --------------------------------------- 1 file changed, 178 deletions(-) delete mode 100755 scripts/switch-timer-api diff --git a/scripts/switch-timer-api b/scripts/switch-timer-api deleted file mode 100755 index 41736d11dd..0000000000 --- a/scripts/switch-timer-api +++ /dev/null @@ -1,178 +0,0 @@ -#!/usr/bin/env perl - -use strict; -use warnings; -use Getopt::Long; -use FindBin; - -my @legacy =3D qw(qemu_clock_ptr qemu_get_clock_ns qemu_get_clock_ms qemu_= register_clock_reset_notifier qemu_unregister_clock_reset_notifier qemu_new= _timer qemu_free_timer qemu_del_timer qemu_mod_timer_ns qemu_mod_timer qemu= _run_timers qemu_new_timer_ns qemu_new_timer_us qemu_new_timer_ms); -my $legacyre =3D '\b('.join('|', @legacy).')\b'; -my $option_git; -my $option_dryrun; -my $option_quiet; -my $option_rtc; -my $suffix=3D".tmp.$$"; -my @files; -my $getfiles =3D 'git grep -l -E \'\b((host|rt|vm|rtc)_clock\b|qemu_\w*tim= er)\' | egrep \'\.[ch]$\' | egrep -v \'qemu-timer\.c$|include/qemu/timer\.h= $\''; - -sub Syntax -{ - print STDERR < \$option_dryrun, - "git|g" =3D> \$option_git, - "quiet|q" =3D> \$option_quiet, - "rtc|r" =3D> \$option_rtc, - "help|h" =3D> sub { Syntax(); exit(0); } - )) - { - Syntax(); - die "Bad options"; - } - - if ($#ARGV >=3D0) - { - @files =3D @ARGV; - } - else - { - @files =3D split(/\s+/, `$getfiles`); - } - - foreach my $file (@files) - { - die "Cannot find $file" unless (-f $file && -r $file); - } -} - -sub DoWarn -{ - my $text =3D shift @_; - my $line =3D shift @_; - return if ($option_quiet); - chomp ($line); - print STDERR "$text\n"; - print STDERR "$line\n\n"; -} - -sub Process -{ - my $ifn =3D shift @_; - my $ofn =3D $ifn.$suffix; - - my $intext; - my $outtext; - my $linenum =3D 0; - - open my $input, "<", $ifn || die "Cannot open $ifn for read: $!"; - - while (<$input>) - { - my $line =3D $_; - $intext .=3D $line; - $linenum++; - - # fix the specific uses - unless ($option_rtc) - { - $line =3D~ s/\bqemu_new_timer(_[num]s)\s*\((vm_|rt_|host_)clock\b/tim= er_new$1(XXX_$2clock/g; - $line =3D~ s/\bqemu_new_timer\s*\((vm_|rt_|host_)clock\b/timer_new(XX= X_$1clock/g; - $line =3D~ s/\bqemu_get_clock(_[num]s)\s*\((vm_|rt_|host_)clock\b/qem= u_clock_get$1(XXX_$2clock/g; - } - - # rtc is different - $line =3D~ s/\bqemu_new_timer(_[num]s)\s*\(rtc_clock\b/timer_new$1(rtc_cl= ock/g; - $line =3D~ s/\bqemu_new_timer\s*\(rtc_clock\b/timer_new(rtc_clock/g; - $line =3D~ s/\bqemu_get_clock(_[num]s)\s*\(rtc_clock\b/qemu_clock_get$1(r= tc_clock/g; - $line =3D~ s/\bqemu_register_clock_reset_notifier\s*\(rtc_clock\b/qemu_re= gister_clock_reset_notifier(qemu_clock_ptr(rtc_clock)/g; - - unless ($option_rtc) - { - # fix up comments - $line =3D~ s/\b(vm_|rt_|host_)clock\b/XXX_$1clock/g if ($line =3D~ m,= ^[/ ]+\*,); - - # spurious fprintf error reporting - $line =3D~ s/: qemu_new_timer_ns failed/: timer_new_ns failed/g; - - # these have just changed name - $line =3D~ s/\bqemu_mod_timer\b/timer_mod/g; - $line =3D~ s/\bqemu_mod_timer_(ns|us|ms)\b/timer_mod_$1/g; - $line =3D~ s/\bqemu_free_timer\b/timer_free/g; - $line =3D~ s/\bqemu_del_timer\b/timer_del/g; - } - - # fix up rtc_clock - $line =3D~ s/QEMUClock \*rtc_clock;/QEMUClockType rtc_clock;/g; - $line =3D~ s/\brtc_clock =3D (vm_|rt_|host_)clock\b/rtc_clock =3D XXX_$1c= lock/g; - - unless ($option_rtc) - { - # replace any more general uses - $line =3D~ s/\b(vm_|rt_|host_)clock\b/qemu_clock_ptr(XXX_$1clock)/g; - } - - # fix up the place holders - $line =3D~ s/\bXXX_vm_clock\b/QEMU_CLOCK_VIRTUAL/g; - $line =3D~ s/\bXXX_rt_clock\b/QEMU_CLOCK_REALTIME/g; - $line =3D~ s/\bXXX_host_clock\b/QEMU_CLOCK_HOST/g; - - unless ($option_rtc) - { - DoWarn("$ifn:$linenum WARNING: timer $1 not fixed up", $line) if ($li= ne =3D~ /\b((vm_|rt_|host_)clock)\b/); - DoWarn("$ifn:$linenum WARNING: function $1 not fixed up", $line) if (= $line =3D~ /\b(qemu_new_timer\w+)\b/); - DoWarn("$ifn:$linenum WARNING: legacy function $1 remains", $line) if= ($line =3D~ /$legacyre/o); - } - - $outtext .=3D $line; - } - - close $input; - - if ($intext ne $outtext) - { - print STDERR "Patching $ifn\n" unless ($option_quiet); - unless ($option_dryrun) - { - open my $output, ">", $ofn || die "Cannot open $ofn for write: $!"; - print $output $outtext; - close $output; - rename ($ofn, $ifn) || die "Cannot rename temp file to $ifn: $!"; - return 1; - } - } - return 0; -} - -sub DoCommit -{ - my $file =3D shift @_; - open (my $git, "| git commit -F - $file") || die "Cannot run git commi= t on $file: $!"; - print $git "timers api: use new timer api in $file\n\nConvert $file to= use new timer API.\nThis is an automated commit made by scripts/switch-tim= er-api\n"; - close ($git); -} - -ParseOptions; - -foreach my $file (@files) -{ - my $changed =3D Process ($file); - DoCommit($file) if ($changed && $option_git); -} --=20 2.27.0