From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55363) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aNboK-0004ua-LQ for qemu-devel@nongnu.org; Mon, 25 Jan 2016 02:43:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aNboF-0003G9-RO for qemu-devel@nongnu.org; Mon, 25 Jan 2016 02:43:40 -0500 Received: from szxga02-in.huawei.com ([119.145.14.65]:61454) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aNboF-0003G0-2c for qemu-devel@nongnu.org; Mon, 25 Jan 2016 02:43:35 -0500 References: <1453451811-11860-1-git-send-email-zhang.zhanghailiang@huawei.com> <1453451811-11860-8-git-send-email-zhang.zhanghailiang@huawei.com> <56A5B1CC.1080801@redhat.com> From: Hailiang Zhang Message-ID: <56A5D21A.90003@huawei.com> Date: Mon, 25 Jan 2016 15:43:22 +0800 MIME-Version: 1.0 In-Reply-To: <56A5B1CC.1080801@redhat.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH RFC 7/7] net/filter: prevent the default filter to be deleted List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jason Wang , qemu-devel@nongnu.org Cc: peter.huangpeng@huawei.com, zhangchen.fnst@cn.fujitsu.com, hongyang.yang@easystack.cn On 2016/1/25 13:25, Jason Wang wrote: > > > On 01/22/2016 04:36 PM, zhanghailiang wrote: >> Signed-off-by: zhanghailiang >> --- >> net/filter.c | 8 ++++++++ >> 1 file changed, 8 insertions(+) >> >> diff --git a/net/filter.c b/net/filter.c >> index a126a3b..4aafff0 100644 >> --- a/net/filter.c >> +++ b/net/filter.c >> @@ -323,11 +323,19 @@ static void netfilter_finalize(Object *obj) >> g_free(nf->netdev_id); >> } >> >> +static bool netfilter_can_be_deleted(UserCreatable *uc, Error **errp) >> +{ >> + NetFilterState *nf = NETFILTER(uc); >> + /* Forbid the default filter to be deleted */ >> + return !nf->is_default; >> +} >> + >> static void netfilter_class_init(ObjectClass *oc, void *data) >> { >> UserCreatableClass *ucc = USER_CREATABLE_CLASS(oc); >> >> ucc->complete = netfilter_complete; >> + ucc->can_be_deleted = netfilter_can_be_deleted; >> } >> >> static const TypeInfo netfilter_info = { > > This looks unnecessary. As I replied in previous mails, there's no need > to differ default netfilter from others. For COLO specifically, I know > it's a kind of mis-configuration you want to avoid, but that's not the > business of qemu. (Even if this is accepted, user could still mis > configure the netfitler that can break COLO). > Got it, will drop this patch in next version, thanks.