From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54432) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V06k3-0007Vy-Qz for qemu-devel@nongnu.org; Fri, 19 Jul 2013 05:12:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V06k1-0002aS-V8 for qemu-devel@nongnu.org; Fri, 19 Jul 2013 05:12:47 -0400 Received: from e23smtp06.au.ibm.com ([202.81.31.148]:48580) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V06k1-0002a0-8p for qemu-devel@nongnu.org; Fri, 19 Jul 2013 05:12:45 -0400 Received: from /spool/local by e23smtp06.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 19 Jul 2013 19:04:59 +1000 Received: from d23relay04.au.ibm.com (d23relay04.au.ibm.com [9.190.234.120]) by d23dlp02.au.ibm.com (Postfix) with ESMTP id B17E32BB0052 for ; Fri, 19 Jul 2013 19:12:40 +1000 (EST) Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay04.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r6J8vMZ667043388 for ; Fri, 19 Jul 2013 18:57:22 +1000 Received: from d23av01.au.ibm.com (loopback [127.0.0.1]) by d23av01.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r6J9Cdi2024830 for ; Fri, 19 Jul 2013 19:12:39 +1000 Message-ID: <51E902FB.3040203@linux.vnet.ibm.com> Date: Fri, 19 Jul 2013 17:12:27 +0800 From: Wenchao Xia MIME-Version: 1.0 References: <1373521624-4380-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1373521624-4380-3-git-send-email-xiawenc@linux.vnet.ibm.com> <20130718110704.GC9328@stefanha-thinkpad.redhat.com> In-Reply-To: <20130718110704.GC9328@stefanha-thinkpad.redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH V5 2/8] snapshot: distinguish id and name in snapshot delete List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: kwolf@redhat.com, phrdina@redhat.com, famz@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com, lcapitulino@redhat.com, stefanha@redhat.com, pbonzini@redhat.com, dietmar@proxmox.com 于 2013-7-18 19:07, Stefan Hajnoczi 写道: > On Thu, Jul 11, 2013 at 01:46:58PM +0800, Wenchao Xia wrote: >> diff --git a/include/qemu-common.h b/include/qemu-common.h >> index f439738..06c777f 100644 >> --- a/include/qemu-common.h >> +++ b/include/qemu-common.h >> @@ -191,6 +191,9 @@ int64_t strtosz_suffix(const char *nptr, char **end, const char default_suffix); >> int64_t strtosz_suffix_unit(const char *nptr, char **end, >> const char default_suffix, int64_t unit); >> >> +/* used to print char* safely */ >> +#define STR_PRINT_CHAR(str) ((str) ? (str) : "null") > > When I saw the name I thought it would filter out non-printable > characters. Maybe STR_OR_NULL() is a better name? > I'll use STR_OR_NULL(), looks better. > BTW the evil gcc shortcut is pretty quick to type: str ?: "null". > > Besides this I'm pretty happy with this version. > -- Best Regards Wenchao Xia