----- Original Message ----- > From: "Moti Asayag" <[email protected]> > To: "Martin Perina" <[email protected]> > Cc: [email protected] > Sent: Tuesday, May 14, 2013 12:14:14 PM > Subject: Re: [Engine-devel] Engine config and device custom properties > > Hi Martin, > > By looking at the code - there seems no validator for the format provided > by the user for the UserDefinedVMProperties. > > It seems that the engine will write an exception to log specifying the format > is invalid, > as the format is being validated during engine startup by > InitBackendServicesOnStartupBean.create() which invokes > VmPropertiesUtils.getInstance().init() > > Therefore there is a need to validate the format in earlier stage, when > setting the values > for the properties via the engine-config. > > 1. Extend the engine-config value helpers with a new type: > DevicePropertiesValueHelper extends > org.ovirt.engine.core.config.entity.helper.ValueHelper > and also a compliant DevicePropertiesValueHelperTest > > 2. DevicePropertiesValueHelper.validate() should reuse the parsing logic of > the device properties > from VmPropertiesUtils.parseVMPropertiesRegex() > > 3. Define the value helper for you new property in > packaging/etc/engine-config/engine-config.properties: > > CustomDeviceProperties.description="your description" > CustomDeviceProperties.type=DevicePropertiesValueHelper > > You the new install-dev to easily test you changes. > > Regards, > Moti
Moti gave a very good explanation. Actually , the very first question should have been - would we like to have this configurable via engine config? Are we going to defined a predefine set (i.e - in case of SAPAgent af predefined vm custom properties) or not. I actually now think we should go for this. Martin, the new value helper will not be able to validate on a specific key=value pair - the user will have to pass the entire string each time he changes this config value. Moti - any comments here? Anyway, this change can be done in parallel to Moti's work on custom device properties from network side (he will fill relevant values manually in the vdc_options table). Yair > > ----- Original Message ----- > > From: "Martin Perina" <[email protected]> > > To: [email protected] > > Sent: Tuesday, May 14, 2013 10:51:02 AM > > Subject: [Engine-devel] Engine config and device custom properties > > > > Hi, > > > > I'm working on a patch to support custom device properties in ovirt-engine. > > I would like that custom device properties format can be set using > > engine-config > > command in a similar way as UserDefinedVMProperties. What is needed to be > > done > > to support this? > > > > Thanks > > > > Martin > > _______________________________________________ > > Engine-devel mailing list > > [email protected] > > http://lists.ovirt.org/mailman/listinfo/engine-devel > > > _______________________________________________ > Engine-devel mailing list > [email protected] > http://lists.ovirt.org/mailman/listinfo/engine-devel > _______________________________________________ Engine-devel mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-devel
