From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50669) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uzm3K-0005Tj-5P for qemu-devel@nongnu.org; Thu, 18 Jul 2013 07:07:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uzm3J-0006u5-2S for qemu-devel@nongnu.org; Thu, 18 Jul 2013 07:07:18 -0400 Received: from mail-we0-x229.google.com ([2a00:1450:400c:c03::229]:41327) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uzm3I-0006tP-S1 for qemu-devel@nongnu.org; Thu, 18 Jul 2013 07:07:17 -0400 Received: by mail-we0-f169.google.com with SMTP id n57so2797747wev.14 for ; Thu, 18 Jul 2013 04:07:16 -0700 (PDT) Date: Thu, 18 Jul 2013 19:07:04 +0800 From: Stefan Hajnoczi Message-ID: <20130718110704.GC9328@stefanha-thinkpad.redhat.com> References: <1373521624-4380-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1373521624-4380-3-git-send-email-xiawenc@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1373521624-4380-3-git-send-email-xiawenc@linux.vnet.ibm.com> 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: Wenchao Xia Cc: kwolf@redhat.com, phrdina@redhat.com, famz@redhat.com, armbru@redhat.com, qemu-devel@nongnu.org, lcapitulino@redhat.com, stefanha@redhat.com, pbonzini@redhat.com, dietmar@proxmox.com 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? BTW the evil gcc shortcut is pretty quick to type: str ?: "null". Besides this I'm pretty happy with this version.