Re: [PATCH 1/8] Add new API virDomain{Set, Get}BlockIoTune

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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   eblake@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

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


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]