[PATCH 1/2] qemu_domainjob: Drop 'const' from strings in _qemuDomainJobObj

Michal Privoznik mprivozn at redhat.com
Fri Apr 30 05:18:48 UTC 2021


These strings are not constant really. They are allocated in
qemuDomainObjBeginJobInternal() and freed in
qemuDomainReset*Job(). Freeing a pointer to const looks weird.

Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
---
 src/qemu/qemu_domainjob.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_domainjob.h b/src/qemu/qemu_domainjob.h
index 75cf1deb6a..46cbb8a067 100644
--- a/src/qemu/qemu_domainjob.h
+++ b/src/qemu/qemu_domainjob.h
@@ -179,20 +179,20 @@ struct _qemuDomainJobObj {
     /* The following members are for QEMU_JOB_* */
     qemuDomainJob active;               /* Currently running job */
     unsigned long long owner;           /* Thread id which set current job */
-    const char *ownerAPI;               /* The API which owns the job */
+    char *ownerAPI;                     /* The API which owns the job */
     unsigned long long started;         /* When the current job started */
 
     /* The following members are for QEMU_AGENT_JOB_* */
     qemuDomainAgentJob agentActive;     /* Currently running agent job */
     unsigned long long agentOwner;      /* Thread id which set current agent job */
-    const char *agentOwnerAPI;          /* The API which owns the agent job */
+    char *agentOwnerAPI;                /* The API which owns the agent job */
     unsigned long long agentStarted;    /* When the current agent job started */
 
     /* The following members are for QEMU_ASYNC_JOB_* */
     virCond asyncCond;                  /* Use to coordinate with async jobs */
     qemuDomainAsyncJob asyncJob;        /* Currently active async job */
     unsigned long long asyncOwner;      /* Thread which set current async job */
-    const char *asyncOwnerAPI;          /* The API which owns the async job */
+    char *asyncOwnerAPI;                /* The API which owns the async job */
     unsigned long long asyncStarted;    /* When the current async job started */
     int phase;                          /* Job phase (mainly for migrations) */
     unsigned long long mask;            /* Jobs allowed during async job */
-- 
2.26.3




More information about the libvir-list mailing list