qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH V5 3/9] net/filter-mirror.c: Add new option to e


From: Jason Wang
Subject: Re: [Qemu-devel] [PATCH V5 3/9] net/filter-mirror.c: Add new option to enable vnet support for filter-redirector
Date: Fri, 26 May 2017 13:30:29 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1



On 2017年05月25日 20:58, Zhang Chen wrote:
    static void filter_redirector_init(Object *obj)
  {
+    MirrorState *s = FILTER_REDIRECTOR(obj);
+
object_property_add_str(obj, "indev", filter_redirector_get_indev,
                              filter_redirector_set_indev, NULL);
object_property_add_str(obj, "outdev", filter_redirector_get_outdev,
                              filter_redirector_set_outdev, NULL);
+
+    /*
+     * The vnet_hdr is disabled by default, if you want to enable
+     * this option, you must enable all the option on related modules
+     * (like other filter or colo-compare).
+     */
+    s->vnet_hdr = false;
+ object_property_add_str(obj, "vnet_hdr", filter_redirector_get_vnet_hdr,
+                            filter_redirector_set_vnet_hdr, NULL);

Why not using object_property_add_bool()?

Because use object_property_add_bool() we should change the option from
"vnet_hdr=on/off" to "vnet_hdr", it seems hard to read for user.

Thanks
Zhang Chen

Looks like there's no exist use case for using str as boolean. And you can probably change the name to "vnet-hdr-support" to make it more readable.

Thanks



reply via email to

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