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