Hello community,

here is the log from the commit of package hyper-v for openSUSE:Factory checked 
in at 2013-08-07 20:44:11
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/hyper-v (Old)
 and      /work/SRC/openSUSE:Factory/.hyper-v.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "hyper-v"

Changes:
--------
--- /work/SRC/openSUSE:Factory/hyper-v/hyper-v.changes  2013-08-01 
17:55:18.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.hyper-v.new/hyper-v.changes     2013-08-07 
20:44:13.000000000 +0200
@@ -1,0 +2,12 @@
+Wed Aug  7 19:04:35 CEST 2013 - [email protected]
+
+- cache FQDN in kvp_daemon to avoid timeouts (bnc#828714)
+- use full nlmsghdr in netlink_send
+- correct payload size in netlink_send
+- use single send+recv buffer
+- log errors to syslog in kvp_set_ip_info
+- check return value of system in hv_kvp_daemon
+- in kvp_set_ip_info free mac_addr right after usage
+- check return value of daemon to fix compiler warning.
+
+-------------------------------------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ hyper-v.tools.hv.hv_kvp_daemon.c ++++++
--- /var/tmp/diff_new_pack.FO8BhY/_old  2013-08-07 20:44:13.000000000 +0200
+++ /var/tmp/diff_new_pack.FO8BhY/_new  2013-08-07 20:44:13.000000000 +0200
@@ -89,6 +89,7 @@
 static char *os_build;
 static char *os_version;
 static char *lic_version = "Unknown version";
+static char full_domain_name[HV_KVP_EXCHANGE_MAX_VALUE_SIZE];
 static struct utsname uts_buf;
 
 /*
@@ -1299,6 +1300,7 @@
        }
 
        error = kvp_write_file(file, "HWADDR", "", mac_addr);
+       free(mac_addr);
        if (error)
                goto setval_error;
 
@@ -1344,7 +1346,6 @@
                goto setval_error;
 
 setval_done:
-       free(mac_addr);
        fclose(file);
 
        /*
@@ -1353,18 +1354,22 @@
         */
 
        snprintf(cmd, sizeof(cmd), "%s %s", "hv_set_ifconfig", if_file);
-       system(cmd);
+       if (system(cmd)) {
+               syslog(LOG_ERR, "Failed to execute cmd '%s'; error: %d %s",
+                               cmd, errno, strerror(errno));
+               return HV_E_FAIL;
+       }
        return 0;
 
 setval_error:
-       syslog(LOG_ERR, "Failed to write config file");
-       free(mac_addr);
+       syslog(LOG_ERR, "Failed to write config file. error: %d %s",
+               errno, strerror(errno));
        fclose(file);
        return error;
 }
 
 
-static int
+static void
 kvp_get_domain_name(char *buffer, int length)
 {
        struct addrinfo hints, *info ;
@@ -1378,34 +1383,29 @@
 
        error = getaddrinfo(buffer, NULL, &hints, &info);
        if (error != 0) {
-               strcpy(buffer, "getaddrinfo failed\n");
-               return error;
+               snprintf(buffer, length, "getaddrinfo failed: 0x%x %s",
+                       error, gai_strerror(error));
+               return;
        }
-       strcpy(buffer, info->ai_canonname);
+       snprintf(buffer, length, "%s", info->ai_canonname);
        freeaddrinfo(info);
-       return error;
 }
 
 static int
 netlink_send(int fd, struct cn_msg *msg)
 {
-       struct nlmsghdr *nlh;
+       struct nlmsghdr nlh = { .nlmsg_type = NLMSG_DONE };
        unsigned int size;
        struct msghdr message;
-       char buffer[64];
        struct iovec iov[2];
 
-       size = NLMSG_SPACE(sizeof(struct cn_msg) + msg->len);
+       size = sizeof(struct cn_msg) + msg->len;
 
-       nlh = (struct nlmsghdr *)buffer;
-       nlh->nlmsg_seq = 0;
-       nlh->nlmsg_pid = getpid();
-       nlh->nlmsg_type = NLMSG_DONE;
-       nlh->nlmsg_len = NLMSG_LENGTH(size - sizeof(*nlh));
-       nlh->nlmsg_flags = 0;
+       nlh.nlmsg_pid = getpid();
+       nlh.nlmsg_len = NLMSG_LENGTH(size);
 
-       iov[0].iov_base = nlh;
-       iov[0].iov_len = sizeof(*nlh);
+       iov[0].iov_base = &nlh;
+       iov[0].iov_len = sizeof(nlh);
 
        iov[1].iov_base = msg;
        iov[1].iov_len = size;
@@ -1435,25 +1435,29 @@
        int     pool;
        char    *if_name;
        struct hv_kvp_ipaddr_value *kvp_ip_val;
-       char *kvp_send_buffer;
        char *kvp_recv_buffer;
        size_t kvp_recv_buffer_len;
 
-       daemon(1, 0);
+       if (daemon(1, 0))
+               return 1;
        openlog("KVP", 0, LOG_USER);
        syslog(LOG_INFO, "KVP starting; pid is:%d", getpid());
 
-       kvp_recv_buffer_len = NLMSG_HDRLEN + sizeof(struct cn_msg) + 
sizeof(struct hv_kvp_msg);
-       kvp_send_buffer = calloc(1, kvp_recv_buffer_len);
+       kvp_recv_buffer_len = NLMSG_LENGTH(0) + sizeof(struct cn_msg) + 
sizeof(struct hv_kvp_msg);
        kvp_recv_buffer = calloc(1, kvp_recv_buffer_len);
-       if (!(kvp_send_buffer && kvp_recv_buffer)) {
-               syslog(LOG_ERR, "Failed to allocate netlink buffers");
+       if (!kvp_recv_buffer) {
+               syslog(LOG_ERR, "Failed to allocate netlink buffer");
                exit(EXIT_FAILURE);
        }
        /*
         * Retrieve OS release information.
         */
        kvp_get_os_info();
+       /*
+        * Cache Fully Qualified Domain Name because getaddrinfo takes an
+        * unpredicatable amount of time to finish.
+        */
+       kvp_get_domain_name(full_domain_name, sizeof(full_domain_name));
 
        if (kvp_file_init()) {
                syslog(LOG_ERR, "Failed to initialize the pools");
@@ -1489,7 +1493,7 @@
        /*
         * Register ourselves with the kernel.
         */
-       message = (struct cn_msg *)kvp_send_buffer;
+       message = (struct cn_msg *)kvp_recv_buffer;
        message->id.idx = CN_KVP_IDX;
        message->id.val = CN_KVP_VAL;
 
@@ -1672,8 +1676,7 @@
 
                switch (hv_msg->body.kvp_enum_data.index) {
                case FullyQualifiedDomainName:
-                       kvp_get_domain_name(key_value,
-                                       HV_KVP_EXCHANGE_MAX_VALUE_SIZE);
+                       strcpy(key_value, full_domain_name);
                        strcpy(key_name, "FullyQualifiedDomainName");
                        break;
                case IntegrationServicesVersion:

++++++ hyper-v.tools.hv.hv_vss_daemon.c ++++++
--- /var/tmp/diff_new_pack.FO8BhY/_old  2013-08-07 20:44:13.000000000 +0200
+++ /var/tmp/diff_new_pack.FO8BhY/_new  2013-08-07 20:44:13.000000000 +0200
@@ -105,23 +105,18 @@
 
 static int netlink_send(int fd, struct cn_msg *msg)
 {
-       struct nlmsghdr *nlh;
+       struct nlmsghdr nlh = { .nlmsg_type = NLMSG_DONE };
        unsigned int size;
        struct msghdr message;
-       char buffer[64];
        struct iovec iov[2];
 
-       size = NLMSG_SPACE(sizeof(struct cn_msg) + msg->len);
+       size = sizeof(struct cn_msg) + msg->len;
 
-       nlh = (struct nlmsghdr *)buffer;
-       nlh->nlmsg_seq = 0;
-       nlh->nlmsg_pid = getpid();
-       nlh->nlmsg_type = NLMSG_DONE;
-       nlh->nlmsg_len = NLMSG_LENGTH(size - sizeof(*nlh));
-       nlh->nlmsg_flags = 0;
+       nlh.nlmsg_pid = getpid();
+       nlh.nlmsg_len = NLMSG_LENGTH(size);
 
-       iov[0].iov_base = nlh;
-       iov[0].iov_len = sizeof(*nlh);
+       iov[0].iov_base = &nlh;
+       iov[0].iov_len = sizeof(nlh);
 
        iov[1].iov_base = msg;
        iov[1].iov_len = size;
@@ -145,7 +140,6 @@
        struct cn_msg   *incoming_cn_msg;
        int     op;
        struct hv_vss_msg *vss_msg;
-       char *vss_send_buffer;
        char *vss_recv_buffer;
        size_t vss_recv_buffer_len;
 
@@ -155,10 +149,9 @@
        openlog("Hyper-V VSS", 0, LOG_USER);
        syslog(LOG_INFO, "VSS starting; pid is:%d", getpid());
 
-       vss_recv_buffer_len = NLMSG_HDRLEN + sizeof(struct cn_msg) + 
sizeof(struct hv_vss_msg);
-       vss_send_buffer = calloc(1, vss_recv_buffer_len);
+       vss_recv_buffer_len = NLMSG_LENGTH(0) + sizeof(struct cn_msg) + 
sizeof(struct hv_vss_msg);
        vss_recv_buffer = calloc(1, vss_recv_buffer_len);
-       if (!(vss_send_buffer && vss_recv_buffer)) {
+       if (!vss_recv_buffer) {
                syslog(LOG_ERR, "Failed to allocate netlink buffers");
                exit(EXIT_FAILURE);
        }
@@ -185,7 +178,7 @@
        /*
         * Register ourselves with the kernel.
         */
-       message = (struct cn_msg *)vss_send_buffer;
+       message = (struct cn_msg *)vss_recv_buffer;
        message->id.idx = CN_VSS_IDX;
        message->id.val = CN_VSS_VAL;
        message->ack = 0;

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to