From d8d4b9d957930bbaf83199434d187ebd65b99723 Mon Sep 17 00:00:00 2001 From: Jiri Denemark Date: Tue, 17 May 2016 13:08:34 +0200 Subject: [PATCH] Remove virDomainRNGInsert It was just a useless wrapper around VIR_APPEND_ELEMENT*. --- src/conf/domain_conf.c | 12 ------------ src/conf/domain_conf.h | 3 --- src/libvirt_private.syms | 1 - src/qemu/qemu_driver.c | 2 +- src/qemu/qemu_hotplug.c | 3 +-- 5 files changed, 2 insertions(+), 19 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 658145386e..694e74ec9e 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -14039,18 +14039,6 @@ virDomainChrRemove(virDomainDefPtr vmdef, } -int -virDomainRNGInsert(virDomainDefPtr def, - virDomainRNGDefPtr rng, - bool inplace) -{ - if (inplace) - return VIR_APPEND_ELEMENT_INPLACE(def->rngs, def->nrngs, rng); - else - return VIR_APPEND_ELEMENT(def->rngs, def->nrngs, rng); -} - - ssize_t virDomainRNGFind(virDomainDefPtr def, virDomainRNGDefPtr rng) diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index b9e696dd7a..3ad3604041 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2909,9 +2909,6 @@ virDomainChrDefPtr virDomainChrRemove(virDomainDefPtr vmdef, virDomainChrDefPtr chr); -int virDomainRNGInsert(virDomainDefPtr def, - virDomainRNGDefPtr rng, - bool inplace); ssize_t virDomainRNGFind(virDomainDefPtr def, virDomainRNGDefPtr rng); virDomainRNGDefPtr virDomainRNGRemove(virDomainDefPtr def, size_t idx); diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 8408081290..9514201f69 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -424,7 +424,6 @@ virDomainRedirdevBusTypeToString; virDomainRNGBackendTypeToString; virDomainRNGDefFree; virDomainRNGFind; -virDomainRNGInsert; virDomainRNGModelTypeToString; virDomainRNGRemove; virDomainRunningReasonTypeFromString; diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 37d970ec45..00daf72a9a 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -7914,7 +7914,7 @@ qemuDomainAttachDeviceConfig(virQEMUCapsPtr qemuCaps, return -1; } - if (virDomainRNGInsert(vmdef, dev->data.rng, false) < 0) + if (VIR_APPEND_ELEMENT(vmdef->rngs, vmdef->nrngs, dev->data.rng) < 0) return -1; dev->data.rng = NULL; diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index e15f4b5130..282774cf05 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -1666,8 +1666,7 @@ qemuDomainAttachRNGDevice(virQEMUDriverPtr driver, goto cleanup; } - if (virDomainRNGInsert(vm->def, rng, true) < 0) - goto audit; + ignore_value(VIR_APPEND_ELEMENT_INPLACE(vm->def->rngs, vm->def->nrngs, rng)); ret = 0; -- GitLab