* [EMAIL PROTECTED] [2008-01-23 16:29:17]
>> I'd like reviewers for a fix for:
>>     6651973 hvm migration: cannot open dlpi interface
>>  webrev is at:
>>    http://dme.org/solaris/webrev/6651973/sunos.hg/
>
> It's probably not performance critical, but I think you
> can save two forks / execs / processes by matching
> lines and counting them all with nawk, something like
> this:

I'm reminded of David Tilbrook: "Whenever faced with a problem, some
people say `Lets use AWK.'  Now, they have two problems."

>   73 set_refcount()
>   74 {
>   75         #
>   76         # Set $refcount to the number of times $1 is referenced as a nic
>   77         # used by a backend device in xenstore.
>   78         #
>   80         refcount=`xenstore-ls backend/vif | \
>   81             nawk -v nic=' "'$1'"' -F= 'BEGIN { n = 0; } $1=="  nic " && 
> $2 == nic { n++;} END { print n; }' `
>   83 }

Thanks!

dme.
-- 
David Edmondson, Sun Microsystems, http://dme.org
_______________________________________________
xen-discuss mailing list
[email protected]

Reply via email to