|
From: | Zhang Chen |
Subject: | Re: [Qemu-devel] [PATCH V5 3/9] net/filter-mirror.c: Add new option to enable vnet support for filter-redirector |
Date: | Thu, 1 Jun 2017 15:18:41 +0800 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 |
On 05/26/2017 01:30 PM, Jason Wang wrote:
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. ThanksZhang ChenLooks 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.
OK, I will change it as you said in next version. Thanks ZhangChen
Thanks .
-- Thanks Zhang Chen
[Prev in Thread] | Current Thread | [Next in Thread] |