Signed-off-by: Jens Axboe <axboe@kernel.dk>
client->hostname = strdup(hostname);
if (type == Fio_client_socket)
client->hostname = strdup(hostname);
if (type == Fio_client_socket)
+ client->is_sock = true;
strcpy((char *) pdu->file, filename);
pdu->client_type = cpu_to_le16((uint16_t) client->type);
strcpy((char *) pdu->file, filename);
pdu->client_type = cpu_to_le16((uint16_t) client->type);
+ client->sent_job = true;
ret = fio_net_send_cmd(client->fd, FIO_NET_CMD_LOAD_FILE, pdu, p_size,NULL, NULL);
free(pdu);
return ret;
ret = fio_net_send_cmd(client->fd, FIO_NET_CMD_LOAD_FILE, pdu, p_size,NULL, NULL);
free(pdu);
return ret;
pdu->buf_len = __cpu_to_le32(sb.st_size);
pdu->client_type = cpu_to_le32(client->type);
pdu->buf_len = __cpu_to_le32(sb.st_size);
pdu->client_type = cpu_to_le32(client->type);
+ client->sent_job = true;
ret = fio_net_send_cmd(client->fd, FIO_NET_CMD_JOB, pdu, p_size, NULL, NULL);
free(pdu);
close(fd);
ret = fio_net_send_cmd(client->fd, FIO_NET_CMD_JOB, pdu, p_size, NULL, NULL);
free(pdu);
close(fd);
ret = __fio_client_send_remote_ini(client, filename);
if (!ret)
ret = __fio_client_send_remote_ini(client, filename);
if (!ret)
+ client->sent_job = true;
opt_list = &client->opt_lists[p->ts.thread_number - 1];
tsobj = show_thread_status(&p->ts, &p->rs, opt_list, NULL);
opt_list = &client->opt_lists[p->ts.thread_number - 1];
tsobj = show_thread_status(&p->ts, &p->rs, opt_list, NULL);
+ client->did_stat = true;
if (tsobj) {
json_object_add_client_info(tsobj, client);
json_array_add_value_object(clients_array, tsobj);
if (tsobj) {
json_object_add_client_info(tsobj, client);
json_array_add_value_object(clients_array, tsobj);
struct cmd_du_pdu *du = (struct cmd_du_pdu *) cmd->payload;
if (!client->disk_stats_shown) {
struct cmd_du_pdu *du = (struct cmd_du_pdu *) cmd->payload;
if (!client->disk_stats_shown) {
- client->disk_stats_shown = 1;
+ client->disk_stats_shown = true;
log_info("\nDisk stats (read/write):\n");
}
log_info("\nDisk stats (read/write):\n");
}
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include "stat.h"
struct fio_net_cmd;
#include "stat.h"
struct fio_net_cmd;
- int skip_newline;
- int is_sock;
- int disk_stats_shown;
+ bool skip_newline;
+ bool is_sock;
+ bool disk_stats_shown;
unsigned int jobs;
unsigned int nr_stat;
int error;
int signal;
int ipv6;
unsigned int jobs;
unsigned int nr_stat;
int error;
int signal;
int ipv6;
- int sent_job;
- int did_stat;
+ bool sent_job;
+ bool did_stat;
uint32_t type;
uint32_t thread_number;
uint32_t type;
uint32_t thread_number;
* For local domain sockets:
* *ptr is the filename, *is_sock is 1.
*/
* For local domain sockets:
* *ptr is the filename, *is_sock is 1.
*/
-int fio_server_parse_string(const char *str, char **ptr, int *is_sock,
+int fio_server_parse_string(const char *str, char **ptr, bool *is_sock,
int *port, struct in_addr *inp,
struct in6_addr *inp6, int *ipv6)
{
int *port, struct in_addr *inp,
struct in6_addr *inp6, int *ipv6)
{
int lport = 0;
*ptr = NULL;
int lport = 0;
*ptr = NULL;
*port = fio_net_port;
*ipv6 = 0;
if (!strncmp(str, "sock:", 5)) {
*ptr = strdup(str + 5);
*port = fio_net_port;
*ipv6 = 0;
if (!strncmp(str, "sock:", 5)) {
*ptr = strdup(str + 5);
static int fio_handle_server_arg(void)
{
int port = fio_net_port;
static int fio_handle_server_arg(void)
{
int port = fio_net_port;
+ bool is_sock;
+ int ret = 0;
saddr_in.sin_addr.s_addr = htonl(INADDR_ANY);
saddr_in.sin_addr.s_addr = htonl(INADDR_ANY);
extern int fio_net_send_cmd(int, uint16_t, const void *, off_t, uint64_t *, struct flist_head *);
extern int fio_net_send_simple_cmd(int, uint16_t, uint64_t, struct flist_head *);
extern void fio_server_set_arg(const char *);
extern int fio_net_send_cmd(int, uint16_t, const void *, off_t, uint64_t *, struct flist_head *);
extern int fio_net_send_simple_cmd(int, uint16_t, uint64_t, struct flist_head *);
extern void fio_server_set_arg(const char *);
-extern int fio_server_parse_string(const char *, char **, int *, int *, struct in_addr *, struct in6_addr *, int *);
+extern int fio_server_parse_string(const char *, char **, bool *, int *, struct in_addr *, struct in6_addr *, int *);
extern int fio_server_parse_host(const char *, int, struct in_addr *, struct in6_addr *);
extern const char *fio_server_op(unsigned int);
extern void fio_server_got_signal(int);
extern int fio_server_parse_host(const char *, int, struct in_addr *, struct in6_addr *);
extern const char *fio_server_op(unsigned int);
extern void fio_server_got_signal(int);