Skip to contentSkip to conversation

Fix compilation when UFFDIO_REGISTER is not set.

PATCH Applied Pierre Labatut 3 participants 3 messages Sep 28, 2023 – Oct 2, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix compilation when UFFDIO_REGISTER is not set.

---
 subprojects/libvhost-user/libvhost-user.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
subprojects/libvhost-user/libvhost-user.c +1 -1
index 0469a50101..d4a2eab883 100644
@@ -629,9 +629,9 @@ static bool
 generate_faults(VuDev *dev) {
     unsigned int i;
     for (i = 0; i < dev->nregions; i++) {
+#ifdef UFFDIO_REGISTER
         VuDevRegion *dev_region = &dev->regions[i];
         int ret;
-#ifdef UFFDIO_REGISTER
         struct uffdio_register reg_struct;
 
         /*
Signature · 1 line
2.42.0.515.g380fc7ccd1-goog
#1 lore raw
Quoted 4 lines · Pierre Labatut
---
  subprojects/libvhost-user/libvhost-user.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

I'm not sure how subprojects are handled here. Should we commit things to a subproject directly? This one does not seem to be wrapped at least, and has been in contrib/ before moving to subprojects/, so seems to be ok.

Quoted 5 lines
subprojects/libvhost-user/libvhost-user.c +0 -0
index 0469a50101..d4a2eab883 100644

subprojects/libvhost-user/libvhost-user.c static bool · line 637

Quoted 10 lines
subprojects/libvhost-user/libvhost-user.c +1 -1
@@ -629,9 +629,9 @@ static bool
  generate_faults(VuDev *dev) {
      unsigned int i;
      for (i = 0; i < dev->nregions; i++) {
+#ifdef UFFDIO_REGISTER
          VuDevRegion *dev_region = &dev->regions[i];
          int ret;
-#ifdef UFFDIO_REGISTER
          struct uffdio_register reg_struct;
 
          /*

Applied to my trivial-patches tree, thank you!

/mjt

#2 lore raw
Quoted 10 lines · Michael Tokarev
Quoted 4 lines · Pierre Labatut

---
  subprojects/libvhost-user/libvhost-user.c | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)

I'm not sure how subprojects are handled here.  Should we commit things to a subproject directly? This one does not seem to be wrapped at least, and has been in contrib/ before moving to subprojects/, so seems to be ok.

Yes, subprojects either are hosted directly in qemu.git (they're just a nested build system), or they replace a submodule and have a .wrap file (and then the patch won't apply). libvhost-user is of the former kind.

Paolo