qemu side functions, call virDomainRNGInsert and virDomainRNGRemove to help us. Signed-off-by: Luyao Huang <lhuang@xxxxxxxxxx> --- src/qemu/qemu_hotplug.c | 23 +++++++++++++++++++++++ src/qemu/qemu_hotplug.h | 7 +++++++ 2 files changed, 30 insertions(+) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 7f93b9b..f9327b4 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -1501,6 +1501,29 @@ int qemuDomainAttachChrDevice(virQEMUDriverPtr driver, return ret; } +int +qemuDomainRNGInsert(virDomainDefPtr vmdef, + virDomainRNGDefPtr rng) +{ + return virDomainRNGInsert(vmdef, rng); +} + +virDomainRNGDefPtr +qemuDomainRNGRemove(virDomainDefPtr vmdef, + virDomainRNGDefPtr rng) +{ + virDomainRNGDefPtr ret; + + if (!(ret = virDomainRNGRemove(vmdef, rng))) { + virReportError(VIR_ERR_INVALID_ARG, "%s", + _("device not present in domain configuration")); + return NULL; + } + + return ret; +} + + static int qemuDomainAttachHostUSBDevice(virQEMUDriverPtr driver, virDomainObjPtr vm, diff --git a/src/qemu/qemu_hotplug.h b/src/qemu/qemu_hotplug.h index d13c532..7b838ee 100644 --- a/src/qemu/qemu_hotplug.h +++ b/src/qemu/qemu_hotplug.h @@ -107,6 +107,13 @@ virDomainChrDefPtr qemuDomainChrRemove(virDomainDefPtr vmdef, virDomainChrDefPtr chr); +int +qemuDomainRNGInsert(virDomainDefPtr vmdef, + virDomainRNGDefPtr rng); +virDomainRNGDefPtr +qemuDomainRNGRemove(virDomainDefPtr vmdef, + virDomainRNGDefPtr rng); + void qemuDomainRemoveDevice(virQEMUDriverPtr driver, virDomainObjPtr vm, virDomainDeviceDefPtr dev); -- 1.8.3.1 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list