From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cyrill Gorcunov Subject: Re: [PATCH] kvm tool: Make kvm structure to carry name copy Date: Sat, 4 Feb 2012 16:20:05 +0400 Message-ID: <20120204122005.GA14818@moon> References: <20120203195715.GF3314@moon> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Sasha Levin , Asias He , Ingo Molnar , KVM-ML To: Pekka Enberg Return-path: Received: from mail-bk0-f46.google.com ([209.85.214.46]:65527 "EHLO mail-bk0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751188Ab2BDMUK (ORCPT ); Sat, 4 Feb 2012 07:20:10 -0500 Received: by bkcjm19 with SMTP id jm19so3709427bkc.19 for ; Sat, 04 Feb 2012 04:20:08 -0800 (PST) Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Sat, Feb 04, 2012 at 02:15:36PM +0200, Pekka Enberg wrote: > On Fri, 3 Feb 2012, Cyrill Gorcunov wrote: > >If guest name is used (which is default case) the kvm might end > >up carrying the pointer to name which is allocated on stack. > > > >kvm_cmd_run_init > > (on stack) default_name > > kvm__init(..., default_name) > > kvm->name = default_name > > > >So I think better to allow kvm to carry own copy > >of guest name. 64 symbols should be more than enough. > > > >Signed-off-by: Cyrill Gorcunov > >--- > > > >I hope I didn't miss anything? > > Can't we just use strdup()? > Yeah, I think this will be even better, I'll update. Cyrill