[libvirt] [libvirt-glib] gconfig: API for SPICE image compression options

Christophe Fergeau cfergeau at redhat.com
Tue Mar 12 17:07:42 UTC 2013


On Tue, Mar 12, 2013 at 06:28:36PM +0200, Zeeshan Ali (Khattak) wrote:
> On Tue, Mar 12, 2013 at 3:16 PM, Christophe Fergeau <cfergeau at redhat.com> wrote:
> > On Sat, Mar 09, 2013 at 04:44:14PM +0200, Zeeshan Ali (Khattak) wrote:
> >> From: "Zeeshan Ali (Khattak)" <zeeshanak at gnome.org>
> >>
> >> This patch adds API to set/get image compression options on
> >> domain/graphics[@type='spice'] nodes.
> >>
> >> Also included are simple tests for this API.
> >
> > Do we really need a dedicated gobject for this? I would have gone with
> > gvir_config_domain_graphics_spice_[gs]et_image_compression()
> 
> It would have been easier to go w/o a separate object but I went this
> way since 'image' is a separate node in the config and I would assume
> its for a reason. One reason that comes to mind is that in future
> there might be some other options being added here?

We don't always go with 'one node' = 'one class', see the <os> node for
example, or gvir_config_domain_disk_set_startup_policy (various other
similar examples in this case).
For xml nodes that are very simple, they generally are modelled along with
the parent node, we can always deprecate the simple setter in the parent
node if the node gets more complex in the future.
It's something to decide on a case by case basis, but here I'd tend to go
with the simpler approach.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130312/535ac8e8/attachment-0001.sig>


More information about the libvir-list mailing list