From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50373) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWMmq-0002JH-Tb for qemu-devel@nongnu.org; Mon, 31 Aug 2015 06:58:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZWMmm-0006n7-MH for qemu-devel@nongnu.org; Mon, 31 Aug 2015 06:58:04 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:52287) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWMmm-0006lc-1i for qemu-devel@nongnu.org; Mon, 31 Aug 2015 06:58:00 -0400 References: <1438159544-6224-1-git-send-email-zhang.zhanghailiang@huawei.com> <1438159544-6224-22-git-send-email-zhang.zhanghailiang@huawei.com> <55E0DF83.6080501@redhat.com> From: zhanghailiang Message-ID: <55E43310.4020506@huawei.com> Date: Mon, 31 Aug 2015 18:57:20 +0800 MIME-Version: 1.0 In-Reply-To: <55E0DF83.6080501@redhat.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH COLO-Frame v8 21/34] COLO: Add new command parameter 'forward_nic' 'colo_script' for net List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , qemu-devel@nongnu.org Cc: lizhijian@cn.fujitsu.com, quintela@redhat.com, Markus Armbruster , Jason Wang , yunhong.jiang@intel.com, eddie.dong@intel.com, peter.huangpeng@huawei.com, dgilbert@redhat.com, arei.gonglei@huawei.com, Stefan Hajnoczi , amit.shah@redhat.com Hi Eric This patch will be dropped in next version since we will realize the proxy in qemu. Thanks, zhanghailiang On 2015/8/29 6:24, Eric Blake wrote: > On 07/29/2015 02:45 AM, zhanghailiang wrote: >> The 'forward_nic' should be assigned with network name, >> for exmple, 'eth2'. It will be parameter of 'colo_script', > > s/exmple/example/ > >> 'colo_script' should be assigned with an scirpt path. > > s/scirpt/script/ > >> >> We parse these parameter in tap. > > s/parameter/parameters/ > >> >> Cc: Stefan Hajnoczi >> Cc: Jason Wang >> Cc: Eric Blake >> Cc: Markus Armbruster >> Signed-off-by: zhanghailiang >> Signed-off-by: Li Zhijian >> --- >> include/net/colo-nic.h | 23 +++++++++++++++++++++++ >> include/net/net.h | 2 ++ >> net/tap.c | 26 +++++++++++++++++++++++--- >> qapi-schema.json | 8 +++++++- >> qemu-options.hx | 7 +++++++ >> 5 files changed, 62 insertions(+), 4 deletions(-) >> create mode 100644 include/net/colo-nic.h > > Interface review. > > >> + >> +typedef struct COLONicState { >> + char nicname[128]; /* forward dev */ >> + char script[1024]; /* colo script */ >> + char ifname[128]; /* e.g. tap name */ >> +} COLONicState; > > Are these fixed-width fields sufficiently sized; and are you sure you > won't overflow the buffers? > > >> +++ b/qapi-schema.json >> @@ -2296,6 +2296,10 @@ >> # >> # @queues: #optional number of queues to be created for multiqueue capable tap >> # >> +# @forward_nic: #optional the name of host physical forward nic for COLO (Since 2.4) > > Long line, please wrap to fit in 80 columns. > >> +# >> +# @colo_script: #optional the script file which used by COLO (Since 2.4) > > 2.5 for both parameters. > > New parameters should favor '-' over '_' except for consistency with > older commands; I guess the fact that we already have 'vnet_hdr' > qualifies as that unfortunate consistency. > > Script files are very poor design. Management apps like libvirt CANNOT > police what happens in the script file, and have to mark the entire > domain as untrusted if a script file is used. Are you sure you can't > accomplish this through a saner method, such as allowing management to > pre-open an fd and pass that in to qemu, rather than having qemu execute > a script file? >