
On Tue, Apr 18, 2017 at 11:38:09AM +0200, Peter Krempa wrote:
On Thu, Apr 13, 2017 at 16:57:13 +0200, Pavel Hrdina wrote:
These functions don't require the whole virDomainDef structure, they only need *machine* and *arch*.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/qemu/qemu_alias.c | 4 +-- src/qemu/qemu_capabilities.c | 10 +++--- src/qemu/qemu_command.c | 42 +++++++++++----------- src/qemu/qemu_domain.c | 79 ++++++++++++++++++++++-------------------- src/qemu/qemu_domain.h | 14 ++++---- src/qemu/qemu_domain_address.c | 16 ++++----- src/qemu/qemu_hotplug.c | 14 ++++---- src/qemu/qemu_parse_command.c | 8 ++--- 8 files changed, 95 insertions(+), 92 deletions(-)
In most cases where this is used you have the domain object so it's more straightfowrward to extract it from that.
I'm suggesting that you modify qemuDomainMachineHasBuiltinIDE and friends to be a wrapper which only extracts the os.machine object from def and calls a new helper which will not take the domain (and not contain the word "Domain"). That way you won't have to make all other callers uglier.
I had the same idea to create wrapper just for this case and don't mess with the existing functions. I agree that having nice helper that will extract required variables form virDomainDef is convenient. I'll rework this patch. Thanks, Pavel
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list