[v4] power: update for handling fifo path string

Message ID 20190416102039.16204-1-lukaszx.gosiewski@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [v4] power: update for handling fifo path string |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Performance-Testing success Performance Testing PASS
ci/mellanox-Performance-Testing success Performance Testing PASS

Commit Message

Lukasz Gosiewski April 16, 2019, 10:20 a.m. UTC
  From: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>

Removed doubled created fifo path string for channel info.

Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
Signed-off-by: Lukasz Gosiewski <lukaszx.gosiewski@intel.com>

---
v4:
*improvement to coding style

v3:
*improvement to coding style

v2:
* rebase to master changes
---
 examples/vm_power_manager/channel_manager.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
  

Comments

Hunt, David April 17, 2019, 12:21 p.m. UTC | #1
On 16/4/2019 11:20 AM, Lukasz Gosiewski wrote:
> From: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
>
> Removed doubled created fifo path string for channel info.
>
> Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
> Signed-off-by: Lukasz Gosiewski <lukaszx.gosiewski@intel.com>
>
> ---
> v4:
> *improvement to coding style
>
> v3:
> *improvement to coding style
>
> v2:
> * rebase to master changes
> ---


Acked-by: David Hunt <david.hunt@intel.com>
  
Thomas Monjalon July 4, 2019, 8:06 p.m. UTC | #2
17/04/2019 14:21, Hunt, David:
> 
> On 16/4/2019 11:20 AM, Lukasz Gosiewski wrote:
> > From: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
> >
> > Removed doubled created fifo path string for channel info.
> >
> > Signed-off-by: Lukasz Krakowiak <lukaszx.krakowiak@intel.com>
> > Signed-off-by: Lukasz Gosiewski <lukaszx.gosiewski@intel.com>
> 
> Acked-by: David Hunt <david.hunt@intel.com>

Applied, thanks
Sorry for the delay, it was hidden in the stack of patches for power.
  

Patch

diff --git a/examples/vm_power_manager/channel_manager.c b/examples/vm_power_manager/channel_manager.c
index 0187f79ab..05c0eea44 100644
--- a/examples/vm_power_manager/channel_manager.c
+++ b/examples/vm_power_manager/channel_manager.c
@@ -24,6 +24,7 @@ 
 #include <rte_log.h>
 #include <rte_atomic.h>
 #include <rte_spinlock.h>
+#include <rte_string_fns.h>
 
 #include <libvirt/libvirt.h>
 
@@ -362,8 +363,6 @@  setup_host_channel_info(struct channel_info **chan_info_dptr,
 	chan_info->status = CHANNEL_MGR_CHANNEL_DISCONNECTED;
 	chan_info->type = CHANNEL_TYPE_JSON;
 
-	fifo_path(chan_info->channel_path, sizeof(chan_info->channel_path));
-
 	if (open_host_channel(chan_info) < 0) {
 		RTE_LOG(ERR, CHANNEL_MANAGER, "Could not open host channel: "
 				"'%s'\n",
@@ -563,8 +562,8 @@  add_host_channel(void)
 				"channel '%s'\n", socket_path);
 		return 0;
 	}
-	strlcpy(chan_info->channel_path, socket_path,
-		sizeof(chan_info->channel_path));
+	rte_strlcpy(chan_info->channel_path, socket_path, UNIX_PATH_MAX);
+
 	if (setup_host_channel_info(&chan_info, 0) < 0) {
 		rte_free(chan_info);
 		return 0;