diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c index 5c79c422e133ceabd527669e557268c4999c7d7e..aed50f54626365ecf546a9e3edaeb5434c67255d 100644 --- a/src/util/virnetdev.c +++ b/src/util/virnetdev.c @@ -2531,7 +2531,7 @@ virNetDevReplaceNetConfig(const char *linkdev, int vf, int ret = -1; char *pfdevname = NULL; - if (vf == -1 && virNetDevIsVirtualFunction(linkdev)) { + if (vf == -1 && virNetDevIsVirtualFunction(linkdev) == 1) { /* If this really *is* a VF and the caller just didn't know * it, we should set the MAC address via PF+vf# instead of * setting directly via VF, because the latter will be @@ -2571,7 +2571,7 @@ virNetDevRestoreNetConfig(const char *linkdev, int vf, const char *stateDir) char *pfdevname = NULL; const char *vfdevname = NULL; - if (vf == -1 && virNetDevIsVirtualFunction(linkdev)) { + if (vf == -1 && virNetDevIsVirtualFunction(linkdev) == 1) { /* If this really *is* a VF and the caller just didn't know * it, we should set the MAC address via PF+vf# instead of * setting directly via VF, because the latter will be