render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
c1c534
From db9daffe41e8804f9db0fb70678be99e02efc168 Mon Sep 17 00:00:00 2001
c1c534
Message-Id: <db9daffe41e8804f9db0fb70678be99e02efc168@dist-git>
c1c534
From: Michal Privoznik <mprivozn@redhat.com>
c1c534
Date: Thu, 9 Nov 2017 16:06:42 +0100
c1c534
Subject: [PATCH] conf: s/virDomainObjGetShortName/virDomainDefGetShortName/
c1c534
c1c534
https://bugzilla.redhat.com/show_bug.cgi?id=1461214
c1c534
c1c534
This function works over domain definition and not domain object.
c1c534
Its name is thus misleading.
c1c534
c1c534
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
c1c534
Reviewed-by: John Ferlan <jferlan@redhat.com>
c1c534
(cherry picked from commit fe70fd0c106e7fbe4f7272e5c041324ea3633ce4)
c1c534
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
c1c534
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
c1c534
---
c1c534
 src/conf/domain_conf.c   | 4 ++--
c1c534
 src/conf/domain_conf.h   | 2 +-
c1c534
 src/libvirt_private.syms | 2 +-
c1c534
 src/qemu/qemu_conf.c     | 2 +-
c1c534
 src/qemu/qemu_domain.c   | 4 ++--
c1c534
 src/qemu/qemu_driver.c   | 2 +-
c1c534
 6 files changed, 8 insertions(+), 8 deletions(-)
c1c534
c1c534
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
c1c534
index 394afb0d80..27cfecffda 100644
c1c534
--- a/src/conf/domain_conf.c
c1c534
+++ b/src/conf/domain_conf.c
c1c534
@@ -27871,14 +27871,14 @@ virDomainDefHasMemballoon(const virDomainDef *def)
c1c534
 #define VIR_DOMAIN_SHORT_NAME_MAX 20
c1c534
 
c1c534
 /**
c1c534
- * virDomainObjGetShortName:
c1c534
+ * virDomainDefGetShortName:
c1c534
  * @vm: Machine for which to get a name
c1c534
  * @unique: Make sure the name is unique (use id as well)
c1c534
  *
c1c534
  * Shorten domain name to avoid possible path length limitations.
c1c534
  */
c1c534
 char *
c1c534
-virDomainObjGetShortName(const virDomainDef *def)
c1c534
+virDomainDefGetShortName(const virDomainDef *def)
c1c534
 {
c1c534
     wchar_t wshortname[VIR_DOMAIN_SHORT_NAME_MAX + 1] = {0};
c1c534
     size_t len = 0;
c1c534
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
c1c534
index 171f340785..388fa92dda 100644
c1c534
--- a/src/conf/domain_conf.h
c1c534
+++ b/src/conf/domain_conf.h
c1c534
@@ -3366,7 +3366,7 @@ int virDomainDefGetVcpuPinInfoHelper(virDomainDefPtr def,
c1c534
 
c1c534
 bool virDomainDefHasMemballoon(const virDomainDef *def) ATTRIBUTE_NONNULL(1);
c1c534
 
c1c534
-char *virDomainObjGetShortName(const virDomainDef *def) ATTRIBUTE_NONNULL(1);
c1c534
+char *virDomainDefGetShortName(const virDomainDef *def) ATTRIBUTE_NONNULL(1);
c1c534
 
c1c534
 int
c1c534
 virDomainGetBlkioParametersAssignFromDef(virDomainDefPtr def,
c1c534
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
c1c534
index 811d9053e6..6653f95722 100644
c1c534
--- a/src/libvirt_private.syms
c1c534
+++ b/src/libvirt_private.syms
c1c534
@@ -262,6 +262,7 @@ virDomainDefGetMemoryInitial;
c1c534
 virDomainDefGetMemoryTotal;
c1c534
 virDomainDefGetOnlineVcpumap;
c1c534
 virDomainDefGetSecurityLabelDef;
c1c534
+virDomainDefGetShortName;
c1c534
 virDomainDefGetVcpu;
c1c534
 virDomainDefGetVcpuPinInfoHelper;
c1c534
 virDomainDefGetVcpus;
c1c534
@@ -458,7 +459,6 @@ virDomainObjGetMetadata;
c1c534
 virDomainObjGetOneDef;
c1c534
 virDomainObjGetOneDefState;
c1c534
 virDomainObjGetPersistentDef;
c1c534
-virDomainObjGetShortName;
c1c534
 virDomainObjGetState;
c1c534
 virDomainObjNew;
c1c534
 virDomainObjParseNode;
c1c534
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
c1c534
index 4e5b33b788..66f9761eea 100644
c1c534
--- a/src/qemu/qemu_conf.c
c1c534
+++ b/src/qemu/qemu_conf.c
c1c534
@@ -1676,7 +1676,7 @@ qemuGetDomainHugepagePath(const virDomainDef *def,
c1c534
                           virHugeTLBFSPtr hugepage)
c1c534
 {
c1c534
     char *base = qemuGetBaseHugepagePath(hugepage);
c1c534
-    char *domPath = virDomainObjGetShortName(def);
c1c534
+    char *domPath = virDomainDefGetShortName(def);
c1c534
     char *ret = NULL;
c1c534
 
c1c534
     if (base && domPath)
c1c534
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
c1c534
index 81bfef946e..27117d83ef 100644
c1c534
--- a/src/qemu/qemu_domain.c
c1c534
+++ b/src/qemu/qemu_domain.c
c1c534
@@ -1706,7 +1706,7 @@ qemuDomainSetPrivatePaths(virQEMUDriverPtr driver,
c1c534
 {
c1c534
     virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
c1c534
     qemuDomainObjPrivatePtr priv = vm->privateData;
c1c534
-    char *domname = virDomainObjGetShortName(vm->def);
c1c534
+    char *domname = virDomainDefGetShortName(vm->def);
c1c534
     int ret = -1;
c1c534
 
c1c534
     if (!domname)
c1c534
@@ -8207,7 +8207,7 @@ qemuDomainGetPreservedMountPath(virQEMUDriverConfigPtr cfg,
c1c534
     char *path = NULL;
c1c534
     char *tmp;
c1c534
     const char *suffix = mountpoint + strlen(DEVPREFIX);
c1c534
-    char *domname = virDomainObjGetShortName(vm->def);
c1c534
+    char *domname = virDomainDefGetShortName(vm->def);
c1c534
     size_t off;
c1c534
 
c1c534
     if (!domname)
c1c534
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
c1c534
index 82c60e6ef1..5617c78997 100644
c1c534
--- a/src/qemu/qemu_driver.c
c1c534
+++ b/src/qemu/qemu_driver.c
c1c534
@@ -4088,7 +4088,7 @@ getAutoDumpPath(virQEMUDriverPtr driver,
c1c534
                 virDomainObjPtr vm)
c1c534
 {
c1c534
     char *dumpfile = NULL;
c1c534
-    char *domname = virDomainObjGetShortName(vm->def);
c1c534
+    char *domname = virDomainDefGetShortName(vm->def);
c1c534
     char timestr[100];
c1c534
     struct tm time_info;
c1c534
     time_t curtime = time(NULL);
c1c534
-- 
c1c534
2.15.0
c1c534