[libvirt] [PATCH] bhyve: Fix the build

After 1036ddadb276e we use bhyveDriverGetCapabilities from other sources too, not only from bhyve_driver.c. However, the function was static so not properly expose to other files. In order to expose it, we need to move couple of #include-s too. Then, there has been a copy paste error in virBhyveProcessReconnect: s/privconn/data->driver/. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> --- Pushed under build breaker rule. src/bhyve/bhyve_driver.c | 4 +--- src/bhyve/bhyve_driver.h | 5 +++++ src/bhyve/bhyve_process.c | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c index f486f86..9219890 100644 --- a/src/bhyve/bhyve_driver.c +++ b/src/bhyve/bhyve_driver.c @@ -30,7 +30,6 @@ #include "datatypes.h" #include "virbuffer.h" #include "viruuid.h" -#include "capabilities.h" #include "configmake.h" #include "viralloc.h" #include "network_conf.h" @@ -58,7 +57,6 @@ #include "bhyve_command.h" #include "bhyve_domain.h" #include "bhyve_process.h" -#include "bhyve_utils.h" #include "bhyve_capabilities.h" #define VIR_FROM_THIS VIR_FROM_BHYVE @@ -127,7 +125,7 @@ bhyveAutostartDomains(bhyveConnPtr driver) * * Returns: a reference to a virCapsPtr instance or NULL */ -static virCapsPtr ATTRIBUTE_NONNULL(1) +virCapsPtr ATTRIBUTE_NONNULL(1) bhyveDriverGetCapabilities(bhyveConnPtr driver) { diff --git a/src/bhyve/bhyve_driver.h b/src/bhyve/bhyve_driver.h index 221d5a0..a290c4a 100644 --- a/src/bhyve/bhyve_driver.h +++ b/src/bhyve/bhyve_driver.h @@ -23,10 +23,15 @@ #ifndef __BHYVE_DRIVER_H__ # define __BHYVE_DRIVER_H__ +#include "capabilities.h" +#include "bhyve_utils.h" + int bhyveRegister(void); unsigned bhyveDriverGetCaps(virConnectPtr conn); unsigned bhyveDriverGetGrubCaps(virConnectPtr conn); +virCapsPtr bhyveDriverGetCapabilities(bhyveConnPtr driver); + #endif /* __BHYVE_DRIVER_H__ */ diff --git a/src/bhyve/bhyve_process.c b/src/bhyve/bhyve_process.c index 9763d71..14588a9 100644 --- a/src/bhyve/bhyve_process.c +++ b/src/bhyve/bhyve_process.c @@ -32,6 +32,7 @@ #include <net/if_tap.h> #include "bhyve_device.h" +#include "bhyve_driver.h" #include "bhyve_command.h" #include "bhyve_monitor.h" #include "bhyve_process.h" @@ -375,7 +376,7 @@ virBhyveProcessReconnect(virDomainObjPtr vm, if (!vm->pid) return 0; - caps = bhyveDriverGetCapabilities(privconn); + caps = bhyveDriverGetCapabilities(data->driver); if (!caps) return -1; -- 2.4.10

Michal Privoznik wrote:
After 1036ddadb276e we use bhyveDriverGetCapabilities from other sources too, not only from bhyve_driver.c. However, the function was static so not properly expose to other files. In order to expose it, we need to move couple of #include-s too. Then, there has been a copy paste error in virBhyveProcessReconnect: s/privconn/data->driver/.
Funny, it seems we had a race again. :-) I noticed this failure this morning but started working on that only an hour ago and didn't pull before that, but when got almost the same patch ready, checked e-mail and saw yours. The only thing I done differently is that I placed bhyveDriverGetCapabilities prototype into bhyve_capabilities.h. But despite similar naming, now when I look at your patch, it seems bhyve_driver.h is a better logical place for it. Anyway, it builds fine, thanks for the prompt fix!
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> ---
Pushed under build breaker rule.
src/bhyve/bhyve_driver.c | 4 +--- src/bhyve/bhyve_driver.h | 5 +++++ src/bhyve/bhyve_process.c | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-)
Roman Bogorodskiy
participants (2)
-
Michal Privoznik
-
Roman Bogorodskiy