From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51701) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZVS4E-0002IE-2l for qemu-devel@nongnu.org; Fri, 28 Aug 2015 18:24:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZVS4A-0002Mv-VW for qemu-devel@nongnu.org; Fri, 28 Aug 2015 18:24:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33837) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZVS4A-0002Mk-No for qemu-devel@nongnu.org; Fri, 28 Aug 2015 18:24:10 -0400 References: <1438159544-6224-1-git-send-email-zhang.zhanghailiang@huawei.com> <1438159544-6224-22-git-send-email-zhang.zhanghailiang@huawei.com> From: Eric Blake Message-ID: <55E0DF83.6080501@redhat.com> Date: Fri, 28 Aug 2015 16:24:03 -0600 MIME-Version: 1.0 In-Reply-To: <1438159544-6224-22-git-send-email-zhang.zhanghailiang@huawei.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="913av7WibIUHOnBKi49gSmeEAsgso2Uwx" 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: zhanghailiang , 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 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --913av7WibIUHOnBKi49gSmeEAsgso2Uwx Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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/ >=20 > We parse these parameter in tap. s/parameter/parameters/ >=20 > 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 cap= able tap > # > +# @forward_nic: #optional the name of host physical forward nic for CO= LO (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? --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --913av7WibIUHOnBKi49gSmeEAsgso2Uwx Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJV4N+DAAoJEKeha0olJ0Nq/NcH/ROXFDXu4Agi9q7h5f7N8eJZ dkcBPtPyIhY2OO3r8e72K86KSeaYNIC7kGynSJgmqnnnDEbXg6tz3632FlHFTtGZ 9wz6x0m49Z9hWCJeo2VozpLLsoVfphl/vq3CpxhvDStiwL/wc9pO3TDDXaScNotp OIVb/oIT71AOEaxC6EXHLOboJYDC1cddlIfuUWXnpRBCFrlUATpfWJCSdgnB/qF0 Mx/J3zu79oElLguf/zk0cljWtYFGweC3QkjVGZ3Kw9DZNH3WmYi6b3Lv2cnssFNi GmRETXuw+liCLJJx9+nFF9X1b2YhK0CRILW2fRpvkDoPgsCP7SF5BpE8EehIerE= =0lkp -----END PGP SIGNATURE----- --913av7WibIUHOnBKi49gSmeEAsgso2Uwx--