On 11/09/2011 11:11 PM, Xu He Jie wrote:
+++ b/include/libvirt/libvirt.h.in
@@ -1640,6 +1640,32 @@ int virDomainBlockJobSetSpeed(virDomainPtr
dom, const char *path,
int virDomainBlockPull(virDomainPtr dom, const char *path,
unsigned long bandwidth, unsigned int flags);

+/*
+ * Block I/O throttling support
+ */
+
+typedef struct _virDomainBlockIoTuneInfo virDomainBlockIoTuneInfo;
+struct _virDomainBlockIoTuneInfo {

This is not extensible. We've already learned the hard way that this
MUST use virTypedParameter to make future additions painless, rather
than hard-coding a particular structure.

virTypedParameter is used between libvirt client and libvirtd. It isn't
used between libvirtd and qemu.

Correct - the public interface must use virTypedParameter. Once we get to qemu_driver.c, we can then convert from virTypedParameter to a struct specific to qemu, but that struct should probably be declared in qemu_monitor.h, and certainly NOT declared in libvirt.h.in.

Qemu monitor send all the setting parameters at one time within qmp
command made by qemuMonitorJSONMakeCommand,
the union struct virTypeParameter is not very suitable for it. So we
still use struct virDomainBlockIoTuneInfo
to keep consistent for qemu monitor command.

I have no problems with qemu monitor using a struct, my heartburn was with the introduction of a new public struct.

--
Eric Blake   ebl...@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to