[libvirt] [PATCH v2 06/10] Make qemu attach/detach functions public

Martin Kletzander mkletzan at redhat.com
Mon Jul 25 09:39:37 UTC 2016


On Sat, Jul 16, 2016 at 02:42:51AM +0200, Tomasz Flendrich wrote:
>They will be used to test device attachment and detachment, so
>they have to be visible to the outside.
>
>---
> src/qemu/qemu_driver.c |  4 ++--
> src/qemu/qemu_driver.h | 14 ++++++++++++++
> 2 files changed, 16 insertions(+), 2 deletions(-)
>
>diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
>index 4a62e18..0671d24 100644
>--- a/src/qemu/qemu_driver.c
>+++ b/src/qemu/qemu_driver.c
>@@ -8065,7 +8065,7 @@ qemuDomainUpdateDeviceConfig(virDomainDefPtr vmdef,
>     return 0;
> }
>
>-static int
>+int
> qemuDomainAttachDeviceLiveAndConfig(virConnectPtr conn,
>                                     virDomainObjPtr vm,
>                                     virQEMUDriverPtr driver,
>@@ -8325,7 +8325,7 @@ static int qemuDomainUpdateDeviceFlags(virDomainPtr dom,
>     return ret;
> }
>
>-static int
>+int
> qemuDomainDetachDeviceLiveAndConfig(virQEMUDriverPtr driver,
>                                     virDomainObjPtr vm,
>                                     const char *xml,
>diff --git a/src/qemu/qemu_driver.h b/src/qemu/qemu_driver.h
>index df7533a..3284933 100644
>--- a/src/qemu/qemu_driver.h
>+++ b/src/qemu/qemu_driver.h
>@@ -24,6 +24,20 @@
> #ifndef __QEMU_DRIVER_H__
> # define __QEMU_DRIVER_H__
>
>+# include "domain_conf.h"
>+# include "qemu_conf.h"
>+
> int qemuRegister(void);
>
>+int qemuDomainAttachDeviceLiveAndConfig(virConnectPtr conn,
>+                                        virDomainObjPtr vm,
>+                                        virQEMUDriverPtr driver,
>+                                        const char *xml,
>+                                        unsigned int flags);
>+
>+int qemuDomainDetachDeviceLiveAndConfig(virQEMUDriverPtr driver,
>+                                        virDomainObjPtr vm,
>+                                        const char *xml,
>+                                        unsigned int flags);
>+
> #endif /* __QEMU_DRIVER_H__ */

This should not be exposed in qemu_driver.h, instead the functions
should be moved to qemu_domain.h if possible, but they now fit there.

If that's not possible, we need to do similar thing as we now have with
qemu_processpriv.h, so this could be called qemu_domainpriv.h I guess.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20160725/2c63afb2/attachment-0001.sig>


More information about the libvir-list mailing list