qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH RFC 7/7] net/filter: prevent the default filter


From: Hailiang Zhang
Subject: Re: [Qemu-devel] [PATCH RFC 7/7] net/filter: prevent the default filter to be deleted
Date: Mon, 25 Jan 2016 15:43:22 +0800
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1

On 2016/1/25 13:25, Jason Wang wrote:


On 01/22/2016 04:36 PM, zhanghailiang wrote:
Signed-off-by: zhanghailiang <address@hidden>
---
  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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]