[PATCH 1/3] hyperv: Drop const for resourceType in hypervDomainAttachSerial()

Michal Privoznik via Devel posted 3 patches 3 weeks, 2 days ago
[PATCH 1/3] hyperv: Drop const for resourceType in hypervDomainAttachSerial()
Posted by Michal Privoznik via Devel 3 weeks, 2 days ago
From: Michal Privoznik <mprivozn@redhat.com>

The 'resourceType' variable inside of hypervDomainAttachSerial()
is declared as both g_autofree and const. This makes no sense.
Since the variable is g_strdup_printf()-ed into a couple of lines
later, it's not const. Drop that part of variable declaration.

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

diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c
index 0c17ef16ec..8dd56f39dc 100644
--- a/src/hyperv/hyperv_driver.c
+++ b/src/hyperv/hyperv_driver.c
@@ -974,7 +974,7 @@ hypervDomainAttachSerial(virDomainPtr domain, virDomainChrDef *serial)
     Msvm_ResourceAllocationSettingData *entry = NULL;
     g_autoptr(GHashTable) serialResource = NULL;
     const char *connectionValue = NULL;
-    g_autofree const char *resourceType = NULL;
+    g_autofree char *resourceType = NULL;
 
     virUUIDFormat(domain->uuid, uuid_string);
 
-- 
2.52.0