From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=38622 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PrzbL-0002vP-80 for qemu-devel@nongnu.org; Tue, 22 Feb 2011 16:16:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PrzbJ-0007qM-HB for qemu-devel@nongnu.org; Tue, 22 Feb 2011 16:16:55 -0500 Received: from mail-vx0-f173.google.com ([209.85.220.173]:35332) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PrzbJ-0007qA-DC for qemu-devel@nongnu.org; Tue, 22 Feb 2011 16:16:53 -0500 Received: by vxb41 with SMTP id 41so2169389vxb.4 for ; Tue, 22 Feb 2011 13:16:52 -0800 (PST) Message-ID: <4D6427C7.7020503@codemonkey.ws> Date: Tue, 22 Feb 2011 15:16:55 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [patch 2/3] Add support for live block copy References: <20110222170004.808373778@redhat.com> <20110222170115.710717278@redhat.com> In-Reply-To: <20110222170115.710717278@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Marcelo Tosatti Cc: Jes.Sorensen@redhat.com, qemu-devel@nongnu.org, avi@redhat.com On 02/22/2011 11:00 AM, Marcelo Tosatti wrote: > + > +static void blkcopy_switch(BdrvCopyState *s) > +{ > + char src_filename[1024]; > + int open_flags; > + > + strncpy(src_filename, s->src->filename, sizeof(src_filename)); > + open_flags = s->src->open_flags; > strncpy doesn't leave a NULL terminator if it runs out of space. I don't think that's your desire here. Regards, Anthony Liguori