[libvirt] [PATCH] Fix build on mingw32
My commit 897808e added a parameter to virCgroupGetPercpuStats, but didn't change the stub for systems where cgroups are not supported. --- Pushed as a build-breaker fix. src/util/vircgroup.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c index 74e0907..c7ebf8d 100644 --- a/src/util/vircgroup.c +++ b/src/util/vircgroup.c @@ -4469,7 +4469,8 @@ virCgroupGetPercpuStats(virCgroupPtr group ATTRIBUTE_UNUSED, virTypedParameterPtr params ATTRIBUTE_UNUSED, unsigned int nparams ATTRIBUTE_UNUSED, int start_cpu ATTRIBUTE_UNUSED, -unsigned int ncpus ATTRIBUTE_UNUSED) +unsigned int ncpus ATTRIBUTE_UNUSED, +unsigned int nvcpupids ATTRIBUTE_UNUSED) { virReportSystemError(ENOSYS, %s, _(Control groups not supported on this platform)); -- 1.8.3.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH] Fix build on mingw32
tests/viriscsitest.c:27:12: error: 'EXIT_AM_SKIP' undeclared (first use in this function) --- Pushed as a build breaker fix. tests/viriscsitest.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/viriscsitest.c b/tests/viriscsitest.c index 65de954..ebe830a 100644 --- a/tests/viriscsitest.c +++ b/tests/viriscsitest.c @@ -20,6 +20,8 @@ #include config.h +#include testutils.h + #ifdef WIN32 int main(void) @@ -29,7 +31,6 @@ main(void) #else # define __VIR_COMMAND_PRIV_H_ALLOW__ -# include testutils.h # include vircommandpriv.h # include viriscsi.h -- 1.8.3.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH] Fix build on Mingw32 wrt export of virNetServerGetDBusConn
From: Daniel P. Berrange berra...@redhat.com Mingw32 complains if you request export of a symbol which does not in fact exist. * src/libvirt_bridge.syms, src/libvirt_macvtap.syms: Delete obsolete files * src/libvirt_private.syms: Remove virNetServerGetDBusConn * src/libvirt_dbus.syms: Add virNetServerGetDBusConn --- src/Makefile.am |8 ++-- src/libvirt_bridge.syms | 23 --- src/libvirt_dbus.syms|2 ++ src/libvirt_macvtap.syms | 10 -- src/libvirt_private.syms |1 - 5 files changed, 4 insertions(+), 40 deletions(-) delete mode 100644 src/libvirt_bridge.syms create mode 100644 src/libvirt_dbus.syms delete mode 100644 src/libvirt_macvtap.syms diff --git a/src/Makefile.am b/src/Makefile.am index f82be78..2ee42a1 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1175,16 +1175,12 @@ if WITH_DRIVER_MODULES USED_SYM_FILES += libvirt_driver_modules.syms endif -if WITH_BRIDGE -USED_SYM_FILES += libvirt_bridge.syms -endif - if WITH_LINUX USED_SYM_FILES += libvirt_linux.syms endif -if WITH_MACVTAP -USED_SYM_FILES += libvirt_macvtap.syms +if HAVE_DBUS +USED_SYM_FILES += libvirt_dbus.syms endif if WITH_LIBVIRTD diff --git a/src/libvirt_bridge.syms b/src/libvirt_bridge.syms deleted file mode 100644 index 626f6ee..000 --- a/src/libvirt_bridge.syms +++ /dev/null @@ -1,23 +0,0 @@ -# -# These symbols are dependent upon --with-qemu or --with-lxc via -# WITH_BRIDGE. -# - - -# bridge.h -brAddBridge; -brAddInetAddress; -brAddInterface; -brAddTap; -brCreateTap; -brDelInetAddress; -brDeleteBridge; -brDeleteTap; -brHasBridge; -brInit; -brSetEnableSTP; -brSetForwardDelay; -brSetInetNetmask; -brSetInterfaceMac; -brSetInterfaceUp; -brShutdown; diff --git a/src/libvirt_dbus.syms b/src/libvirt_dbus.syms new file mode 100644 index 000..a460ec5 --- /dev/null +++ b/src/libvirt_dbus.syms @@ -0,0 +1,2 @@ +# virnetserver.h +virNetServerGetDBusConn; diff --git a/src/libvirt_macvtap.syms b/src/libvirt_macvtap.syms deleted file mode 100644 index b48565b..000 --- a/src/libvirt_macvtap.syms +++ /dev/null @@ -1,10 +0,0 @@ -# -# These symbols are dependent on WITH_MACVTAP. -# - - -# macvtap.h -delMacvtap; -openMacvtapTap; -vpAssociatePortProfileId; -vpDisassociatePortProfileId; diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 7906f5d..f4e25c1 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -1252,7 +1252,6 @@ virNetServerAddSignalHandler; virNetServerAutoShutdown; virNetServerClose; virNetServerFree; -virNetServerGetDBusConn; virNetServerIsPrivileged; virNetServerNew; virNetServerQuit; -- 1.7.6.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] Fix build on Mingw32 wrt export of virNetServerGetDBusConn
On 11/21/2011 04:47 AM, Daniel P. Berrange wrote: From: Daniel P. Berrange berra...@redhat.com Mingw32 complains if you request export of a symbol which does not in fact exist. * src/libvirt_bridge.syms, src/libvirt_macvtap.syms: Delete obsolete files * src/libvirt_private.syms: Remove virNetServerGetDBusConn * src/libvirt_dbus.syms: Add virNetServerGetDBusConn ACK. -- Eric Blake ebl...@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
[libvirt] PATCH: Fix build on Mingw32
pread() and pwrite() do not exist on mingw, and the nodedevxml2xmltest was adding libvirt_driver_qemu.la for some unknown reason - probably a cut paste error. This broke the test compile when qemu was turned off as it is on mingw32. Daniel diff --git a/src/pci.c b/src/pci.c --- a/src/pci.c +++ b/src/pci.c @@ -156,7 +156,8 @@ pciRead(pciDevice *dev, unsigned pos, ui if (pciOpenConfig(dev) 0) return -1; -if (pread(dev-fd, buf, buflen, pos) 0) { +if (lseek(dev-fd, pos, SEEK_SET) != pos || +read(dev-fd, buf, buflen) 0) { char ebuf[1024]; VIR_WARN(_(Failed to read from '%s' : %s), dev-path, virStrerror(errno, ebuf, sizeof(ebuf))); @@ -195,7 +196,8 @@ pciWrite(pciDevice *dev, unsigned pos, u if (pciOpenConfig(dev) 0) return -1; -if (pwrite(dev-fd, buf, buflen, pos) 0) { +if (lseek(dev-fd, pos, SEEK_SET) != pos || +write(dev-fd, buf, buflen) 0) { char ebuf[1024]; VIR_WARN(_(Failed to write to '%s' : %s), dev-path, virStrerror(errno, ebuf, sizeof(ebuf))); diff --git a/tests/Makefile.am b/tests/Makefile.am --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -185,7 +185,7 @@ endif nodedevxml2xmltest_SOURCES = \ nodedevxml2xmltest.c \ testutils.c testutils.h -nodedevxml2xmltest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS) +nodedevxml2xmltest_LDADD = $(LDADDS) virshtest_SOURCES = \ virshtest.c \ -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :| -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] PATCH: Fix build on Mingw32
Daniel P. Berrange wrote: pread() and pwrite() do not exist on mingw, and the nodedevxml2xmltest was adding libvirt_driver_qemu.la for some unknown reason - probably a cut paste error. This broke the test compile when qemu was turned off as it is on mingw32. Might it be better to use gnulib's pread module? Maybe overkill for this one case, but it could save us the hassle in the future. -- Chris Lalancette -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] PATCH: Fix build on Mingw32
Daniel P. Berrange wrote: pread() and pwrite() do not exist on mingw, and the nodedevxml2xmltest was adding libvirt_driver_qemu.la for some unknown reason - probably a cut paste error. This broke the test compile when qemu was turned off as it is on mingw32. Although the new code doesn't have exactly the same semantics as pread/pwrite (new code doesn't restore each file pointer to its original position), it looks like no caller relied on the file pointers remaining unchanged. On a related note, don't these need EAGAIN handling? Maybe EINTR, too. diff --git a/src/pci.c b/src/pci.c --- a/src/pci.c +++ b/src/pci.c @@ -156,7 +156,8 @@ pciRead(pciDevice *dev, unsigned pos, ui if (pciOpenConfig(dev) 0) return -1; -if (pread(dev-fd, buf, buflen, pos) 0) { +if (lseek(dev-fd, pos, SEEK_SET) != pos || +read(dev-fd, buf, buflen) 0) { char ebuf[1024]; VIR_WARN(_(Failed to read from '%s' : %s), dev-path, virStrerror(errno, ebuf, sizeof(ebuf))); @@ -195,7 +196,8 @@ pciWrite(pciDevice *dev, unsigned pos, u if (pciOpenConfig(dev) 0) return -1; -if (pwrite(dev-fd, buf, buflen, pos) 0) { +if (lseek(dev-fd, pos, SEEK_SET) != pos || +write(dev-fd, buf, buflen) 0) { char ebuf[1024]; VIR_WARN(_(Failed to write to '%s' : %s), dev-path, virStrerror(errno, ebuf, sizeof(ebuf))); diff --git a/tests/Makefile.am b/tests/Makefile.am --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -185,7 +185,7 @@ endif nodedevxml2xmltest_SOURCES = \ nodedevxml2xmltest.c \ testutils.c testutils.h -nodedevxml2xmltest_LDADD = ../src/libvirt_driver_qemu.la $(LDADDS) +nodedevxml2xmltest_LDADD = $(LDADDS) virshtest_SOURCES = \ virshtest.c \ -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] PATCH: Fix build on Mingw32
On Tue, Mar 03, 2009 at 11:18:45AM +0100, Jim Meyering wrote: Daniel P. Berrange wrote: pread() and pwrite() do not exist on mingw, and the nodedevxml2xmltest was adding libvirt_driver_qemu.la for some unknown reason - probably a cut paste error. This broke the test compile when qemu was turned off as it is on mingw32. Although the new code doesn't have exactly the same semantics as pread/pwrite (new code doesn't restore each file pointer to its original position), it looks like no caller relied on the file pointers remaining unchanged. Yes, all the I/O is random access via the pciRead() or pciWrite() functions so the file pointer position is irrelvant for this usage On a related note, don't these need EAGAIN handling? Maybe EINTR, too. I queried whether this should ue saferead/write when the patches were first reviewed, but Mark said it was not neccessary for use of sysfs and this code will be replaced by libpciaccess.so in the not too distant future Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :| -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] PATCH: Fix build on Mingw32
On Tue, Mar 03, 2009 at 11:38:58AM +, Daniel P. Berrange wrote: On Tue, Mar 03, 2009 at 11:18:45AM +0100, Jim Meyering wrote: Daniel P. Berrange wrote: pread() and pwrite() do not exist on mingw, and the nodedevxml2xmltest was adding libvirt_driver_qemu.la for some unknown reason - probably a cut paste error. This broke the test compile when qemu was turned off as it is on mingw32. Although the new code doesn't have exactly the same semantics as pread/pwrite (new code doesn't restore each file pointer to its original position), it looks like no caller relied on the file pointers remaining unchanged. Yes, all the I/O is random access via the pciRead() or pciWrite() functions so the file pointer position is irrelvant for this usage On a related note, don't these need EAGAIN handling? Maybe EINTR, too. I queried whether this should ue saferead/write when the patches were first reviewed, but Mark said it was not neccessary for use of sysfs and this code will be replaced by libpciaccess.so in the not too distant future Of course now I changed pread to read(), the make syntax-check complains, so I went all the way to saferead() and safewrite() here Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :| -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list