<div dir="ltr"><div><div>Hi,<br><br>On Tue, Sep 22, 2015 at 6:53 PM, Daniel P. Berrange <<a href="mailto:berrange@redhat.com">berrange@redhat.com</a>> wrote:<br>><br>> On Tue, Sep 22, 2015 at 07:50:41AM -0400, John Ferlan wrote:<br>> ><br>> ><br>> > On 09/17/2015 04:46 AM, Shivangi Dhir wrote:<br>> > > These patches solve a BiteSizedTask - Introduce new virtType enum item[0]<br>> > ><br>> > > [0] <a href="http://wiki.libvirt.org/page/BiteSizedTasks#Introduce_new_virtType_enum_item">http://wiki.libvirt.org/page/BiteSizedTasks#Introduce_new_virtType_enum_item</a><br>> > ><br>> > > Shivangi Dhir (3):<br>> > >   conf: Add new VIR_DOMAIN_VIRT_NONE enum<br>> > >   qemu: Make virtType of type virDomainVirtType<br>> > >   conf: Change the description of virCapabilitiesDomainDataLookup()<br>> > ><br>> > >  src/conf/capabilities.c      |  6 +++---<br>> > >  src/conf/domain_conf.c       |  3 ++-<br>> > >  src/conf/domain_conf.h       |  3 ++-<br>> > >  src/qemu/qemu_monitor.c      |  2 +-<br>> > >  src/qemu/qemu_monitor.h      |  2 +-<br>> > >  src/qemu/qemu_monitor_json.c |  2 +-<br>> > >  src/qemu/qemu_monitor_json.h |  2 +-<br>> > >  src/qemu/qemu_monitor_text.c |  2 +-<br>> > >  src/qemu/qemu_monitor_text.h |  2 +-<br>> > >  tests/qemumonitorjsontest.c  |  2 +-<br>> > >  tests/vircapstest.c          | 32 ++++++++++++++++----------------<br>> > >  11 files changed, 30 insertions(+), 28 deletions(-)<br>> > ><br>> ><br>> > While yes this is a bite sized task, I do have a concern with changing<br>> > the meaning of undefined from -1 to 0. Doing so will change (increase by<br>> > 1) each of the VIR_DOMAIN_VIRT_* values, e.g. VIR_DOMAIN_VIRT_QEMU<br>> > changes from 0 to 1. If you look through the history of changes to<br>> > virDomainVirtType you'll note it's been appended to and never had<br>> > something inserted in the middle.<br>> ><br>> > Inserting in the middle is not a problem if we could "guarantee" that<br>> > nothing exists (saved) or is currently running that references an<br>> > existing numerical value. Unfortunately, I'm not sure we can do that.<br>> ><br>> > As seen in patch 2, there is a 'virtType' value in the domain<br>> > definition. A running domain VIR_DOMAIN_VIRT_QEMU would have been<br>> > started with "0" in that field. When a new libvirtd with these changes<br>> > is in place, the running domain would still have "0" stored away and<br>> > that would mean something different.<br>> ><br>> > Furthermore (or likewise), a migration from an "older" host to a newer<br>> > host would have a different virtType value and I would think cause<br>> > virDomainDefCheckABIStability to complain. Similarly, a 'saved' domain<br>> > would have a numerical anomaly - although for that case it's less clear<br>> > whether we save the physical name or the numerical value.<br>> ><br>> > Of course I could be off-base/wrong, but let's see what others say...<br>><br>> In general we should never be serializing the raw integer enum<br>> values only the string representation. If we did have somewhere<br>> that used an integer representation, we'd certainly have to avoid<br>> this change as you mention. I think we're probably safe though<br>> unless someone knows of a place we don't use the string rep.<br>><br>> ><br>> > FWIW: For a "first" patch set - it seems you've followed the guidelines<br>> > quite well. About the only suggestions I have are in patch1 the<br>> > comparison "if (domaintype)" in virCapabilitiesDomainDataLookupInternal<br>> > could be "if (domaintype > VIR_DOMAIN_VIRT_NONE)" as well as patch3<br>> > should be merged with patch1 and the "int domaintype" in the args list<br>> > for virCapabilitiesDomainDataLookup (and capabilities.h) should be<br>> > "virDomainVirtType domaintype".<br>><br><br></div>Thanks alot for your feedback.<br></div>Should I modify and resend the patches after making the changes suggested above, if there are no other issues ?<br><br><br><div>--<br><div>Regards,<br>Shivangi Dhir</div></div></div>