[PATCH 4/5] virNetDevOpenvswitchGetVhostuserIfname: Fix const correctness

Michal Privoznik mprivozn at redhat.com
Wed May 13 11:23:01 UTC 2020


The @tmpIfname is a pointer into a const string. To avoid
mistakenly changing the const string via the pointer, make the
pointer const too.

Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
---
 src/util/virnetdevopenvswitch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/virnetdevopenvswitch.c b/src/util/virnetdevopenvswitch.c
index c4cf2cf476..bc6a130035 100644
--- a/src/util/virnetdevopenvswitch.c
+++ b/src/util/virnetdevopenvswitch.c
@@ -483,7 +483,7 @@ int
 virNetDevOpenvswitchGetVhostuserIfname(const char *path,
                                        char **ifname)
 {
-    char *tmpIfname = NULL;
+    const char *tmpIfname = NULL;
     int status;
     int ret = -1;
     g_autoptr(virCommand) cmd = NULL;
-- 
2.26.2




More information about the libvir-list mailing list