Re: [libvirt] [PATCH 5/5] util: default to read-only in virPCIDeviceConfigOpen

2019-08-15 Thread Peter Krempa
On Thu, Aug 15, 2019 at 10:10:06 +0200, Erik Skultety wrote:
> On Tue, Aug 13, 2019 at 03:45:19PM +0200, Ján Tomko wrote:
> > All the callers left require virPCIDeviceConfigOpen to be fatal
> > and only use read-only access to the config file.
> >
> > Signed-off-by: Ján Tomko 
> > ---
> 
> FYI this patch broke make check, both virpcitest and virhostdevtest.

Actually it's the previous patch according to my bisection and it
happens only with gcc. Clang works fine. This hints to some inlining
weridness happening together with the pci mocking code.


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

Re: [libvirt] [PATCH 5/5] util: default to read-only in virPCIDeviceConfigOpen

2019-08-15 Thread Erik Skultety
On Tue, Aug 13, 2019 at 03:45:19PM +0200, Ján Tomko wrote:
> All the callers left require virPCIDeviceConfigOpen to be fatal
> and only use read-only access to the config file.
>
> Signed-off-by: Ján Tomko 
> ---

FYI this patch broke make check, both virpcitest and virhostdevtest.

Erik

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

[libvirt] [PATCH 5/5] util: default to read-only in virPCIDeviceConfigOpen

2019-08-13 Thread Ján Tomko
All the callers left require virPCIDeviceConfigOpen to be fatal
and only use read-only access to the config file.

Signed-off-by: Ján Tomko 
---
 src/util/virpci.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/util/virpci.c b/src/util/virpci.c
index 2758ee6f49..7ca755c1a8 100644
--- a/src/util/virpci.c
+++ b/src/util/virpci.c
@@ -315,9 +315,9 @@ virPCIDeviceConfigOpenInternal(virPCIDevicePtr dev, bool 
readonly, bool fatal)
 }
 
 static int
-virPCIDeviceConfigOpen(virPCIDevicePtr dev, bool fatal)
+virPCIDeviceConfigOpen(virPCIDevicePtr dev)
 {
-return virPCIDeviceConfigOpenInternal(dev, false, fatal);
+return virPCIDeviceConfigOpenInternal(dev, true, true);
 }
 
 static int
@@ -2426,7 +2426,7 @@ virPCIDeviceDownstreamLacksACS(virPCIDevicePtr dev)
 int ret = 0;
 uint16_t device_class;
 
-if ((fd = virPCIDeviceConfigOpen(dev, true)) < 0)
+if ((fd = virPCIDeviceConfigOpen(dev)) < 0)
 return -1;
 
 if (virPCIDeviceInit(dev, fd) < 0) {
@@ -3168,7 +3168,7 @@ virPCIDeviceIsPCIExpress(virPCIDevicePtr dev)
 int fd;
 int ret = -1;
 
-if ((fd = virPCIDeviceConfigOpen(dev, true)) < 0)
+if ((fd = virPCIDeviceConfigOpen(dev)) < 0)
 return ret;
 
 if (virPCIDeviceInit(dev, fd) < 0)
@@ -3188,7 +3188,7 @@ virPCIDeviceHasPCIExpressLink(virPCIDevicePtr dev)
 int ret = -1;
 uint16_t cap, type;
 
-if ((fd = virPCIDeviceConfigOpen(dev, true)) < 0)
+if ((fd = virPCIDeviceConfigOpen(dev)) < 0)
 return ret;
 
 if (virPCIDeviceInit(dev, fd) < 0)
@@ -3216,7 +3216,7 @@ virPCIDeviceGetLinkCapSta(virPCIDevicePtr dev,
 int fd;
 int ret = -1;
 
-if ((fd = virPCIDeviceConfigOpen(dev, true)) < 0)
+if ((fd = virPCIDeviceConfigOpen(dev)) < 0)
 return ret;
 
 if (virPCIDeviceInit(dev, fd) < 0)
@@ -3254,7 +3254,7 @@ int virPCIGetHeaderType(virPCIDevicePtr dev, int *hdrType)
 
 *hdrType = -1;
 
-if ((fd = virPCIDeviceConfigOpen(dev, true)) < 0)
+if ((fd = virPCIDeviceConfigOpen(dev)) < 0)
 return -1;
 
 type = virPCIDeviceRead8(dev, fd, PCI_HEADER_TYPE);
-- 
2.20.1

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