On Mon, Feb 03, 2014 at 10:12:58AM -0700, Eric Blake wrote: > On 02/03/2014 09:16 AM, Michal Privoznik wrote: > > So far, we have just bare virDomainSuspend() API that suspends a domain. > > However, in the future there might occur a case, in which we may want > > to modify suspend behavior slightly. In that case, @flags are useful. > > > > Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx> > > --- > > include/libvirt/libvirt.h.in | 2 ++ > > src/driver.h | 5 +++++ > > src/libvirt.c | 49 ++++++++++++++++++++++++++++++++++++++++---- > > src/libvirt_public.syms | 5 +++++ > > src/remote/remote_driver.c | 1 + > > src/remote/remote_protocol.x | 13 +++++++++++- > > src/remote_protocol-structs | 5 +++++ > > 7 files changed, 75 insertions(+), 5 deletions(-) > > Back when we added virDomainShutdownFlags in 0.9.10, I asked if we > should also add *Flags variants for remaining functions without them; at > the time, we decided against it, but I'm not quite sure why. > > I'm perfectly fine with adding this for the sake of making future > additions easier, even if we don't have a use for the flags now - it's > easier to support a flag than it is to rebase to pick up a new function > for any situation where the .so contains a flags function, but it may be > worth getting a second opinion before pushing, if you don't have a plan > to use flags right away. > I like this approach as there are many issues that can be easily solved in case there is a 'Flags' version of some API. That's why we advocate usage of a flags parameter in new APIs even when it is not yet used. Although I was wondering whether it would be too much overkill to use 'Params' instead of 'Flags' as Jiri did with migrations as that has way more power. And that's for both new APIs and this change proposed by Michal. Have a nice day, Martin
Attachment:
signature.asc
Description: Digital signature
-- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list