[PATCH v2 02/11] hypervisor: rename reference to qemu in domain_logcontext

Praveen K Paladugu posted 11 patches 2 days, 8 hours ago
[PATCH v2 02/11] hypervisor: rename reference to qemu in domain_logcontext
Posted by Praveen K Paladugu 2 days, 8 hours ago
Rename all references to qemu within domain_logcontext files.

Signed-off-by: Praveen K Paladugu <praveenkpaladugu@gmail.com>
---
 src/hypervisor/domain_logcontext.c | 60 +++++++++++++++---------------
 src/hypervisor/domain_logcontext.h | 32 ++++++++--------
 2 files changed, 46 insertions(+), 46 deletions(-)

diff --git a/src/hypervisor/domain_logcontext.c b/src/hypervisor/domain_logcontext.c
index 7932cf7712..3776d68ab9 100644
--- a/src/hypervisor/domain_logcontext.c
+++ b/src/hypervisor/domain_logcontext.c
@@ -1,5 +1,5 @@
 /*
- * domain_logcontext.c: QEMU log context
+ * domain_logcontext.c: Domain log context
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -18,7 +18,7 @@
 
 #include <config.h>
 
-#include "qemu_logcontext.h"
+#include "domain_logcontext.h"
 #include "viralloc.h"
 #include "virlog.h"
 #include "virstring.h"
@@ -26,12 +26,12 @@
 
 #include <fcntl.h>
 
-#define VIR_FROM_THIS VIR_FROM_QEMU
+#define VIR_FROM_THIS VIR_FROM_DOMAIN
 
-VIR_LOG_INIT("qemu.qemu_logcontext");
+VIR_LOG_INIT("domain.domain_logcontext");
 
 
-struct _qemuLogContext {
+struct _domainLogContext {
     GObject parent;
 
     int writefd;
@@ -42,48 +42,48 @@ struct _qemuLogContext {
     virLogManager *manager;
 };
 
-G_DEFINE_TYPE(qemuLogContext, qemu_log_context, G_TYPE_OBJECT);
+G_DEFINE_TYPE(domainLogContext, domain_log_context, G_TYPE_OBJECT);
 
 static void
-qemuLogContextFinalize(GObject *obj);
+domainLogContextFinalize(GObject *obj);
 
 
 static void
-qemu_log_context_init(qemuLogContext *logctxt G_GNUC_UNUSED)
+domain_log_context_init(domainLogContext *logctxt G_GNUC_UNUSED)
 {
 }
 
 
 static void
-qemu_log_context_class_init(qemuLogContextClass *klass)
+domain_log_context_class_init(domainLogContextClass *klass)
 {
     GObjectClass *obj = G_OBJECT_CLASS(klass);
 
-    obj->finalize = qemuLogContextFinalize;
+    obj->finalize = domainLogContextFinalize;
 }
 
 
 static void
-qemuLogContextFinalize(GObject *object)
+domainLogContextFinalize(GObject *object)
 {
-    qemuLogContext *ctxt = QEMU_LOG_CONTEXT(object);
+    domainLogContext *ctxt = DOMAIN_LOG_CONTEXT(object);
     VIR_DEBUG("ctxt=%p", ctxt);
 
     virLogManagerFree(ctxt->manager);
     VIR_FREE(ctxt->path);
     VIR_FORCE_CLOSE(ctxt->writefd);
     VIR_FORCE_CLOSE(ctxt->readfd);
-    G_OBJECT_CLASS(qemu_log_context_parent_class)->finalize(object);
+    G_OBJECT_CLASS(domain_log_context_parent_class)->finalize(object);
 }
 
 
-qemuLogContext *
-qemuLogContextNew(virQEMUDriver *driver,
-                  virDomainObj *vm,
-                  const char *basename)
+domainLogContext *
+domainLogContextNew(virQEMUDriver *driver,
+                    virDomainObj *vm,
+                    const char *basename)
 {
     g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
-    qemuLogContext *ctxt = QEMU_LOG_CONTEXT(g_object_new(QEMU_TYPE_LOG_CONTEXT, NULL));
+    domainLogContext *ctxt = DOMAIN_LOG_CONTEXT(g_object_new(DOMAIN_TYPE_LOG_CONTEXT, NULL));
 
     VIR_DEBUG("Context new %p stdioLogD=%d", ctxt, cfg->stdioLogD);
     ctxt->writefd = -1;
@@ -155,8 +155,8 @@ qemuLogContextNew(virQEMUDriver *driver,
 
 
 int
-qemuLogContextWrite(qemuLogContext *ctxt,
-                    const char *fmt, ...)
+domainLogContextWrite(domainLogContext *ctxt,
+                      const char *fmt, ...)
 {
     va_list argptr;
     g_autofree char *message = NULL;
@@ -186,8 +186,8 @@ qemuLogContextWrite(qemuLogContext *ctxt,
 
 
 ssize_t
-qemuLogContextRead(qemuLogContext *ctxt,
-                   char **msg)
+domainLogContextRead(domainLogContext *ctxt,
+                     char **msg)
 {
     char *buf;
     size_t buflen;
@@ -238,7 +238,7 @@ qemuLogContextRead(qemuLogContext *ctxt,
 
 
 /**
- * qemuLogContextFilter: Read and filter log for relevant messages
+ * domainLogContextFilter: Read and filter log for relevant messages
  * @ctxt: the domain log context
  * @msg: pointer to buffer to store the read messages in
  * @max: maximum length of the message returned in @msg after filtering
@@ -249,9 +249,9 @@ qemuLogContextRead(qemuLogContext *ctxt,
  * after a new line if possible.
  */
 int
-qemuLogContextReadFiltered(qemuLogContext *ctxt,
-                           char **msg,
-                           size_t max)
+domainLogContextReadFiltered(domainLogContext *ctxt,
+                             char **msg,
+                             size_t max)
 {
     char *buf;
     char *eol;
@@ -259,7 +259,7 @@ qemuLogContextReadFiltered(qemuLogContext *ctxt,
     size_t skip;
     ssize_t got;
 
-    if ((got = qemuLogContextRead(ctxt, &buf)) < 0)
+    if ((got = domainLogContextRead(ctxt, &buf)) < 0)
         return -1;
 
     /* Filter out debug messages from intermediate libvirt process */
@@ -302,14 +302,14 @@ qemuLogContextReadFiltered(qemuLogContext *ctxt,
 
 
 int
-qemuLogContextGetWriteFD(qemuLogContext *ctxt)
+domainLogContextGetWriteFD(domainLogContext *ctxt)
 {
     return ctxt->writefd;
 }
 
 
 void
-qemuLogContextMarkPosition(qemuLogContext *ctxt)
+domainLogContextMarkPosition(domainLogContext *ctxt)
 {
     if (ctxt->manager)
         virLogManagerDomainGetLogFilePosition(ctxt->manager,
@@ -323,7 +323,7 @@ qemuLogContextMarkPosition(qemuLogContext *ctxt)
 
 
 virLogManager *
-qemuLogContextGetManager(qemuLogContext *ctxt)
+domainLogContextGetManager(domainLogContext *ctxt)
 {
     return ctxt->manager;
 }
diff --git a/src/hypervisor/domain_logcontext.h b/src/hypervisor/domain_logcontext.h
index 572ac1026e..8bb7c3d217 100644
--- a/src/hypervisor/domain_logcontext.h
+++ b/src/hypervisor/domain_logcontext.h
@@ -1,5 +1,5 @@
 /*
- * domain_logcontext.h: QEMU log context
+ * domain_logcontext.h: Domain log context
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -22,20 +22,20 @@
 #include "qemu_conf.h"
 #include "logging/log_manager.h"
 
-#define QEMU_TYPE_LOG_CONTEXT qemu_log_context_get_type()
-G_DECLARE_FINAL_TYPE(qemuLogContext, qemu_log_context, QEMU, LOG_CONTEXT, GObject);
+#define DOMAIN_TYPE_LOG_CONTEXT domain_log_context_get_type()
+G_DECLARE_FINAL_TYPE(domainLogContext, domain_log_context, DOMAIN, LOG_CONTEXT, GObject);
 
-qemuLogContext *qemuLogContextNew(virQEMUDriver *driver,
-                                  virDomainObj *vm,
-                                  const char *basename);
-int qemuLogContextWrite(qemuLogContext *ctxt,
-                        const char *fmt, ...) G_GNUC_PRINTF(2, 3);
-ssize_t qemuLogContextRead(qemuLogContext *ctxt,
-                           char **msg);
-int qemuLogContextReadFiltered(qemuLogContext *ctxt,
-                               char **msg,
-                               size_t max);
-int qemuLogContextGetWriteFD(qemuLogContext *ctxt);
-void qemuLogContextMarkPosition(qemuLogContext *ctxt);
+domainLogContext *domainLogContextNew(virQEMUDriver *driver,
+                                      virDomainObj *vm,
+                                      const char *basename);
+int domainLogContextWrite(domainLogContext *ctxt,
+                          const char *fmt, ...) G_GNUC_PRINTF(2, 3);
+ssize_t domainLogContextRead(domainLogContext *ctxt,
+                             char **msg);
+int domainLogContextReadFiltered(domainLogContext *ctxt,
+                                 char **msg,
+                                 size_t max);
+int domainLogContextGetWriteFD(domainLogContext *ctxt);
+void domainLogContextMarkPosition(domainLogContext *ctxt);
 
-virLogManager *qemuLogContextGetManager(qemuLogContext *ctxt);
+virLogManager *domainLogContextGetManager(domainLogContext *ctxt);
-- 
2.47.0