[libvirt] [PATCH] bhyve: Fix build

2018-02-19 Thread Andrea Bolognani
Commit 2d43f0a2dcfd dropped virDomainDiskTranslateSourcePool()'s
first argument but failed to update callers in the bhyve driver.

Signed-off-by: Andrea Bolognani 
---
Pushed under the build breaker rule.

 src/bhyve/bhyve_command.c | 21 ++---
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/src/bhyve/bhyve_command.c b/src/bhyve/bhyve_command.c
index c1241b811..fd738b42c 100644
--- a/src/bhyve/bhyve_command.c
+++ b/src/bhyve/bhyve_command.c
@@ -198,7 +198,7 @@ bhyveBuildAHCIControllerArgStr(const virDomainDef *def,
 goto error;
 }
 
-if (virDomainDiskTranslateSourcePool(conn, disk) < 0)
+if (virDomainDiskTranslateSourcePool(disk) < 0)
 goto error;
 
 disk_source = virDomainDiskGetSource(disk);
@@ -289,12 +289,11 @@ bhyveBuildUSBControllerArgStr(const virDomainDef *def,
 static int
 bhyveBuildVirtIODiskArgStr(const virDomainDef *def ATTRIBUTE_UNUSED,
  virDomainDiskDefPtr disk,
- virConnectPtr conn,
  virCommandPtr cmd)
 {
 const char *disk_source;
 
-if (virDomainDiskTranslateSourcePool(conn, disk) < 0)
+if (virDomainDiskTranslateSourcePool(disk) < 0)
 return -1;
 
 if (disk->device != VIR_DOMAIN_DISK_DEVICE_DISK) {
@@ -562,7 +561,7 @@ virBhyveProcessBuildBhyveCmd(virConnectPtr conn,
 /* Handled by bhyveBuildAHCIControllerArgStr() */
 break;
 case VIR_DOMAIN_DISK_BUS_VIRTIO:
-if (bhyveBuildVirtIODiskArgStr(def, disk, conn, cmd) < 0)
+if (bhyveBuildVirtIODiskArgStr(def, disk, cmd) < 0)
 goto error;
 break;
 default:
@@ -672,10 +671,10 @@ virBhyveProcessBuildCustomLoaderCmd(virDomainDefPtr def)
 }
 
 static bool
-virBhyveUsableDisk(virConnectPtr conn, virDomainDiskDefPtr disk)
+virBhyveUsableDisk(virDomainDiskDefPtr disk)
 {
 
-if (virDomainDiskTranslateSourcePool(conn, disk) < 0)
+if (virDomainDiskTranslateSourcePool(disk) < 0)
 return false;
 
 if ((disk->device != VIR_DOMAIN_DISK_DEVICE_DISK) &&
@@ -729,7 +728,7 @@ virBhyveProcessBuildGrubbhyveCmd(virDomainDefPtr def,
  * across. */
 cd = hdd = userdef = NULL;
 for (i = 0; i < def->ndisks; i++) {
-if (!virBhyveUsableDisk(conn, def->disks[i]))
+if (!virBhyveUsableDisk(def->disks[i]))
 continue;
 
 diskdef = def->disks[i];
@@ -815,7 +814,7 @@ virBhyveProcessBuildGrubbhyveCmd(virDomainDefPtr def,
 }
 
 static virDomainDiskDefPtr
-virBhyveGetBootDisk(virConnectPtr conn, virDomainDefPtr def)
+virBhyveGetBootDisk(virDomainDefPtr def)
 {
 size_t i;
 virDomainDiskDefPtr match = NULL;
@@ -851,7 +850,7 @@ virBhyveGetBootDisk(virConnectPtr conn, virDomainDefPtr def)
 /* If boot_dev is set, we return the first device of
  * the request type */
 for (i = 0; i < def->ndisks; i++) {
-if (!virBhyveUsableDisk(conn, def->disks[i]))
+if (!virBhyveUsableDisk(def->disks[i]))
 continue;
 
 if (def->disks[i]->device == boot_dev) {
@@ -875,7 +874,7 @@ virBhyveGetBootDisk(virConnectPtr conn, virDomainDefPtr def)
 int first_usable_disk_index = -1;
 
 for (i = 0; i < def->ndisks; i++) {
-if (!virBhyveUsableDisk(conn, def->disks[i]))
+if (!virBhyveUsableDisk(def->disks[i]))
 continue;
 else
 first_usable_disk_index = i;
@@ -907,7 +906,7 @@ virBhyveProcessBuildLoadCmd(virConnectPtr conn, 
virDomainDefPtr def,
 virDomainDiskDefPtr disk = NULL;
 
 if (def->os.bootloader == NULL) {
-disk = virBhyveGetBootDisk(conn, def);
+disk = virBhyveGetBootDisk(def);
 
 if (disk == NULL)
 return NULL;
-- 
2.14.3

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH] bhyve: Fix build

2017-10-19 Thread Jiri Denemark
Commit v3.8.0-95-gfd885a06a dropped nmodels parameter from several APIs
in src/cpu/cpu.h, but failed to update all callers.

Signed-off-by: Jiri Denemark 
---

Pushed under the build-breaker rule.

 src/bhyve/bhyve_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c
index c096b5562..5c432b25e 100644
--- a/src/bhyve/bhyve_driver.c
+++ b/src/bhyve/bhyve_driver.c
@@ -1433,7 +1433,7 @@ bhyveConnectBaselineCPU(virConnectPtr conn,
 if (!(cpus = virCPUDefListParse(xmlCPUs, ncpus, VIR_CPU_TYPE_HOST)))
 goto cleanup;
 
-if (!(cpu = cpuBaseline(cpus, ncpus, NULL, 0,
+if (!(cpu = cpuBaseline(cpus, ncpus, NULL,
 !!(flags & VIR_CONNECT_BASELINE_CPU_MIGRATABLE
 goto cleanup;
 
-- 
2.14.2

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH] bhyve: fix build

2016-02-04 Thread Roman Bogorodskiy
Fix build fail introduced as a side effect of commit d239a54.

Pushed under the build breaker rule.
---
 src/bhyve/bhyve_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c
index 337a29e..f486f86 100644
--- a/src/bhyve/bhyve_driver.c
+++ b/src/bhyve/bhyve_driver.c
@@ -488,7 +488,7 @@ bhyveDomainGetOSType(virDomainPtr dom)
 static char *
 bhyveDomainGetXMLDesc(virDomainPtr domain, unsigned int flags)
 {
-bhyveConnPtr privconn = conn->privateData;
+bhyveConnPtr privconn = domain->conn->privateData;
 virDomainObjPtr vm;
 virCapsPtr caps = NULL;
 char *ret = NULL;
-- 
2.4.6

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] bhyve: fix build with gcc48

2015-05-24 Thread Roman Bogorodskiy
  Eric Blake wrote:

 On 05/23/2015 02:45 PM, Martin Kletzander wrote:
  On Sat, May 23, 2015 at 08:05:23PM +0300, Roman Bogorodskiy wrote:
  Build with gcc 4.8 fails with:
 
 Arguably a bug in gcc; but since we can work around it without too much
 pain, we should.
 
 
  bhyve/bhyve_monitor.c: In function 'bhyveMonitorIO':
 
  bhyveMonitorIO(int watch, int kq, int events ATTRIBUTE_UNUSED, void
  *opaque)
  {
  -const struct timespec zerowait = {};
  +const struct timespec zerowait = { 0, 0 };
 
 Would also be sufficient to do 'zerowait = { 0 };' - any C compiler that
 warns about an initializer of { 0 } is broken, because that is THE
 idiomatic way to zero-initialize anything (scalar or structure)
 according to C99.
 
  
  You need to set at least minimum one field, all others will be set
  to 0.  But this is of course very right thing to do.
  
  ACK, structures shouldn't be initialized this way.
 
 Go ahead and push as you have it, though, with two members, since we
 know struct timespec has (at least) two members.

Pushed, thanks!

Roman Bogorodskiy


pgpPA5xOzLb6o.pgp
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH] bhyve: fix build with gcc48

2015-05-23 Thread Eric Blake
On 05/23/2015 02:45 PM, Martin Kletzander wrote:
 On Sat, May 23, 2015 at 08:05:23PM +0300, Roman Bogorodskiy wrote:
 Build with gcc 4.8 fails with:

Arguably a bug in gcc; but since we can work around it without too much
pain, we should.


 bhyve/bhyve_monitor.c: In function 'bhyveMonitorIO':

 bhyveMonitorIO(int watch, int kq, int events ATTRIBUTE_UNUSED, void
 *opaque)
 {
 -const struct timespec zerowait = {};
 +const struct timespec zerowait = { 0, 0 };

Would also be sufficient to do 'zerowait = { 0 };' - any C compiler that
warns about an initializer of { 0 } is broken, because that is THE
idiomatic way to zero-initialize anything (scalar or structure)
according to C99.

 
 You need to set at least minimum one field, all others will be set
 to 0.  But this is of course very right thing to do.
 
 ACK, structures shouldn't be initialized this way.

Go ahead and push as you have it, though, with two members, since we
know struct timespec has (at least) two members.

-- 
Eric Blake   eblake redhat com+1-919-301-3266
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH] bhyve: fix build with gcc48

2015-05-23 Thread Martin Kletzander

On Sat, May 23, 2015 at 08:05:23PM +0300, Roman Bogorodskiy wrote:

Build with gcc 4.8 fails with:

bhyve/bhyve_monitor.c: In function 'bhyveMonitorIO':
bhyve/bhyve_monitor.c:51:18: error: missing initializer for field 'tv_sec' of 
'const struct timespec' [-Werror=missing-field-initializers]
const struct timespec zerowait = {};

Explicitly initialize zerowait to fix the build.
---
src/bhyve/bhyve_monitor.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/bhyve/bhyve_monitor.c b/src/bhyve/bhyve_monitor.c
index 7f19c6e..1316720 100644
--- a/src/bhyve/bhyve_monitor.c
+++ b/src/bhyve/bhyve_monitor.c
@@ -48,7 +48,7 @@ struct _bhyveMonitor {
static void
bhyveMonitorIO(int watch, int kq, int events ATTRIBUTE_UNUSED, void *opaque)
{
-const struct timespec zerowait = {};
+const struct timespec zerowait = { 0, 0 };


You need to set at least minimum one field, all others will be set
to 0.  But this is of course very right thing to do.

ACK, structures shouldn't be initialized this way.


bhyveMonitorPtr mon = opaque;
struct kevent kev;
int rc, status;
--
2.3.7

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


signature.asc
Description: PGP signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH] bhyve: fix build with gcc48

2015-05-23 Thread Roman Bogorodskiy
Build with gcc 4.8 fails with:

bhyve/bhyve_monitor.c: In function 'bhyveMonitorIO':
bhyve/bhyve_monitor.c:51:18: error: missing initializer for field 'tv_sec' of 
'const struct timespec' [-Werror=missing-field-initializers]
 const struct timespec zerowait = {};

Explicitly initialize zerowait to fix the build.
---
 src/bhyve/bhyve_monitor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/bhyve/bhyve_monitor.c b/src/bhyve/bhyve_monitor.c
index 7f19c6e..1316720 100644
--- a/src/bhyve/bhyve_monitor.c
+++ b/src/bhyve/bhyve_monitor.c
@@ -48,7 +48,7 @@ struct _bhyveMonitor {
 static void
 bhyveMonitorIO(int watch, int kq, int events ATTRIBUTE_UNUSED, void *opaque)
 {
-const struct timespec zerowait = {};
+const struct timespec zerowait = { 0, 0 };
 bhyveMonitorPtr mon = opaque;
 struct kevent kev;
 int rc, status;
-- 
2.3.7

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH] bhyve: fix build in tests

2015-04-24 Thread Roman Bogorodskiy
Commit ca32929 caused build errors in bhyvexml2argvtest.c because of
some undefined variables.

Pushing under the build breaker rule.
---
 tests/bhyvexml2argvtest.c | 4 
 1 file changed, 4 deletions(-)

diff --git a/tests/bhyvexml2argvtest.c b/tests/bhyvexml2argvtest.c
index 1cce2aa..1c7bc31 100644
--- a/tests/bhyvexml2argvtest.c
+++ b/tests/bhyvexml2argvtest.c
@@ -19,7 +19,6 @@ static int testCompareXMLToArgvFiles(const char *xml,
  const char *ldcmdline,
  const char *dmcmdline)
 {
-int len;
 char *actualargv = NULL, *actualld = NULL, *actualdm = NULL;
 virDomainDefPtr vmdef = NULL;
 virDomainObj vm;
@@ -59,9 +58,6 @@ static int testCompareXMLToArgvFiles(const char *xml,
 if (virtTestCompareToFile(actualld, ldcmdline)  0)
 goto out;
 
-if (virtTestCompareToFile(formatted, xml)  0)
-goto out;
-
 if (virFileExists(dmcmdline) || actualdm) {
 if (virtTestCompareToFile(actualdm, dmcmdline)  0)
 goto out;
-- 
2.3.5

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH] bhyve: fix build in tests

2015-04-23 Thread Roman Bogorodskiy
Commit 835cf84 dropped expectedVirtTypes argument for
virDomainDefParse*() functions, however bhyve tests still try to pass
that to virDomainDefParseFile(), therefore build fails.

Fix build by fixing virDomainDefParseFile() usage.
---
 tests/bhyvexml2argvtest.c | 1 -
 tests/bhyvexml2xmltest.c  | 1 -
 2 files changed, 2 deletions(-)

diff --git a/tests/bhyvexml2argvtest.c b/tests/bhyvexml2argvtest.c
index c5b0681..26d0075 100644
--- a/tests/bhyvexml2argvtest.c
+++ b/tests/bhyvexml2argvtest.c
@@ -32,7 +32,6 @@ static int testCompareXMLToArgvFiles(const char *xml,
 goto out;
 
 if (!(vmdef = virDomainDefParseFile(xml, driver.caps, driver.xmlopt,
-1  VIR_DOMAIN_VIRT_BHYVE,
 VIR_DOMAIN_DEF_PARSE_INACTIVE)))
 goto out;
 
diff --git a/tests/bhyvexml2xmltest.c b/tests/bhyvexml2xmltest.c
index a1a3701..2e742cf 100644
--- a/tests/bhyvexml2xmltest.c
+++ b/tests/bhyvexml2xmltest.c
@@ -27,7 +27,6 @@ testCompareXMLToXMLFiles(const char *inxml, const char 
*outxml)
 goto fail;
 
 if (!(def = virDomainDefParseString(inXmlData, driver.caps, driver.xmlopt,
-1  VIR_DOMAIN_VIRT_BHYVE,
 VIR_DOMAIN_DEF_PARSE_INACTIVE)))
 goto fail;
 
-- 
2.3.5

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [PATCH] bhyve: fix build in tests

2015-04-23 Thread Peter Krempa
On Thu, Apr 23, 2015 at 10:55:12 +0400, Roman Bogorodskiy wrote:
 Commit 835cf84 dropped expectedVirtTypes argument for
 virDomainDefParse*() functions, however bhyve tests still try to pass
 that to virDomainDefParseFile(), therefore build fails.
 
 Fix build by fixing virDomainDefParseFile() usage.
 ---
  tests/bhyvexml2argvtest.c | 1 -
  tests/bhyvexml2xmltest.c  | 1 -
  2 files changed, 2 deletions(-)
 
 diff --git a/tests/bhyvexml2argvtest.c b/tests/bhyvexml2argvtest.c
 index c5b0681..26d0075 100644
 --- a/tests/bhyvexml2argvtest.c
 +++ b/tests/bhyvexml2argvtest.c
 @@ -32,7 +32,6 @@ static int testCompareXMLToArgvFiles(const char *xml,
  goto out;
  
  if (!(vmdef = virDomainDefParseFile(xml, driver.caps, driver.xmlopt,
 -1  VIR_DOMAIN_VIRT_BHYVE,
  VIR_DOMAIN_DEF_PARSE_INACTIVE)))
  goto out;
  
 diff --git a/tests/bhyvexml2xmltest.c b/tests/bhyvexml2xmltest.c
 index a1a3701..2e742cf 100644
 --- a/tests/bhyvexml2xmltest.c
 +++ b/tests/bhyvexml2xmltest.c
 @@ -27,7 +27,6 @@ testCompareXMLToXMLFiles(const char *inxml, const char 
 *outxml)
  goto fail;
  
  if (!(def = virDomainDefParseString(inXmlData, driver.caps, 
 driver.xmlopt,
 -1  VIR_DOMAIN_VIRT_BHYVE,
  VIR_DOMAIN_DEF_PARSE_INACTIVE)))
  goto fail;

ACK, this qualifies to be pushed without review under the build breaker
rule.

Peter


signature.asc
Description: Digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [PATCH] bhyve: fix build in tests

2015-04-23 Thread Roman Bogorodskiy
  Peter Krempa wrote:

 On Thu, Apr 23, 2015 at 10:55:12 +0400, Roman Bogorodskiy wrote:
  Commit 835cf84 dropped expectedVirtTypes argument for
  virDomainDefParse*() functions, however bhyve tests still try to pass
  that to virDomainDefParseFile(), therefore build fails.
  
  Fix build by fixing virDomainDefParseFile() usage.
  ---
   tests/bhyvexml2argvtest.c | 1 -
   tests/bhyvexml2xmltest.c  | 1 -
   2 files changed, 2 deletions(-)
 
 
 ACK, this qualifies to be pushed without review under the build breaker
 rule.

Pushed, thanks!

Roman Bogorodskiy

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [PATCH] bhyve: fix build by fixing typo in variable name

2014-06-27 Thread Roman Bogorodskiy
Commit 80d0918b introduced a typo in variable name:

s/failIncomaptible/failIncompatible/

Pushed under the build breaker rule.
---
 src/bhyve/bhyve_driver.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c
index d784ed1..eb5fc95 100644
--- a/src/bhyve/bhyve_driver.c
+++ b/src/bhyve/bhyve_driver.c
@@ -1326,14 +1326,14 @@ bhyveConnectCompareCPU(virConnectPtr conn,
 if (virConnectCompareCPUEnsureACL(conn)  0)
 goto cleanup;
 
-failIncomaptible = !!(flags  VIR_CONNECT_COMPARE_CPU_FAIL_INCOMPATIBLE);
+failIncompatible = !!(flags  VIR_CONNECT_COMPARE_CPU_FAIL_INCOMPATIBLE);
 
 if (!(caps = bhyveDriverGetCapabilities(driver)))
 goto cleanup;
 
 if (!caps-host.cpu ||
 !caps-host.cpu-model) {
-if (failIncomaptible) {
+if (failIncompatible) {
 virReportError(VIR_ERR_CPU_INCOMPATIBLE, %s,
_(cannot get host CPU capabilities));
 } else {
@@ -1341,7 +1341,7 @@ bhyveConnectCompareCPU(virConnectPtr conn,
 ret = VIR_CPU_COMPARE_INCOMPATIBLE;
 }
 } else {
-ret = cpuCompareXML(caps-host.cpu, xmlDesc, failIncomaptible);
+ret = cpuCompareXML(caps-host.cpu, xmlDesc, failIncompatible);
 }
 
  cleanup:
-- 
1.9.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list