btrfs: inline code of reada_tree_block and remove it

It's trivial with a single user. And remove one pointless BUG_ON.

Signed-off-by: David Sterba <a2ce9d316ca04d17b520237d2846a218b8284e52@suse.cz>

--- fs/btrfs/relocation.c
+++ fs/btrfs/relocation.c
@@ -2857,15 +2857,6 @@
 	return 0;
 }

-static int reada_tree_block(struct reloc_control *rc,
-			    struct tree_block *block)
-{
-	BUG_ON(block->key_ready);
-	readahead_tree_block(rc->extent_root, block->bytenr,
-			block->key.objectid);
-	return 0;
-}
-
 /*
  * helper function to relocate a tree block
  */
@@ -2945,7 +2936,8 @@
 	while (rb_node) {
 		block = rb_entry(rb_node, struct tree_block, rb_node);
 		if (!block->key_ready)
-			reada_tree_block(rc, block);
+			readahead_tree_block(rc->extent_root, block->bytenr,
+					block->key.objectid);
 		rb_node = rb_next(rb_node);
 	}


fixed conflict

fixed conflict

--- js/common/bootstrap/js-errors.h
+++ js/common/bootstrap/js-errors.h
@@ -15,7 +15,6 @@
   "  \"ERROR_NUMERIC_OVERFLOW\"       : { \"code\" : 6, \"message\" : \"numeric overflow\" }, \n"
   "  \"ERROR_ILLEGAL_OPTION\"         : { \"code\" : 7, \"message\" : \"illegal option\" }, \n"
   "  \"ERROR_DEAD_PID\"               : { \"code\" : 8, \"message\" : \"dead process identifier\" }, \n"
-<<<<<<< HEAD
   "  \"ERROR_OPEN_ERROR\"             : { \"code\" : 9, \"message\" : \"open/create file failed\" }, \n"
   "  \"ERROR_WRITE_ERROR\"            : { \"code\" : 10, \"message\" : \"write failed\" }, \n"
   "  \"ERROR_LOCK_ERROR\"             : { \"code\" : 11, \"message\" : \"lock failed\" }, \n"
@@ -67,7 +66,6 @@
   "  \"ERROR_QUERY_BIND_PARAMETER_UNDECLARED\" : { \"code\" : 1592, \"message\" : \"bind parameter '%s' was not declared in the query\" }, \n"
   "  \"ERROR_QUERY_BIND_PARAMETER_VALUE_INVALID\" : { \"code\" : 1593, \"message\" : \"invalid value for bind parameter '%s'\" }, \n"
   "  \"ERROR_QUERY_BIND_PARAMETER_NUMBER_OUT_OF_RANGE\" : { \"code\" : 1594, \"message\" : \"bind parameter number '%s' out of range\" }, \n"
-=======
   "  \"ERROR_NOT_IMPLEMENTED\"        : { \"code\" : 9, \"message\" : \"not implemented\" }, \n"
   "  \"ERROR_HTTP_BAD_PARAMETER\"     : { \"code\" : 400, \"message\" : \"bad parameter\" }, \n"
   "  \"ERROR_HTTP_METHOD_NOT_ALLOWED\" : { \"code\" : 405, \"message\" : \"method not supported\" }, \n"
@@ -113,7 +111,6 @@
   "  \"ERROR_QUERY_BIND_PARAMETER_UNDECLARED\" : { \"code\" : 1515, \"message\" : \"bind parameter '%s' was not declared in the query\" }, \n"
   "  \"ERROR_QUERY_BIND_PARAMETER_VALUE_INVALID\" : { \"code\" : 1516, \"message\" : \"invalid value for bind parameter '%s'\" }, \n"
   "  \"ERROR_QUERY_BIND_PARAMETER_NUMBER_OUT_OF_RANGE\" : { \"code\" : 1517, \"message\" : \"bind parameter number '%s' out of range\" }, \n"
->>>>>>> 5803d27052780853bde39b1c784cc3867fd3b6cf
   "  \"ERROR_CURSOR_NOT_FOUND\"       : { \"code\" : 1600, \"message\" : \"cursor not found\" }, \n"
   "  \"ERROR_SESSION_USERHANDLER_URL_INVALID\" : { \"code\" : 1700, \"message\" : \"expecting <prefix>/user/<username>\" }, \n"
   "  \"ERROR_SESSION_USERHANDLER_CANNOT_CREATE_USER\" : { \"code\" : 1701, \"message\" : \"cannot create user\" }, \n"
@@ -135,10 +132,7 @@
   "  \"SIMPLE_CLIENT_COULD_NOT_CONNECT\" : { \"code\" : 2001, \"message\" : \"could not connect to server\" }, \n"
   "  \"SIMPLE_CLIENT_COULD_NOT_WRITE\" : { \"code\" : 2002, \"message\" : \"could not write to server\" }, \n"
   "  \"SIMPLE_CLIENT_COULD_NOT_READ\" : { \"code\" : 2003, \"message\" : \"could not read from server\" }, \n"
-<<<<<<< HEAD
   "  \"ERROR_PROTOCOL_UNSUPPORTED_METHOD\" : { \"code\" : 3000, \"message\" : \"method not supported\" }, \n"
-=======
->>>>>>> 5803d27052780853bde39b1c784cc3867fd3b6cf
   "};\n"
   "\n"
 ;


fixes #120

fixes #120

--- libs/ofxCv/include/ofxCv/Wrappers.h
+++ libs/ofxCv/include/ofxCv/Wrappers.h
@@ -382,7 +382,7 @@
 	void rotate(S& src, D& dst, double angle, ofColor fill = ofColor::black, int interpolation = INTER_LINEAR) {
 		imitate(dst, src);
 		Mat srcMat = toCv(src), dstMat = toCv(dst);
-		Point2f center(srcMat.rows / 2, srcMat.cols / 2);
+		Point2f center(srcMat.cols / 2, srcMat.rows / 2);
 		Mat rotationMatrix = getRotationMatrix2D(center, angle, 1);
 		warpAffine(srcMat, dstMat, rotationMatrix, srcMat.size(), interpolation, BORDER_CONSTANT, toCv(fill));
 	}


Simplify vp9_adapt_nmv_probs

Simplify vp9_adapt_nmv_probs

Remove the temporary branch count arrays and build the adapted probabilities
while walking the tree. Gives an additional 1.5% or so on CIF.

Change-Id: I875d61e5e0ec778e5d2f7f9d0837b989a91cf3a3

--- vp9/common/vp9_entropymv.c
+++ vp9/common/vp9_entropymv.c
@@ -211,14 +211,16 @@
   }
 }

-static void adapt_prob(vp9_prob *dest, vp9_prob prep, vp9_prob newp,
+static void adapt_prob(vp9_prob *dest, vp9_prob prep,
                        unsigned int ct[2]) {
   int count = ct[0] + ct[1];
-
   if (count) {
+    vp9_prob newp = get_binary_prob(ct[0], ct[1]);
     count = count > MV_COUNT_SAT ? MV_COUNT_SAT : count;
     *dest = weighted_prob(prep, newp,
                           MV_MAX_UPDATE_FACTOR * count / MV_COUNT_SAT);
+  } else {
+    *dest = prep;
   }
 }

@@ -294,18 +296,43 @@
   }
 }

+static unsigned int adapt_probs(unsigned int i,
+                                vp9_tree tree,
+                                vp9_prob this_probs[],
+                                const vp9_prob last_probs[],
+                                const unsigned int num_events[]) {
+  unsigned int left, right, weight;
+  vp9_prob this_prob;
+
+  if (tree[i] <= 0) {
+    left = num_events[-tree[i]];
+  } else {
+    left = adapt_probs(tree[i], tree, this_probs, last_probs,
+                       num_events);
+  }
+  if (tree[i + 1] <= 0) {
+    right = num_events[-tree[i + 1]];
+  } else {
+    right = adapt_probs(tree[i + 1], tree, this_probs, last_probs,
+                        num_events);
+  }
+
+  weight = left + right;
+  if (weight) {
+    this_prob = get_binary_prob(left, right);
+    weight = weight > MV_COUNT_SAT ? MV_COUNT_SAT : weight;
+    this_prob = weighted_prob(last_probs[i>>1], this_prob,
+                              MV_MAX_UPDATE_FACTOR * weight / MV_COUNT_SAT);
+  } else {
+    this_prob = last_probs[i >> 1];
+  }
+  this_probs[i>>1] = this_prob;
+  return left + right;
+}
+
+
 void vp9_adapt_nmv_probs(VP9_COMMON *cm, int usehp) {
-  int i, j, k;
-  nmv_context prob;
-  unsigned int branch_ct_joint[MV_JOINTS - 1][2];
-  unsigned int branch_ct_sign[2][2];
-  unsigned int branch_ct_classes[2][MV_CLASSES - 1][2];
-  unsigned int branch_ct_class0[2][CLASS0_SIZE - 1][2];
-  unsigned int branch_ct_bits[2][MV_OFFSET_BITS][2];
-  unsigned int branch_ct_class0_fp[2][CLASS0_SIZE][4 - 1][2];
-  unsigned int branch_ct_fp[2][4 - 1][2];
-  unsigned int branch_ct_class0_hp[2][2];
-  unsigned int branch_ct_hp[2][2];
+  int i, j;
 #ifdef MV_COUNT_TESTING
   printf("joints count: ");
   for (j = 0; j < MV_JOINTS; ++j) printf("%d ", cm->fc.NMVcount.joints[j]);
@@ -366,75 +393,48 @@
   smooth_counts(&cm->fc.NMVcount.comps[0]);
   smooth_counts(&cm->fc.NMVcount.comps[1]);
 #endif
-  vp9_counts_to_nmv_context(&cm->fc.NMVcount,
-                            &prob,
-                            usehp,
-                            branch_ct_joint,
-                            branch_ct_sign,
-                            branch_ct_classes,
-                            branch_ct_class0,
-                            branch_ct_bits,
-                            branch_ct_class0_fp,
-                            branch_ct_fp,
-                            branch_ct_class0_hp,
-                            branch_ct_hp);
-
-  for (j = 0; j < MV_JOINTS - 1; ++j) {
-    adapt_prob(&cm->fc.nmvc.joints[j],
-               cm->fc.pre_nmvc.joints[j],
-               prob.joints[j],
-               branch_ct_joint[j]);
-  }
+  vp9_counts_process(&cm->fc.NMVcount, usehp);
+
+  adapt_probs(0, vp9_mv_joint_tree,
+              cm->fc.nmvc.joints, cm->fc.pre_nmvc.joints,
+              cm->fc.NMVcount.joints);
+
   for (i = 0; i < 2; ++i) {
     adapt_prob(&cm->fc.nmvc.comps[i].sign,
                cm->fc.pre_nmvc.comps[i].sign,
-               prob.comps[i].sign,
-               branch_ct_sign[i]);
-    for (j = 0; j < MV_CLASSES - 1; ++j) {
-      adapt_prob(&cm->fc.nmvc.comps[i].classes[j],
-                 cm->fc.pre_nmvc.comps[i].classes[j],
-                 prob.comps[i].classes[j],
-                 branch_ct_classes[i][j]);
-    }
-    for (j = 0; j < CLASS0_SIZE - 1; ++j) {
-      adapt_prob(&cm->fc.nmvc.comps[i].class0[j],
-                 cm->fc.pre_nmvc.comps[i].class0[j],
-                 prob.comps[i].class0[j],
-                 branch_ct_class0[i][j]);
-    }
+               cm->fc.NMVcount.comps[i].sign);
+    adapt_probs(0, vp9_mv_class_tree,
+                cm->fc.nmvc.comps[i].classes, cm->fc.pre_nmvc.comps[i].classes,
+                cm->fc.NMVcount.comps[i].classes);
+    adapt_probs(0, vp9_mv_class0_tree,
+                cm->fc.nmvc.comps[i].class0, cm->fc.pre_nmvc.comps[i].class0,
+                cm->fc.NMVcount.comps[i].class0);
     for (j = 0; j < MV_OFFSET_BITS; ++j) {
       adapt_prob(&cm->fc.nmvc.comps[i].bits[j],
                  cm->fc.pre_nmvc.comps[i].bits[j],
-                 prob.comps[i].bits[j],
-                 branch_ct_bits[i][j]);
+                 cm->fc.NMVcount.comps[i].bits[j]);
     }
   }
   for (i = 0; i < 2; ++i) {
     for (j = 0; j < CLASS0_SIZE; ++j) {
-      for (k = 0; k < 3; ++k) {
-        adapt_prob(&cm->fc.nmvc.comps[i].class0_fp[j][k],
-                   cm->fc.pre_nmvc.comps[i].class0_fp[j][k],
-                   prob.comps[i].class0_fp[j][k],
-                   branch_ct_class0_fp[i][j][k]);
-      }
-    }
-    for (j = 0; j < 3; ++j) {
-      adapt_prob(&cm->fc.nmvc.comps[i].fp[j],
-                 cm->fc.pre_nmvc.comps[i].fp[j],
-                 prob.comps[i].fp[j],
-                 branch_ct_fp[i][j]);
-    }
+      adapt_probs(0, vp9_mv_fp_tree,
+                  cm->fc.nmvc.comps[i].class0_fp[j],
+                  cm->fc.pre_nmvc.comps[i].class0_fp[j],
+                  cm->fc.NMVcount.comps[i].class0_fp[j]);
+    }
+    adapt_probs(0, vp9_mv_fp_tree,
+                cm->fc.nmvc.comps[i].fp,
+                cm->fc.pre_nmvc.comps[i].fp,
+                cm->fc.NMVcount.comps[i].fp);
   }
   if (usehp) {
     for (i = 0; i < 2; ++i) {
       adapt_prob(&cm->fc.nmvc.comps[i].class0_hp,
                  cm->fc.pre_nmvc.comps[i].class0_hp,
-                 prob.comps[i].class0_hp,
-                 branch_ct_class0_hp[i]);
+                 cm->fc.NMVcount.comps[i].class0_hp);
       adapt_prob(&cm->fc.nmvc.comps[i].hp,
                  cm->fc.pre_nmvc.comps[i].hp,
-                 prob.comps[i].hp,
-                 branch_ct_hp[i]);
+                 cm->fc.NMVcount.comps[i].hp);
     }
   }
 }


fix concat shape error (#25414)

fix concat shape error (#25414)

* fix concat shape error
test=develop

--- paddle/fluid/operators/concat_op.h
+++ paddle/fluid/operators/concat_op.h
@@ -31,12 +31,19 @@
   auto out_dims = inputs_dims[0];
   size_t in_zero_dims_size = out_dims.size();
   for (size_t i = 1; i < n; i++) {
+    PADDLE_ENFORCE_EQ(inputs_dims[i].size(), out_dims.size(),
+                      platform::errors::InvalidArgument(
+                          "The shape of input[0] and input[%d] "
+                          "is expected to be equal."
+                          "But received input[0]'s shape = "
+                          "[%s], input[%d]'s shape = [%s].",
+                          i, inputs_dims[0], i, inputs_dims[i]));
     for (size_t j = 0; j < in_zero_dims_size; j++) {
       if (j == axis) {
         if (is_runtime) {
           out_dims[axis] += inputs_dims[i][j];
         } else {
-          if (inputs_dims[i][j] == -1) {
+          if (inputs_dims[i][j] == -1 || out_dims[j] == -1) {
             out_dims[axis] = -1;
           } else {
             out_dims[axis] += inputs_dims[i][j];
@@ -54,6 +61,9 @@
                                 "But received input[0]'s shape = "
                                 "[%s], input[%d]'s shape = [%s].",
                                 j, i, inputs_dims[0], i, inputs_dims[i]));
+        }
+        if (!is_runtime && out_dims[j] == -1 && inputs_dims[i][j] > 0) {
+          out_dims[j] = inputs_dims[i][j];
         }
       }
     }


Change version string to distinguish our modified version of GNU grep from the original.

--- gnu/usr.bin/grep/config.h
+++ gnu/usr.bin/grep/config.h
@@ -298,7 +298,7 @@
 #define STDC_HEADERS 1

 /* Version number of package */
-#define VERSION "2.5.1"
+#define VERSION "2.5.1-FreeBSD"

 /* Number of bits in a file offset, on hosts where this is settable. */
 /* #undef _FILE_OFFSET_BITS */


NFSv4.1: integer overflow in decode_cb_sequence_args()

This seems like it could overflow on 32 bits.  Use kmalloc_array() which
has overflow protection built in.

Signed-off-by: Dan Carpenter <ff341aa343d564f9e53e9dcb6996be8c04859a66@oracle.com>
Signed-off-by: Trond Myklebust <6a1f9db795c9fc44be97d66ab114c53193bd3d13@netapp.com>

--- fs/nfs/callback_xdr.c
+++ fs/nfs/callback_xdr.c
@@ -455,9 +455,9 @@
 	args->csa_nrclists = ntohl(*p++);
 	args->csa_rclists = NULL;
 	if (args->csa_nrclists) {
-		args->csa_rclists = kmalloc(args->csa_nrclists *
-					    sizeof(*args->csa_rclists),
-					    GFP_KERNEL);
+		args->csa_rclists = kmalloc_array(args->csa_nrclists,
+						  sizeof(*args->csa_rclists),
+						  GFP_KERNEL);
 		if (unlikely(args->csa_rclists == NULL))
 			goto out;


course1-1: 12-seminar-datacenter: data_slist_sort: add solution.

error: pathspec 'course1-1/12-seminar-datacenter/data_slist_sort.c' did not match any file(s) known to git

--- course1-1/12-seminar-datacenter/data_slist_sort.c
+++ course1-1/12-seminar-datacenter/data_slist_sort.c
@@ -0,0 +1,39 @@
+#include <assert.h>
+#include <stdlib.h>
+
+void list_sort(struct Node **list)
+{
+    if (*list == NULL || (*list)->next == NULL) {
+	return;
+    }
+
+    struct Node *sorted_list = NULL;
+
+    while (*list != NULL) {
+	/* find maximal element in the remaining unsorted list */
+	struct Node **max = list;
+	for (struct Node ** cur = &(*list)->next; *cur != NULL;
+	     cur = &(*cur)->next) {
+	    if ((*cur)->val > (*max)->val) {
+		max = cur;
+	    }
+	}
+
+	/* move the found element into the beginning of the sorted list */
+	struct Node *tmp = *max;
+
+	/* remove from the old list... */
+	*max = tmp->next;
+	if ((sorted_list == NULL) || (tmp->val != sorted_list->val)) {
+	    /* ...insert into the new list */
+	    tmp->next = sorted_list;
+	    sorted_list = tmp;
+	} else {
+	    /* ...and remove the duplicate */
+	    free(tmp);
+	}
+    }
+
+    assert(*list == NULL);
+    *list = sorted_list;
+}


Cleaning up read_skip_coeff() function.

Cleaning up read_skip_coeff() function.

Making code easier to read and avoiding calculation of skip context twice.

Change-Id: I42c376b1a1811bc842bf6420bf81d2de7a1bf980

--- vp9/decoder/vp9_decodemv.c
+++ vp9/decoder/vp9_decodemv.c
@@ -149,16 +149,17 @@
   return segment_id;
 }

-static uint8_t read_skip_coeff(VP9_COMMON *const cm, MACROBLOCKD *const xd,
-                               int segment_id, vp9_reader *r) {
-  int skip_coeff = vp9_segfeature_active(&cm->seg, segment_id, SEG_LVL_SKIP);
-  if (!skip_coeff) {
+static int read_skip_coeff(VP9_COMMON *cm, const MACROBLOCKD *xd,
+                           int segment_id, vp9_reader *r) {
+  if (vp9_segfeature_active(&cm->seg, segment_id, SEG_LVL_SKIP)) {
+    return 1;
+  } else {
     const int ctx = vp9_get_pred_context_mbskip(xd);
-    skip_coeff = vp9_read(r, vp9_get_pred_prob_mbskip(cm, xd));
+    const int skip = vp9_read(r, cm->fc.mbskip_probs[ctx]);
     if (!cm->frame_parallel_decoding_mode)
-      ++cm->counts.mbskip[ctx][skip_coeff];
-  }
-  return skip_coeff;
+      ++cm->counts.mbskip[ctx][skip];
+    return skip;
+  }
 }

 static void read_intra_frame_mode_info(VP9_COMMON *const cm,


infinoted-plugin-document-stream: Don't join a user if username is empty

--- infinoted/plugins/infinoted-plugin-document-stream.c
+++ infinoted/plugins/infinoted-plugin-document-stream.c
@@ -584,7 +584,10 @@

   g_object_get(G_OBJECT(proxy), "session", &session, NULL);

-  if(INF_TEXT_IS_SESSION(session))
+  /* User join via document stream only works for chat sessions
+   * at the moment. */
+  if(stream->username == NULL || *stream->username == '\0' ||
+     INF_TEXT_IS_SESSION(session))
   {
     infinoted_plugin_document_stream_start(stream);
   }


No need to strdup here.

No need to strdup here.

--- unix_plugin.c
+++ unix_plugin.c
@@ -1,7 +1,6 @@
 #include <assert.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <string.h>
 #include <dlfcn.h>
 #include <err.h>

@@ -19,7 +18,7 @@
 		errx(EXIT_FAILURE, "unix_plugin usage!");
 	}
 	fname = argv[1];
-	dll = dlopen(strdup(fname), RTLD_NOW);
+	dll = dlopen(fname, RTLD_NOW);
 	if (dll == NULL) {
 		errx(EXIT_FAILURE, "dlopen()");
 	}


fix build on windows

fix build on windows

- partly revert f0243e70e05a3368582fd0478d840096d6b60c3f as it broke the build due to widgets accessible plugins using QDockWidgetLayout

Reviewed-by: Rhys Weatherley

--- src/gui/widgets/qdockwidget_p.h
+++ src/gui/widgets/qdockwidget_p.h
@@ -128,7 +128,7 @@
     bool isAnimating() const;
 };

-class QDockWidgetLayout : public QLayout
+class Q_GUI_EXPORT QDockWidgetLayout : public QLayout
 {
     Q_OBJECT
 public:


fixed exclusive

fixed exclusive

--- iotests/writeSpeedTest.c
+++ iotests/writeSpeedTest.c
@@ -30,6 +30,7 @@
   char *path;
   size_t total;
   size_t startPosition;
+  size_t exclusive;
   logSpeedType logSpeed;
 } threadInfoType;

@@ -39,7 +40,11 @@
 }
 static void *runThread(void *arg) {
   threadInfoType *threadContext = (threadInfoType*)arg; // grab the thread threadContext args
-  int fd = open(threadContext->path, O_WRONLY | O_TRUNC | O_EXCL | (useDirect ? O_DIRECT : 0));
+  int mode = O_WRONLY | O_TRUNC | (useDirect ? O_DIRECT : 0);
+  //  if (threadContext->exclusive) {
+    mode = mode | O_EXCL;
+    //  }
+  int fd = open(threadContext->path, mode);
   if (fd < 0) {
     perror(threadContext->path);
     return NULL;
@@ -72,12 +77,21 @@

     for (size_t i = 0; i < threads; i++) {
       if (argv[i + 1][0] != '-') {
+	threadContext[i].path = argv[i + 1];
 	threadContext[i].threadid = i;
+	threadContext[i].exclusive = 1;
+	// check previous to see if they are the same, if so make it non-exclusive
+	for (size_t j = 0; j <= i; j++) {
+	  if (strcmp(threadContext[i].path, argv[j]) == 0) {
+	    threadContext[i].exclusive = 0;
+	  }
+	}

+	//	fprintf(stderr,"path %s excl %zd\n", threadContext[i].path, threadContext[i].exclusive);
+
 	threadContext[i].startPosition = (1024L*1024*1024) * startP;
 	startP += offSetGB;

-	threadContext[i].path = argv[i + 1];
 	threadContext[i].total = 0;
 	logSpeedInit(&threadContext[i].logSpeed);
 	pthread_create(&(pt[i]), NULL, runThread, &(threadContext[i]));


Don't use tag info for connectors - an additional fix

--- link-grammar/dict-common/print-dict.c
+++ link-grammar/dict-common/print-dict.c
@@ -394,6 +394,8 @@
 static const char *stringify_Exp_tag(Exp *e, Dictionary dict)
 {
 	static TLS char tag_info[64];
+
+	if (e->type == CONNECTOR_type) return "";

 		switch (e->tag_type)
 		{


Added "student" data structure

Added "student" data structure

--- unlifriends.h
+++ unlifriends.h
@@ -5,10 +5,16 @@
 #include <stdlib.h>

 typedef struct nodetag node;
+typedef struct studenttag student;
+
 struct nodetag{
     node *prev, *next; //Pointers that points to the previous and the next nodes
     void *data; //Points to the data the the node is refering to. You'll have to typecast the data by using something like *(int*)node->data
 };
+
+struct studenttag{
+    char *name, *course, *snum;
+}

 void insert_head();
 void insert_tail();


remove unneccesary import

remove unneccesary import

--- source/gloperate-qtquick/include/gloperate-qtquick/QmlEngine.h
+++ source/gloperate-qtquick/include/gloperate-qtquick/QmlEngine.h
@@ -19,9 +19,6 @@
     class Environment;
 }

-namespace qmltoolbox {
-    class EnumImageProvider;
-}

 namespace gloperate_qtquick
 {
@@ -190,10 +187,10 @@

 protected:
-    gloperate::Environment *        m_environment;      ///< Gloperate environment (must NOT be null)
-    QJSValue                        m_global;           ///< Object 'global', can be used to store global values
-    QJSValue                        m_gloperate;        ///< Object 'gloperate', contains exposed API functions from gloperate
-    QString                         m_gloperateQmlPath; ///< Path to gloperate qml module
+    gloperate::Environment * m_environment;      ///< Gloperate environment (must NOT be null)
+    QJSValue                 m_global;           ///< Object 'global', can be used to store global values
+    QJSValue                 m_gloperate;        ///< Object 'gloperate', contains exposed API functions from gloperate
+    QString                  m_gloperateQmlPath; ///< Path to gloperate qml module
 };


execute finish in the finish phase not in the after_ra phase

[r15741]

--- ir/be/ia32/bearch_ia32.c
+++ ir/be/ia32/bearch_ia32.c
@@ -1301,8 +1301,6 @@
 	be_free_frame_entity_coalescer(fec_env);

 	irg_block_walk_graph(irg, NULL, ia32_after_ra_walker, cg);
-
-	ia32_finish_irg(irg, cg);
 }

 /**
@@ -1313,6 +1311,8 @@
 static void ia32_finish(void *self) {
 	ia32_code_gen_t *cg = self;
 	ir_graph        *irg = cg->irg;
+
+	ia32_finish_irg(irg, cg);

 	/* we might have to rewrite x87 virtual registers */
 	if (cg->do_x87_sim) {


rescan_partitions(): make device capacity errors non-fatal

Herton Krzesinski reports that the error-checking changes in
04ebd4aee52b06a2c38127d9208546e5b96f3a19 ("block/ioctl.c and
fs/partition/check.c: check value returned by add_partition") cause his
buggy USB camera to no longer mount.  "The camera is an Olympus X-840.
The original issue comes from the camera itself: its format program
creates a partition with an off by one error".

Buggy devices happen.  It is better for the kernel to warn and to proceed
with the mount.

Reported-by: Herton Ronaldo Krzesinski <521f5e275cfb2d7a088db6fd2470049d61870456@mandriva.com.br>
Cc: Abdel Benamrouche <bef49603545b672c85efd9c6f241557a8f68c146@gmail.com>
Cc: Jens Axboe <165ab144a3ccfd9429d5c6466b275f24fafdb114@oracle.com>
Cc: Alan Stern <75ea6bb7bfc1186f92d26164de5f9268c9a45b59@rowland.harvard.edu>
Cc: David Brownell <e543181633fc0fc2787945ef377537d9112d0c96@pacbell.net>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@linux-foundation.org>

--- fs/partitions/check.c
+++ fs/partitions/check.c
@@ -499,9 +499,9 @@
 		if (!size)
 			continue;
 		if (from + size > get_capacity(disk)) {
-			printk(KERN_ERR " %s: p%d exceeds device capacity\n",
+			printk(KERN_WARNING
+				"%s: p%d exceeds device capacity\n",
 				disk->disk_name, p);
-			continue;
 		}
 		res = add_partition(disk, p, from, size, state->parts[p].flags);
 		if (res) {


UBIFS: check buffer length when scanning for LPT nodes

'is_a_node()' function was reading from a buffer before
checking the buffer length, resulting in an OOPS as
follows:

BUG: unable to handle kernel paging request at f8f74002
IP: [<f8f9783f>] :ubifs:ubifs_unpack_bits+0xca/0x233
*pde = 19e95067 *pte = 00000000
Oops: 0000 [#1] PREEMPT SMP
Modules linked in: ubifs ubi mtdchar bio2mtd mtd brd video output
[last unloaded: mtd]

Pid: 6414, comm: integck Not tainted (2.6.27-rc6ubifs34 #23)
EIP: 0060:[<f8f9783f>] EFLAGS: 00010246 CPU: 0
EIP is at ubifs_unpack_bits+0xca/0x233 [ubifs]
EAX: 00000000 EBX: f6090630 ECX: d9badcfc EDX: 00000000
ESI: 00000004 EDI: f8f74002 EBP: d9badcec ESP: d9badcc0
 DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
Process integck (pid: 6414, ti=d9bac000 task=f727dae0 task.ti=d9bac000)
Stack: 00000006 f7306240 00000002 00000000 d9badcfc d9badd00 0000001c 00000000
       f6090630 f6090630 f8f74000 d9badd10 f8fa1cc9 00000000 f8f74002 00000000
       f8f74002 f60fe128 f6090630 f8f74000 d9badd68 f8fa1e46 00000000 0001e000
Call Trace:
 [<f8fa1cc9>] ? is_a_node+0x30/0x90 [ubifs]
 [<f8fa1e46>] ? dbg_check_ltab+0x11d/0x5bd [ubifs]
 [<f8fa388f>] ? ubifs_lpt_start_commit+0x42/0xed3 [ubifs]
 [<c038e76a>] ? mutex_unlock+0x8/0xa
 [<f8f9625d>] ? ubifs_tnc_start_commit+0x1c8/0xedb [ubifs]
 [<f8f8d90b>] ? do_commit+0x187/0x523 [ubifs]
 [<c038e76a>] ? mutex_unlock+0x8/0xa
 [<f8f7ca17>] ? bud_wbuf_callback+0x22/0x28 [ubifs]
 [<f8f8dd1d>] ? ubifs_run_commit+0x76/0xc0 [ubifs]
 [<f8f8032c>] ? ubifs_sync_fs+0xd2/0xe6 [ubifs]
 [<c01a2e97>] ? vfs_quota_sync+0x0/0x17e
 [<c01a5ba6>] ? quota_sync_sb+0x26/0xbb
 [<c01a2e97>] ? vfs_quota_sync+0x0/0x17e
 [<c01a5c5d>] ? sync_dquots+0x22/0x12c
 [<c0173d1b>] ? __fsync_super+0x19/0x68
 [<c0173d75>] ? fsync_super+0xb/0x19
 [<c0174065>] ? generic_shutdown_super+0x22/0xe7
 [<c01a31fc>] ? vfs_quota_off+0x0/0x5fd
 [<f8f7cf4d>] ? ubifs_kill_sb+0x31/0x35 [ubifs]
 [<c01741f9>] ? deactivate_super+0x5e/0x71
 [<c0187610>] ? mntput_no_expire+0x82/0xe4
 [<c0187905>] ? sys_umount+0x4c/0x2f6
 [<c0187bc8>] ? sys_oldumount+0x19/0x1b
 [<c0103b71>] ? sysenter_do_call+0x12/0x25
 =======================
Code: c1 f8 03 8d 04 07 8b 4d e8 89 01 8b 45 e4 89 10 89 d8 89 f1 d3 e8 85 c0
      74 07 29 d6 83 fe 20 75 2a 89 d8 83 c4 20 5b 5e 5f 5d
EIP: [<f8f9783f>] ubifs_unpack_bits+0xca/0x233 [ubifs] SS:ESP 0068:d9badcc0
---[ end trace 1f02572436518c13 ]---

Signed-off-by: Adrian Hunter <07e5499f8ca7b9f9593b4a7656ea8c5a05a8f7f6@nokia.com>

--- fs/ubifs/lpt_commit.c
+++ fs/ubifs/lpt_commit.c
@@ -1089,6 +1089,8 @@
 	int pos = 0, node_type, node_len;
 	uint16_t crc, calc_crc;

+	if (len < UBIFS_LPT_CRC_BYTES + (UBIFS_LPT_TYPE_BITS + 7) / 8)
+		return 0;
 	node_type = ubifs_unpack_bits(&addr, &pos, UBIFS_LPT_TYPE_BITS);
 	if (node_type == UBIFS_LPT_NOT_A_NODE)
 		return 0;


rsvg_lookup_parse_style_pair(): remove unused "ctx" argument

--- rsvg-styles.c
+++ rsvg-styles.c
@@ -925,7 +925,7 @@
 }

 static void
-rsvg_lookup_parse_style_pair (RsvgHandle * ctx, RsvgState * state,
+rsvg_lookup_parse_style_pair (RsvgState * state,
                               const char *key, RsvgPropertyBag * atts)
 {
     const char *value;
@@ -938,51 +938,51 @@
 void
 rsvg_parse_style_pairs (RsvgHandle * ctx, RsvgState * state, RsvgPropertyBag * atts)
 {
-    rsvg_lookup_parse_style_pair (ctx, state, "baseline-shift", atts);
-    rsvg_lookup_parse_style_pair (ctx, state, "clip-path", atts);
-    rsvg_lookup_parse_style_pair (ctx, state, "clip-rule", atts);
-    rsvg_lookup_parse_style_pair (ctx, state, "color", atts);
-    rsvg_lookup_parse_style_pair (ctx, state, "direction", atts);
-    rsvg_lookup_parse_style_pair (ctx, state, "display", atts);
-    rsvg_lookup_parse_style_pair (ctx, state, "enable-background", atts);
-    rsvg_lookup_parse_style_pair (ctx, state, "comp-op", atts);
-    rsvg_lookup_parse_style_pair (ctx, state, "fill", atts);
-    rsvg_lookup_parse_style_pair (ctx, state, "fill-opacity", atts);
-    rsvg_lookup_parse_style_pair (ctx, state, "fill-rule", atts);
-    rsvg_lookup_parse_style_pair (ctx, state, "filter", atts);
-    rsvg_lookup_parse_style_pair (ctx, state, "flood-color", atts);
-    rsvg_lookup_parse_style_pair (ctx, state, "flood-opacity", atts);
-    rsvg_lookup_parse_style_pair (ctx, state, "font-family", atts);
-    rsvg_lookup_parse_style_pair (ctx, state, "font-size", atts);
-    rsvg_lookup_parse_style_pair (ctx, state, "font-stretch", atts);
-    rsvg_lookup_parse_style_pair (ctx, state, "font-style", atts);
-    rsvg_lookup_parse_style_pair (ctx, state, "font-variant", atts);
-    rsvg_lookup_parse_style_pair (ctx, state, "font-weight", atts);
-    rsvg_lookup_parse_style_pair (ctx, state, "marker-end", atts);
-    rsvg_lookup_parse_style_pair (ctx, state, "mask", atts);
-    rsvg_lookup_parse_style_pair (ctx, state, "marker-mid", atts);
-    rsvg_lookup_parse_style_pair (ctx, state, "marker-start", atts);
-    rsvg_lookup_parse_style_pair (ctx, state, "opacity", atts);
-    rsvg_lookup_parse_style_pair (ctx, state, "overflow", atts);
-    rsvg_lookup_parse_style_pair (ctx, state, "shape-rendering", atts);
-    rsvg_lookup_parse_style_pair (ctx, state, "stop-color", atts);
-    rsvg_lookup_parse_style_pair (ctx, state, "stop-opacity", atts);
-    rsvg_lookup_parse_style_pair (ctx, state, "stroke", atts);
-    rsvg_lookup_parse_style_pair (ctx, state, "stroke-dasharray", atts);
-    rsvg_lookup_parse_style_pair (ctx, state, "stroke-dashoffset", atts);
-    rsvg_lookup_parse_style_pair (ctx, state, "stroke-linecap", atts);
-    rsvg_lookup_parse_style_pair (ctx, state, "stroke-linejoin", atts);
-    rsvg_lookup_parse_style_pair (ctx, state, "stroke-miterlimit", atts);
-    rsvg_lookup_parse_style_pair (ctx, state, "stroke-opacity", atts);
-    rsvg_lookup_parse_style_pair (ctx, state, "stroke-width", atts);
-    rsvg_lookup_parse_style_pair (ctx, state, "text-anchor", atts);
-    rsvg_lookup_parse_style_pair (ctx, state, "text-decoration", atts);
-    rsvg_lookup_parse_style_pair (ctx, state, "unicode-bidi", atts);
-    rsvg_lookup_parse_style_pair (ctx, state, "letter-spacing", atts);
-    rsvg_lookup_parse_style_pair (ctx, state, "visibility", atts);
-    rsvg_lookup_parse_style_pair (ctx, state, "writing-mode", atts);
-    rsvg_lookup_parse_style_pair (ctx, state, "xml:lang", atts);
-    rsvg_lookup_parse_style_pair (ctx, state, "xml:space", atts);
+    rsvg_lookup_parse_style_pair (state, "baseline-shift", atts);
+    rsvg_lookup_parse_style_pair (state, "clip-path", atts);
+    rsvg_lookup_parse_style_pair (state, "clip-rule", atts);
+    rsvg_lookup_parse_style_pair (state, "color", atts);
+    rsvg_lookup_parse_style_pair (state, "direction", atts);
+    rsvg_lookup_parse_style_pair (state, "display", atts);
+    rsvg_lookup_parse_style_pair (state, "enable-background", atts);
+    rsvg_lookup_parse_style_pair (state, "comp-op", atts);
+    rsvg_lookup_parse_style_pair (state, "fill", atts);
+    rsvg_lookup_parse_style_pair (state, "fill-opacity", atts);
+    rsvg_lookup_parse_style_pair (state, "fill-rule", atts);
+    rsvg_lookup_parse_style_pair (state, "filter", atts);
+    rsvg_lookup_parse_style_pair (state, "flood-color", atts);
+    rsvg_lookup_parse_style_pair (state, "flood-opacity", atts);
+    rsvg_lookup_parse_style_pair (state, "font-family", atts);
+    rsvg_lookup_parse_style_pair (state, "font-size", atts);
+    rsvg_lookup_parse_style_pair (state, "font-stretch", atts);
+    rsvg_lookup_parse_style_pair (state, "font-style", atts);
+    rsvg_lookup_parse_style_pair (state, "font-variant", atts);
+    rsvg_lookup_parse_style_pair (state, "font-weight", atts);
+    rsvg_lookup_parse_style_pair (state, "marker-end", atts);
+    rsvg_lookup_parse_style_pair (state, "mask", atts);
+    rsvg_lookup_parse_style_pair (state, "marker-mid", atts);
+    rsvg_lookup_parse_style_pair (state, "marker-start", atts);
+    rsvg_lookup_parse_style_pair (state, "opacity", atts);
+    rsvg_lookup_parse_style_pair (state, "overflow", atts);
+    rsvg_lookup_parse_style_pair (state, "shape-rendering", atts);
+    rsvg_lookup_parse_style_pair (state, "stop-color", atts);
+    rsvg_lookup_parse_style_pair (state, "stop-opacity", atts);
+    rsvg_lookup_parse_style_pair (state, "stroke", atts);
+    rsvg_lookup_parse_style_pair (state, "stroke-dasharray", atts);
+    rsvg_lookup_parse_style_pair (state, "stroke-dashoffset", atts);
+    rsvg_lookup_parse_style_pair (state, "stroke-linecap", atts);
+    rsvg_lookup_parse_style_pair (state, "stroke-linejoin", atts);
+    rsvg_lookup_parse_style_pair (state, "stroke-miterlimit", atts);
+    rsvg_lookup_parse_style_pair (state, "stroke-opacity", atts);
+    rsvg_lookup_parse_style_pair (state, "stroke-width", atts);
+    rsvg_lookup_parse_style_pair (state, "text-anchor", atts);
+    rsvg_lookup_parse_style_pair (state, "text-decoration", atts);
+    rsvg_lookup_parse_style_pair (state, "unicode-bidi", atts);
+    rsvg_lookup_parse_style_pair (state, "letter-spacing", atts);
+    rsvg_lookup_parse_style_pair (state, "visibility", atts);
+    rsvg_lookup_parse_style_pair (state, "writing-mode", atts);
+    rsvg_lookup_parse_style_pair (state, "xml:lang", atts);
+    rsvg_lookup_parse_style_pair (state, "xml:space", atts);

     {
         /* TODO: this conditional behavior isn't quite correct, and i'm not sure it should reside here */


rsvg_parse_style_attrs(): Use iteration instead of rsvg_property_bag_enumerate()

--- rsvg-styles.c
+++ rsvg-styles.c
@@ -1535,40 +1535,6 @@
     return FALSE;
 }

-struct parse_style_and_transform_closure {
-    RsvgState *state;
-    RsvgNode *node;
-};
-
-static void
-parse_style_and_transform (const char *key, const char *value, gpointer data)
-{
-    RsvgAttribute attr;
-    RsvgNode *node = data;
-    RsvgState *state = rsvg_node_get_state (node);
-
-    if (!rsvg_attribute_from_name (key, &attr)) {
-        return;
-    }
-
-    switch (attr) {
-    case RSVG_ATTRIBUTE_STYLE:
-        rsvg_parse_style (state, value);
-        break;
-
-    case RSVG_ATTRIBUTE_TRANSFORM:
-        if (!rsvg_parse_transform_attr (state, value)) {
-            rsvg_node_set_attribute_parse_error (node,
-                                                 "transform",
-                                                 "Invalid transformation");
-        }
-        break;
-
-    default:
-        break;
-    }
-}
-
 /**
  * rsvg_parse_style_attrs:
  * @handle: Rsvg handle.
@@ -1590,6 +1556,9 @@
     gboolean found = FALSE;
     GString *klazz_list = NULL;
     RsvgState *state;
+    RsvgPropertyBagIter *iter;
+    const char *key;
+    const char *value;

     state = rsvg_node_get_state (node);

@@ -1670,9 +1639,34 @@
         g_free (target);
     }

-    rsvg_property_bag_enumerate (atts,
-                                 parse_style_and_transform,
-                                 node);
+    iter = rsvg_property_bag_iter_begin (atts);
+
+    while (rsvg_property_bag_iter_next (iter, &key, &value)) {
+        RsvgAttribute attr;
+
+        if (!rsvg_attribute_from_name (key, &attr)) {
+            continue;
+        }
+
+        switch (attr) {
+        case RSVG_ATTRIBUTE_STYLE:
+            rsvg_parse_style (state, value);
+            break;
+
+        case RSVG_ATTRIBUTE_TRANSFORM:
+            if (!rsvg_parse_transform_attr (state, value)) {
+                rsvg_node_set_attribute_parse_error (node,
+                                                     "transform",
+                                                     "Invalid transformation");
+            }
+            break;
+
+        default:
+            break;
+        }
+    }
+
+    rsvg_property_bag_iter_end (iter);
 }

 RsvgState *


always attempt to insert a HNA Net when receiving a HNA refresh. It could be that the TC entry may have disappeared underneath us. miscellaneous cosmetic changes.

--- src/hna_set.c
+++ src/hna_set.c
@@ -79,25 +79,27 @@
 }

 /**
- *Lookup a network entry in a networkentry list
- *
- *@param nets the network list to look in
- *@param net the network to look for
- *@param mask the netmask to look for
- *
- *@return the localted entry or NULL of not found
+ * Lookup a network entry in a networkentry list.
+ *
+ * @param nets the network list to look in
+ * @param net the network to look for
+ * @param mask the netmask to look for
+ *
+ * @return the localized entry or NULL of not found
  */
 struct hna_net *
 olsr_lookup_hna_net(const struct hna_net *nets, const union olsr_ip_addr *net,
                     olsr_u8_t prefixlen)
 {
   struct hna_net *tmp;
+
   /* Loop trough entrys */
   for (tmp = nets->next; tmp != nets; tmp = tmp->next) {
     if (tmp->prefixlen == prefixlen && ipequal(&tmp->A_network_addr, net)) {
       return tmp;
     }
   }
+
   /* Not found */
   return NULL;
 }
@@ -165,23 +167,20 @@
   new_entry->prev = &hna_set[hash];

   return new_entry;
-
-}
-
-
-
-/**
- *Adds a ntework entry to a HNA gateway
- *
- *@param hna_gw the gateway entry to add the
- *network to
- *@param net the networkaddress to add
- *@param mask the netmask
- *
- *@return the newly created entry
+}
+
+/**
+ * Adds a network entry to a HNA gateway.
+ *
+ * @param hna_gw the gateway entry to add the network to
+ * @param net the networkaddress to add
+ * @param mask the netmask
+ *
+ * @return the newly created entry
  */
 struct hna_net *
-olsr_add_hna_net(struct hna_entry *hna_gw, const union olsr_ip_addr *net, olsr_u8_t prefixlen)
+olsr_add_hna_net(struct hna_entry *hna_gw, const union olsr_ip_addr *net,
+                 olsr_u8_t prefixlen)
 {
   /* Add the net */
   struct hna_net *new_net = olsr_cookie_malloc(hna_net_mem_cookie);
@@ -200,14 +199,6 @@
   hna_gw->networks.next = new_net;
   new_net->prev = &hna_gw->networks;

-  /*
-   * Add the rt_path for the entry.
-   */
-  olsr_insert_routing_table(&new_net->A_network_addr,
-                            new_net->prefixlen,
-                            &hna_gw->A_gateway_addr,
-                            OLSR_RT_ORIGIN_HNA);
-
   return new_net;
 }

@@ -286,6 +277,17 @@
     changes_hna = OLSR_TRUE;
   }

+  /*
+   * Add the rt_path for the entry.
+   */
+  olsr_insert_routing_table(&net_entry->A_network_addr,
+                            net_entry->prefixlen,
+                            &gw_entry->A_gateway_addr,
+                            OLSR_RT_ORIGIN_HNA);
+
+  /*
+   * Start, or refresh the timer, whatever is appropriate.
+   */
   olsr_set_timer(&net_entry->hna_net_timer, vtime,
                  OLSR_HNA_NET_JITTER, OLSR_TIMER_ONESHOT,
                  &olsr_expire_hna_net_entry, net_entry,


qemu: migration: Refactor cleanup in qemuMigrationSrcNBDStorageCopy

Use VIR_AUTOUNREF and remove the cleanup label.

Signed-off-by: Peter Krempa <2cf5c04c61aa466e4a47bfedc747d17279c72ffc@redhat.com>
Reviewed-by: Eric Blake <a9da18479c871fe903d9590822cfe2629c6a4d11@redhat.com>

--- src/qemu/qemu_migration.c
+++ src/qemu/qemu_migration.c
@@ -983,13 +983,12 @@
                                unsigned int flags)
 {
     qemuDomainObjPrivatePtr priv = vm->privateData;
-    int ret = -1;
     int port;
     size_t i;
     unsigned long long mirror_speed = speed;
     bool mirror_shallow = *migrate_flags & QEMU_MONITOR_MIGRATE_NON_SHARED_INC;
     int rv;
-    virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
+    VIR_AUTOUNREF(virQEMUDriverConfigPtr) cfg = virQEMUDriverGetConfig(driver);

     VIR_DEBUG("Starting drive mirrors for domain %s", vm->def->name);

@@ -997,7 +996,7 @@
         virReportError(VIR_ERR_OVERFLOW,
                        _("bandwidth must be less than %llu"),
                        LLONG_MAX >> 20);
-        goto cleanup;
+        return -1;
     }
     mirror_speed <<= 20;

@@ -1015,34 +1014,34 @@
         if (qemuMigrationSrcNBDStorageCopyOne(driver, vm, disk, host, port,
                                               mirror_speed, mirror_shallow,
                                               tlsAlias, flags) < 0)
-            goto cleanup;
+            return -1;

         if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0) {
             VIR_WARN("Failed to save status on vm %s", vm->def->name);
-            goto cleanup;
+            return -1;
         }
     }

     while ((rv = qemuMigrationSrcNBDStorageCopyReady(vm, QEMU_ASYNC_JOB_MIGRATION_OUT)) != 1) {
         if (rv < 0)
-            goto cleanup;
+            return -1;

         if (priv->job.abortJob) {
             priv->job.current->status = QEMU_DOMAIN_JOB_STATUS_CANCELED;
             virReportError(VIR_ERR_OPERATION_ABORTED, _("%s: %s"),
                            qemuDomainAsyncJobTypeToString(priv->job.asyncJob),
                            _("canceled by client"));
-            goto cleanup;
+            return -1;
         }

         if (dconn && virConnectIsAlive(dconn) <= 0) {
             virReportError(VIR_ERR_OPERATION_FAILED, "%s",
                            _("Lost connection to destination host"));
-            goto cleanup;
+            return -1;
         }

         if (virDomainObjWait(vm) < 0)
-            goto cleanup;
+            return -1;
     }

     qemuMigrationSrcFetchMirrorStats(driver, vm, QEMU_ASYNC_JOB_MIGRATION_OUT,
@@ -1051,11 +1050,8 @@
     /* Okay, all disks are ready. Modify migrate_flags */
     *migrate_flags &= ~(QEMU_MONITOR_MIGRATE_NON_SHARED_DISK |
                         QEMU_MONITOR_MIGRATE_NON_SHARED_INC);
-    ret = 0;
-
- cleanup:
-    virObjectUnref(cfg);
-    return ret;
+
+    return 0;
 }


fix an assertion failure in prof/threaded/debug mode

--- rts/sm/Evac.c
+++ rts/sm/Evac.c
@@ -943,7 +943,11 @@
               // the original selector thunk, p.
               SET_INFO(p, (StgInfoTable *)info_ptr);
               LDV_RECORD_DEAD_FILL_SLOP_DYNAMIC((StgClosure *)p);
+#if defined(THREADED_RTS)
+              SET_INFO(p, &stg_WHITEHOLE_info);
+#else
               SET_INFO(p, &stg_BLACKHOLE_info);
+#endif
 #endif

               // the closure in val is now the "value" of the


OnlineExperiment: fix documentation typo

--- cpp/src/main/online_experiment/OnlineExperiment.h
+++ cpp/src/main/online_experiment/OnlineExperiment.h
@@ -31,7 +31,7 @@

   * calls loggers that are set using :py:meth:`add_logger`,
   * updates the environment and common statistics, see :py:class:`alpenglow.cpp.ExperimentEnvironment`,
-  * calls the updaters that are set using :py:math:`add_updater`.
+  * calls the updaters that are set using :py:meth:`add_updater`.

   At the end of the experiment, it calls end loggers that are set using :py:meth:`add_end_logger`.

@@ -108,9 +108,9 @@
     /**
       Runs the experiment.
     */
-    void inject_experiment_environment_into(NeedsExperimentEnvironment *object);
+    void inject_experiment_environment_into(NeedsExperimentEnvironment* object);
     /**
-      inject_experiment_environment_into(NeedsExperimentEnvironment *object)
+      inject_experiment_environment_into(NeedsExperimentEnvironment* object)
       Sets the experiment environment into another object that requires it.

       In the online experiment, this method is automatically called with all the


android/bluetooth: Add support for restoring devices from storage

This adds support to restore bonded devices from storage (including
linkkeys).

--- android/bluetooth.c
+++ android/bluetooth.c
@@ -1573,6 +1573,117 @@
 					sizeof(cp), &cp, NULL, NULL, NULL);
 }

+static void create_device_from_info(GKeyFile *key_file, const char *peer)
+{
+	struct device *dev;
+	uint8_t type;
+	bdaddr_t bdaddr;
+	char **uuids;
+	char *str;
+
+	DBG("%s", peer);
+
+	type = g_key_file_get_integer(key_file, peer, "Type", NULL);
+
+	str2ba(peer, &bdaddr);
+	dev = create_device(&bdaddr, type);
+
+	dev->bond_state = HAL_BOND_STATE_BONDED;
+
+	str = g_key_file_get_string(key_file, peer, "Name", NULL);
+	if (str) {
+		g_free(dev->name);
+		dev->name = str;
+	}
+
+	str = g_key_file_get_string(key_file, peer, "FriendlyName", NULL);
+	if (str) {
+		g_free(dev->friendly_name);
+		dev->friendly_name = str;
+	}
+
+	dev->class = g_key_file_get_integer(key_file, peer, "Class", NULL);
+
+	uuids = g_key_file_get_string_list(key_file, peer, "Services", NULL,
+									NULL);
+	if (uuids) {
+		char **uuid;
+
+		for (uuid = uuids; *uuid; uuid++) {
+			uint8_t *u = g_malloc0(16);
+			int i;
+
+			for (i = 0; i < 16; i++)
+				sscanf((*uuid) + (i * 2), "%02hhX", &u[i]);
+
+			dev->uuids = g_slist_append(dev->uuids, u);
+		}
+
+		g_strfreev(uuids);
+	}
+}
+
+static struct mgmt_link_key_info *get_key_info(GKeyFile *key_file, const char *peer)
+{
+	struct mgmt_link_key_info *info = NULL;
+	char *str;
+	unsigned int i;
+
+	str = g_key_file_get_string(key_file, peer, "LinkKey", NULL);
+	if (!str || strlen(str) != 32)
+		goto failed;
+
+	info = g_new0(struct mgmt_link_key_info, 1);
+
+	str2ba(peer, &info->addr.bdaddr);
+
+	info->addr.type = g_key_file_get_integer(key_file, peer, "Type", NULL);
+
+	for (i = 0; i < sizeof(info->val); i++)
+		sscanf(str + (i * 2), "%02hhX", &info->val[i]);
+
+	info->type = g_key_file_get_integer(key_file, peer, "LinkKeyType",
+									NULL);
+	info->pin_len = g_key_file_get_integer(key_file, peer,
+						"LinkKeyPINLength", NULL);
+
+failed:
+	g_free(str);
+
+	return info;
+}
+
+static void load_devices_info(bt_bluetooth_ready cb)
+{
+	GKeyFile *key_file;
+	gchar **devs;
+	gsize len = 0;
+	unsigned int i;
+	GSList *keys = NULL;
+
+	key_file = g_key_file_new();
+
+	g_key_file_load_from_file(key_file, ANDROID_STORAGEDIR"/devices", 0,
+									NULL);
+
+	devs = g_key_file_get_groups(key_file, &len);
+
+	for (i = 0; i < len; i++) {
+		struct mgmt_link_key_info *key_info;
+
+		create_device_from_info(key_file, devs[i]);
+
+		key_info = get_key_info(key_file, devs[i]);
+		if (key_info)
+			keys = g_slist_prepend(keys, key_info);
+
+		/* TODO ltk */
+	}
+
+	load_link_keys(keys, cb);
+	g_slist_free_full(keys, g_free);
+}
+
 static void read_info_complete(uint8_t status, uint16_t length,
 					const void *param, void *user_data)
 {
@@ -1627,7 +1738,7 @@

 	clear_uuids();

-	load_link_keys(NULL, cb);
+	load_devices_info(cb);

 	set_io_capability();
 	set_device_id();


qemu: migration: Use TLS environment for NBD server if requested

Use the TLS env for migration when starting the NBD server if TLS is
enabled for migration.

Signed-off-by: Peter Krempa <2cf5c04c61aa466e4a47bfedc747d17279c72ffc@redhat.com>
Reviewed-by: Daniel P. Berrangé <bb938cf255e055ff3507f2627d214e8e62118fcf@redhat.com>

--- src/qemu/qemu_migration.c
+++ src/qemu/qemu_migration.c
@@ -369,7 +369,8 @@
                                const char *listenAddr,
                                size_t nmigrate_disks,
                                const char **migrate_disks,
-                               int nbdPort)
+                               int nbdPort,
+                               const char *tls_alias)
 {
     int ret = -1;
     qemuDomainObjPrivatePtr priv = vm->privateData;
@@ -411,7 +412,7 @@
             else if (virPortAllocatorAcquire(driver->migrationPorts, &port) < 0)
                 goto exit_monitor;

-            if (qemuMonitorNBDServerStart(priv->mon, listenAddr, port, NULL) < 0)
+            if (qemuMonitorNBDServerStart(priv->mon, listenAddr, port, tls_alias) < 0)
                 goto exit_monitor;
         }

@@ -2401,9 +2402,21 @@
     if (mig->nbd &&
         flags & (VIR_MIGRATE_NON_SHARED_DISK | VIR_MIGRATE_NON_SHARED_INC) &&
         virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_NBD_SERVER)) {
+        const char *nbdTLSAlias = NULL;
+
+        if (flags & VIR_MIGRATE_TLS) {
+            if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_NBD_TLS)) {
+                virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
+                               _("QEMU NBD server does not support TLS transport"));
+                goto stopjob;
+            }
+
+            nbdTLSAlias = tlsAlias;
+        }
+
         if (qemuMigrationDstStartNBDServer(driver, vm, incoming->address,
                                            nmigrate_disks, migrate_disks,
-                                           nbdPort) < 0) {
+                                           nbdPort, nbdTLSAlias) < 0) {
             goto stopjob;
         }
         cookieFlags |= QEMU_MIGRATION_COOKIE_NBD;


use srandom instead of srand (obsolete)

use srandom instead of srand (obsolete)

git-svn-id: 99defa4ab755b500623e6eb3409f44908c976a41@333 808b68a2-07de-11de-a1f0-819f45317607

--- monitor.c
+++ monitor.c
@@ -230,7 +230,7 @@
   /*
    * Initialize the random number generator
    */
-  srand(time(NULL) + getpid());
+  srandom(time(NULL) + getpid());

   /*
    * Initialize the Runtime mutex. This mutex


android/hal-audio: Make code readable

android/hal-audio: Make code readable

--- android/hal-audio.c
+++ android/hal-audio.c
@@ -1876,12 +1876,12 @@

 struct audio_module HAL_MODULE_INFO_SYM = {
 	.common = {
-	.tag = HARDWARE_MODULE_TAG,
-	.version_major = 1,
-	.version_minor = 0,
-	.id = AUDIO_HARDWARE_MODULE_ID,
-	.name = "A2DP Bluez HW HAL",
-	.author = "Intel Corporation",
-	.methods = &hal_module_methods,
+		.tag = HARDWARE_MODULE_TAG,
+		.version_major = 1,
+		.version_minor = 0,
+		.id = AUDIO_HARDWARE_MODULE_ID,
+		.name = "A2DP Bluez HW HAL",
+		.author = "Intel Corporation",
+		.methods = &hal_module_methods,
 	},
 };


update parser, much better now

update parser, much better now

--- src/ignotum.c
+++ src/ignotum.c
@@ -27,6 +27,18 @@
 #define check_hex_digit(c) ((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F'))
 #define ignotum_free(x) __safefree((void **)&(x))

+enum {
+	ignp_addr_start,
+	ignp_addr_end,
+	ignp_flags,
+	ignp_offset,
+	ignp_dev,
+	ignp_ino,
+	ignp_skip,
+	ignp_pathname,
+	ignp_end,
+};
+
 typedef struct ignotum_string {
 	char *ptr;
 	size_t len;
@@ -269,9 +281,147 @@
 		return c-'a'+10;
 }

+static void parser(struct ignotum_map_info *out, const char *buf, int *i, int limit,
+	int *flag, int *aux_len){
+	int aux = *i;
+	size_t len, tmp;
+	char c;
+
+	while(aux<limit && *flag != ignp_end){
+		switch(*flag){
+			case ignp_addr_start:
+				while(aux<limit){
+					c = buf[aux++];
+
+					if(c == '-'){
+						*flag = ignp_addr_end;
+						break;
+					}
+
+					out->start_addr <<= 4;
+					out->start_addr |= hexchar(c);
+				}
+			break;
+
+			case ignp_addr_end:
+				while(aux<limit){
+					c = buf[aux++];
+
+					if(c == ' '){
+						*flag = ignp_flags;
+						break;
+					}
+					out->end_addr <<= 4;
+					out->end_addr |= hexchar(c);
+				}
+			break;
+
+			case ignp_flags:
+				while(aux<limit){
+					c = buf[aux++];
+					if(c == ' '){
+						*flag = ignp_offset;
+						break;
+					}
+
+					out->perms <<= 1;
+					if(c != '-' && c != 's'){
+						out->perms |= 1;
+					}
+				}
+			break;
+
+			case ignp_offset:
+				while(aux<limit){
+					c = buf[aux++];
+
+					if(c == ' '){
+						*flag = ignp_dev;
+						break;
+					}
+
+					out->offset <<= 4;
+					out->offset |= hexchar(c);
+				}
+			break;
+
+			case ignp_dev:
+				while(aux<limit){
+					c = buf[aux++];
+
+					if(c == ' '){
+						*flag = ignp_ino;
+						break;
+					}
+
+					if(c == ':'){
+						continue;
+					}
+
+					out->st_dev <<= 4;
+					out->st_dev += hexchar(c);
+				}
+			break;
+
+			case ignp_ino:
+				while(aux<limit){
+					c = buf[aux++];
+
+					if(c == ' '){
+						*flag = ignp_skip;
+						break;
+					}
+
+					out->st_ino *= 10;
+					out->st_ino += c-'0';
+				}
+			break;
+
+			case ignp_skip:
+				while(aux<limit){
+					c = buf[aux++];
+					if(c == ' '){
+						continue;
+					} else if(c == '\n'){
+						*flag = ignp_end;
+					} else {
+						*flag = ignp_pathname;
+						aux--;
+					}
+					break;
+				}
+			break;
+
+			case ignp_pathname:
+				tmp = aux;
+
+				while(aux<limit){
+					c = buf[aux++];
+					if(c == '\n'){
+						*flag = ignp_end;
+						break;
+					}
+				}
+
+				len = aux-tmp;
+				if(*flag == ignp_end)
+					len--;
+
+				out->pathname = realloc(out->pathname, *aux_len+len+1);
+				memcpy(&(out->pathname[*aux_len]), &buf[tmp], len);
+				out->pathname[*aux_len+len] = 0x0;
+
+				*aux_len += len;
+			break;
+		}
+	}
+
+	*i = aux;
+}
+
 ssize_t ignotum_get_map_list(pid_t target_pid, ignotum_map_list_t **out){
-	int parser_flags = ignotum_first_addr, v = 0, end = 0, maps_fd;
-	ssize_t size, i = 0, j;
+	int maps_fd, flag, i, size, aux_len;
+	ignotum_map_info_t *info;
 	char buf[1024];

 	ssize_t ret = -1;
@@ -285,145 +435,30 @@
 		goto end;
 	}

-	ignotum_map_info_t tmp, *aux;
-	ignotum_string_t aux_string;
-
-	memset(&tmp, 0, sizeof(tmp));
-	memset(&aux_string, 0, sizeof(aux_string));
-
-	while( (size = read(maps_fd, buf, sizeof(buf))) > 0 ){
-		for(i=0; i<size; i++){
-			char c = buf[i];
-
-			switch(parser_flags){
-				case ignotum_first_addr:
-					if(c != '-'){
-						tmp.start_addr <<= 4;
-						tmp.start_addr += hexchar(c);
-					} else {
-						parser_flags = ignotum_second_addr;
-					}
-				break;
-
-				case ignotum_second_addr:
-					if(c != ' '){
-						tmp.end_addr <<= 4;
-						tmp.end_addr += hexchar(c);
-					} else {
-						parser_flags = ignotum_flags;
-					}
-				break;
-
-				case ignotum_flags:
-					if(c == '-')
-						v = 0;
-					else if(c == 'r')
-						v = ignotum_read;
-					else if(c == 'x')
-						v = ignotum_exec;
-					else if(c == 'w')
-						v = ignotum_write;
-					else if(c == 'p')
-						v = ignotum_private;
-					else if(c == 's')
-						v = ignotum_shared;
-					else if(c == ' '){
-						parser_flags = ignotum_offset;
-						break;
-					}
-
-					tmp.perms |= v;
-				break;
-
-				case ignotum_offset:
-					if(c != ' '){
-						tmp.offset <<= 4;
-						tmp.offset += hexchar(c);
-					} else {
-						parser_flags = ignotum_dev;
-					}
-				break;
-
-				case ignotum_dev:
-					if(c == ':'){
-						break;
-					}
-
-					else if(c == ' '){
-						parser_flags = ignotum_inode;
-					}
-
-					else {
-						tmp.st_dev <<= 4;
-						tmp.st_dev += hexchar(c);
-					}
-				break;
-
-				case ignotum_inode:
-					if(c != ' '){
-						tmp.st_ino *= 10;
-						tmp.st_ino += c-'0';
-					} else {
-						parser_flags = ignotum_skip_space;
-					}
-				break;
-
-				case ignotum_skip_space:
-					for(; i<size; i++){
-						if(buf[i] == '\n'){
-							aux = malloc(sizeof(ignotum_map_info_t));
-							memcpy(aux, &tmp, sizeof(ignotum_map_info_t));
-
-							*out = malloc(sizeof(ignotum_map_list_t));
-							(*out)->map = aux;
-							(*out)->next = NULL;
-							out = &((*out)->next);
-
-							parser_flags = ignotum_first_addr;
-							memset(&tmp, 0, sizeof(ignotum_map_info_t));
-							ret++;
-							break;
-						} else if(buf[i] != ' '){
-							i--;
-							parser_flags = ignotum_pathname;
-							break;
-						}
-					}
-				break;
-
-				case ignotum_pathname:
-					for(j=i; i<size; i++){
-						if(buf[i] == '\n'){
-							end = 1;
-							break;
-						}
-					}
-
-					ignotum_string_copy(&aux_string, &(buf[j]), i-j);
-
-					if(end){
-						aux = malloc(sizeof(ignotum_map_info_t));
-						tmp.pathname = aux_string.ptr;
-
-						memcpy(aux, &tmp, sizeof(ignotum_map_info_t));
-
-						*out = malloc(sizeof(ignotum_map_list_t));
-						(*out)->map = aux;
-						(*out)->next = NULL;
-						out = &((*out)->next);
-
-						parser_flags = ignotum_first_addr;
-						memset(&tmp, 0, sizeof(tmp));
-						memset(&aux_string, 0, sizeof(aux_string));
-						end = 0;
-						ret++;
-					}
-
-				break;
+	info = calloc(1, sizeof(ignotum_map_info_t));
+	flag = ignp_addr_start;
+	aux_len = 0;
+	ret = 0;
+
+	while((size = read(maps_fd, buf, sizeof(buf))) > 0 ){
+		for(i=0; i<size;){
+			parser(info, buf, &i, size, &flag, &aux_len);
+			if(flag == ignp_end){
+				*out = malloc(sizeof(ignotum_map_list_t));
+				(*out)->map = info;
+				(*out)->next = NULL;
+				out = &((*out)->next);
+
+				info = calloc(1, sizeof(ignotum_map_info_t));
+				flag = ignp_addr_start;
+				aux_len = 0;
+				ret++;
 			}
 		}
 	}

+	free(info);
+
 	close(maps_fd);

 	end:
@@ -431,9 +466,8 @@
 }

 ignotum_map_info_t *ignotum_getmapbyaddr(pid_t pid, off_t addr){
-	ignotum_map_info_t *ret = NULL;
-	int parser_flags = ignotum_first_addr;
-	int maps_fd, size, i, j, v = 0, end = 0;
+	int maps_fd, flag, i, size, aux_len;
+	ignotum_map_info_t *tmp, *ret = NULL;
 	char buf[1024];

 	if(pid)
@@ -446,145 +480,26 @@
 	}

-	ignotum_map_info_t tmp;
-	ignotum_string_t aux_string;
-
-	memset(&tmp, 0, sizeof(tmp));
-	memset(&aux_string, 0, sizeof(aux_string));
-
-	while( (size = read(maps_fd, buf, sizeof(buf))) > 0 ){
-		for(i=0; i<size; i++){
-			char c = buf[i];
-
-			switch(parser_flags){
-				case ignotum_first_addr:
-					if(c != '-'){
-						tmp.start_addr <<= 4;
-						tmp.start_addr += hexchar(c);
-					} else {
-						//printf("primeiro addr acabou ... %lx <= %lx ? %d\n", tmp.range.start_addr, addr, (tmp.range.start_addr <= addr));
-						//getchar();
-						if(tmp.start_addr <= addr){
-							parser_flags = ignotum_second_addr;
-						} else {
-							tmp.start_addr = 0;
-							parser_flags = ignotum_skip_line;
-						}
-					}
-				break;
-
-				case ignotum_second_addr:
-					if(c != ' '){
-						tmp.end_addr <<= 4;
-						tmp.end_addr += hexchar(c);
-					} else {
-						if(addr <= tmp.end_addr){
-							parser_flags = ignotum_flags;
-						} else {
-							tmp.start_addr = 0;
-							tmp.end_addr = 0;
-							parser_flags = ignotum_skip_line;
-						}
-					}
-				break;
-
-				case ignotum_flags:
-					if(c == '-')
-						v = 0;
-					else if(c == 'r')
-						v = ignotum_read;
-					else if(c == 'x')
-						v = ignotum_exec;
-					else if(c == 'w')
-						v = ignotum_write;
-					else if(c == 'p')
-						v = ignotum_private;
-					else if(c == 's')
-						v = ignotum_shared;
-					else if(c == ' '){
-						parser_flags = ignotum_offset;
-						break;
-					}
-
-					tmp.perms |= v;
-				break;
-
-				case ignotum_offset:
-					if(c != ' '){
-						tmp.offset <<= 4;
-						tmp.offset += hexchar(c);
-					} else {
-						parser_flags = ignotum_dev;
-					}
-				break;
-
-				case ignotum_dev:
-					if(c == ':'){
-						break;
-					}
-
-					else if(c == ' '){
-						parser_flags = ignotum_inode;
-					}
-
-					else {
-						tmp.st_dev <<= 4;
-						tmp.st_dev += hexchar(c);
-					}
-				break;
-
-				case ignotum_inode:
-					if(c != ' '){
-						tmp.st_ino *= 10;
-						tmp.st_ino += c-'0';
-					} else {
-						parser_flags = ignotum_skip_space;
-					}
-				break;
-
-				case ignotum_skip_space:
-					for(; i<size; i++){
-						if(buf[i] == '\n'){
-							ret = malloc(sizeof(ignotum_map_info_t));
-							memcpy(ret, &tmp, sizeof(ignotum_map_info_t));
-							goto end;
-
-						} else if(buf[i] != ' '){
-							i--;
-							parser_flags = ignotum_pathname;
-							break;
-						}
-					}
-				break;
-
-				case ignotum_pathname:
-					for(j=i; i<size; i++){
-						if(buf[i] == '\n'){
-							end = 1;
-							break;
-						}
-					}
-
-					ignotum_string_copy(&aux_string, &(buf[j]), i-j);
-
-					if(end){
-						ret = malloc(sizeof(ignotum_map_info_t));
-						memcpy(ret, &tmp, sizeof(ignotum_map_info_t));
-						ret->pathname = aux_string.ptr;
-						goto end;
-					}
-
-				break;
-
-				case ignotum_skip_line:
-					if(c == '\n'){
-						parser_flags = ignotum_first_addr;
-					}
-				break;
+	tmp = calloc(1, sizeof(ignotum_map_info_t));
+	flag = ignp_addr_start;
+	aux_len = 0;
+
+	while((size = read(maps_fd, buf, sizeof(buf))) > 0){
+		for(i=0; i<size;){
+			parser(tmp, buf, &i, size, &flag, &aux_len);
+			if(flag == ignp_end){
+				if(tmp->start_addr <= addr && addr <= tmp->end_addr){
+					ret = tmp;
+					goto end;
+				}
+
+				memset(tmp, 0x0, sizeof(ignotum_map_info_t));
+				flag = ignp_addr_start;
+				aux_len = 0;
+
 			}
 		}
 	}
-

 	end:


add comments to LiteralTest

add comments to LiteralTest

--- src/hext/pattern/literal-test.h
+++ src/hext/pattern/literal-test.h
@@ -10,10 +10,13 @@
 namespace hext {

+/// A LiteralTest is a ValueTest that checks whether another string equals a
+/// given string completely.
 class LiteralTest : public ValueTest
 {
 public:
   explicit LiteralTest(std::string literal);
+  /// Return true if subject equals literal.
   bool test(const char * subject) const final;
   void print(std::ostream& out = std::cout) const final;


qemu: Allow migration with disk cache on

When QEMU supports flushing caches at the end of migration, we can
safely allow migration even if disk/driver/@cache is not none nor
directsync.

Signed-off-by: Jiri Denemark <62bdf77dc47919a4d59a91822129d14633cfca81@redhat.com>
Acked-By: Peter Krempa <2cf5c04c61aa466e4a47bfedc747d17279c72ffc@redhat.com>

--- src/qemu/qemu_migration.c
+++ src/qemu/qemu_migration.c
@@ -1214,6 +1214,7 @@

 static bool
 qemuMigrationSrcIsSafe(virDomainDefPtr def,
+                       virQEMUCapsPtr qemuCaps,
                        size_t nmigrate_disks,
                        const char **migrate_disks,
                        unsigned int flags)
@@ -1263,6 +1264,11 @@
             disk->cachemode == VIR_DOMAIN_DISK_CACHE_DISABLE ||
             disk->cachemode == VIR_DOMAIN_DISK_CACHE_DIRECTSYNC)
             continue;
+
+        if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_MIGRATION_FILE_DROP_CACHE)) {
+            VIR_DEBUG("QEMU supports flushing caches; migration is safe");
+            continue;
+        }

         virReportError(VIR_ERR_MIGRATE_UNSAFE, "%s",
                        _("Migration may lead to data corruption if disks"
@@ -1971,7 +1977,8 @@
         goto cleanup;

     if (!(flags & (VIR_MIGRATE_UNSAFE | VIR_MIGRATE_OFFLINE)) &&
-        !qemuMigrationSrcIsSafe(vm->def, nmigrate_disks, migrate_disks, flags))
+        !qemuMigrationSrcIsSafe(vm->def, priv->qemuCaps,
+                                nmigrate_disks, migrate_disks, flags))
         goto cleanup;

     if (flags & VIR_MIGRATE_POSTCOPY &&
@@ -4583,7 +4590,8 @@
         goto endjob;

     if (!(flags & (VIR_MIGRATE_UNSAFE | VIR_MIGRATE_OFFLINE)) &&
-        !qemuMigrationSrcIsSafe(vm->def, nmigrate_disks, migrate_disks, flags))
+        !qemuMigrationSrcIsSafe(vm->def, priv->qemuCaps,
+                                nmigrate_disks, migrate_disks, flags))
         goto endjob;

     qemuMigrationSrcStoreDomainState(vm);


android/handsfree: Add support for AT+COPS command

--- android/handsfree.c
+++ android/handsfree.c
@@ -155,6 +155,37 @@
 	device_cleanup();
 }

+static void at_cmd_cops(struct hfp_gw_result *result, enum hfp_gw_cmd_type type,
+							void *user_data)
+{
+	unsigned int val;
+
+	switch (type) {
+	case HFP_GW_CMD_TYPE_SET:
+		if (!hfp_gw_result_get_number(result, &val) || val != 3)
+			break;
+
+		if (!hfp_gw_result_get_number(result, &val) || val != 1)
+			break;
+
+		if (hfp_gw_result_has_next(result))
+			break;
+
+		hfp_gw_send_result(device.gw, HFP_RESULT_OK);
+
+		return;
+	case HFP_GW_CMD_TYPE_READ:
+		ipc_send_notif(hal_ipc, HAL_SERVICE_ID_HANDSFREE,
+						HAL_EV_HANDSFREE_COPS, 0, NULL);
+		return;
+	case HFP_GW_CMD_TYPE_TEST:
+	case HFP_GW_CMD_TYPE_COMMAND:
+		break;
+	}
+
+	hfp_gw_send_result(device.gw, HFP_RESULT_ERROR);
+}
+
 static void at_cmd_bia(struct hfp_gw_result *result, enum hfp_gw_cmd_type type,
 							void *user_data)
 {
@@ -211,6 +242,7 @@
 	}

 	hfp_gw_register(device.gw, at_cmd_bia, "+BIA", NULL, NULL);
+	hfp_gw_register(device.gw, at_cmd_cops, "+COPS", NULL, NULL);
 }

 static void at_cmd_cmer(struct hfp_gw_result *result, enum hfp_gw_cmd_type type,
@@ -740,7 +772,23 @@

 static void handle_cops(const void *buf, uint16_t len)
 {
-	DBG("");
+	const struct hal_cmd_handsfree_cops_response *cmd = buf;
+	char operator[17];
+
+	if (len != sizeof(*cmd) + cmd->len) {
+		error("Invalid cops response command, terminating");
+		raise(SIGTERM);
+		return;
+	}
+
+	DBG("");
+
+	memset(operator, 0, sizeof(operator));
+	memcpy(operator, cmd->buf, MIN(cmd->len, 16));
+
+	hfp_gw_send_info(device.gw, "+COPS: 0,0,\"%s\" ", operator);
+
+	hfp_gw_send_result(device.gw, HFP_RESULT_OK);

 	ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_HANDSFREE,
 			HAL_OP_HANDSFREE_COPS_RESPONSE, HAL_STATUS_FAILED);


universal_include: only do _SCL_SECURE and _HAS_ITERATOR_DEBUGGING when not using ASAN

Signed-off-by: Steven Noonan <4068f0880b399410602d694b3cc711c8a8f4727e@uplinklabs.net>

--- source/crisscross/universal_include.h
+++ source/crisscross/universal_include.h
@@ -22,11 +22,6 @@
 #define CC_LIB_COPYRIGHT           "(c) 2006-2020 by Uplink Laboratories. Licensed under the New BSD License."
 #define CC_LIB_NDS_COPYRIGHT       "(c) by Uplink Laboratories.\nLicensed under the BSD License."

-/* #define DISABLE_DEPRECATED_CODE */ /* This will be enabled by default in a future release */
-
-/* NOTE: By disabling this line, you will not be in compliance with the New BSD License. */
-/*      If you disable this line, you must display the copyright notice in the program */
-/*      elsewhere. */
 #define ENABLE_CREDITS

 /* Linux backtrace() */
@@ -56,6 +51,7 @@
 #ifndef _WIN32_IE
 #define _WIN32_IE   _WIN32_IE_IE70
 #endif
+#if !defined(__SANITIZE_ADDRESS__)
 #ifdef _SCL_SECURE
 #undef _SCL_SECURE
 #endif
@@ -64,6 +60,7 @@
 #undef _HAS_ITERATOR_DEBUGGING
 #endif
 #define _HAS_ITERATOR_DEBUGGING 0
+#endif
 #endif

 #if !defined (_CONSOLE)


Undo MAX_LONGPATH use in SDK header file

[tfs-changeset: 1527242]


disable "error_page 499 ..."

disable "error_page 499 ..."

--- src/http/ngx_http_core_module.c
+++ src/http/ngx_http_core_module.c
@@ -2884,7 +2884,7 @@

         err->status = ngx_atoi(value[i].data, value[i].len);

-        if (err->status == NGX_ERROR) {
+        if (err->status == NGX_ERROR || err->status == 499) {
             ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
                                "invalid value \"%V\"", &value[i]);
             return NGX_CONF_ERROR;


CAN: Fill in the higher priority TX buffer first.

--- components/can/src/irq.c
+++ components/can/src/irq.c
@@ -121,7 +121,7 @@
 	mcp2515_bit_modify(CANINTF, tx << TXIF_SHF, 0);

 	/* Load messages into empty TX buffers. */
-	for (int i = 0; i < TXB_NUM; i++) {
+	for (int i = TXB_NUM - 1; i >= 0; i--) {
 		if (tx & BIT(i)) {
 			if (tx_queue_pop(&frame)) {
 				/* Make sure the previous message is sent. */


allow "~", "~*", "^~", and "=" before location name without space

--- src/http/ngx_http_core_module.c
+++ src/http/ngx_http_core_module.c
@@ -39,6 +39,8 @@
     void *dummy);
 static char *ngx_http_core_location(ngx_conf_t *cf, ngx_command_t *cmd,
     void *dummy);
+static ngx_int_t ngx_http_core_regex_location(ngx_conf_t *cf,
+    ngx_http_core_loc_conf_t *clcf, ngx_str_t *regex, ngx_uint_t caseless);

 static char *ngx_http_core_types(ngx_conf_t *cf, ngx_command_t *cmd,
     void *conf);
@@ -2182,8 +2184,10 @@
 ngx_http_core_location(ngx_conf_t *cf, ngx_command_t *cmd, void *dummy)
 {
     char                      *rv;
+    u_char                    *mod;
+    size_t                     len;
+    ngx_str_t                 *value, *name;
     ngx_uint_t                 i;
-    ngx_str_t                 *value;
     ngx_conf_t                 save;
     ngx_http_module_t         *module;
     ngx_http_conf_ctx_t       *ctx, *pctx;
@@ -2225,45 +2229,32 @@
     value = cf->args->elts;

     if (cf->args->nelts == 3) {
-        if (value[1].len == 1 && value[1].data[0] == '=') {
-            clcf->name = value[2];
+
+        len = value[1].len;
+        mod = value[1].data;
+        name = &value[2];
+
+        if (len == 1 && mod[0] == '=') {
+
+            clcf->name = *name;
             clcf->exact_match = 1;

-        } else if (value[1].len == 2
-                   && value[1].data[0] == '^'
-                   && value[1].data[1] == '~')
-        {
-            clcf->name = value[2];
+        } else if (len == 2 && mod[0] == '^' && mod[1] == '~') {
+
+            clcf->name = *name;
             clcf->noregex = 1;

-        } else if ((value[1].len == 1 && value[1].data[0] == '~')
-                   || (value[1].len == 2
-                       && value[1].data[0] == '~'
-                       && value[1].data[1] == '*'))
-        {
-#if (NGX_PCRE)
-            ngx_str_t  err;
-            u_char     errstr[NGX_MAX_CONF_ERRSTR];
-
-            err.len = NGX_MAX_CONF_ERRSTR;
-            err.data = errstr;
-
-            clcf->regex = ngx_regex_compile(&value[2],
-                                     value[1].len == 2 ? NGX_REGEX_CASELESS: 0,
-                                     cf->pool, &err);
-
-            if (clcf->regex == NULL) {
-                ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "%s", err.data);
+        } else if (len == 1 && mod[0] == '~') {
+
+            if (ngx_http_core_regex_location(cf, clcf, name, 0) != NGX_OK) {
                 return NGX_CONF_ERROR;
             }

-            clcf->name = value[2];
-#else
-            ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
-                               "the using of the regex \"%V\" "
-                               "requires PCRE library", &value[2]);
-            return NGX_CONF_ERROR;
-#endif
+        } else if (len == 2 && mod[0] == '~' && mod[1] == '*') {
+
+            if (ngx_http_core_regex_location(cf, clcf, name, 1) != NGX_OK) {
+                return NGX_CONF_ERROR;
+            }

         } else {
             ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
@@ -2273,10 +2264,47 @@

     } else {

-        clcf->name = value[1];
-
-        if (value[1].data[0] == '@') {
-            clcf->named = 1;
+        name = &value[1];
+
+        if (name->data[0] == '=') {
+
+            clcf->name.len = name->len - 1;
+            clcf->name.data = name->data + 1;
+            clcf->exact_match = 1;
+
+        } else if (name->data[0] == '^' && name->data[1] == '~') {
+
+            clcf->name.len = name->len - 2;
+            clcf->name.data = name->data + 2;
+            clcf->noregex = 1;
+
+        } else if (name->data[0] == '~') {
+
+            name->len--;
+            name->data++;
+
+            if (name->data[0] == '*') {
+
+                name->len--;
+                name->data++;
+
+                if (ngx_http_core_regex_location(cf, clcf, name, 1) != NGX_OK) {
+                    return NGX_CONF_ERROR;
+                }
+
+            } else {
+                if (ngx_http_core_regex_location(cf, clcf, name, 0) != NGX_OK) {
+                    return NGX_CONF_ERROR;
+                }
+            }
+
+        } else {
+
+            clcf->name = *name;
+
+            if (name->data[0] == '@') {
+                clcf->named = 1;
+            }
         }
     }

@@ -2314,13 +2342,13 @@
             return NGX_CONF_ERROR;
         }

+        len = pclcf->name.len;
+
 #if (NGX_PCRE)
         if (clcf->regex == NULL
-            && ngx_strncmp(clcf->name.data, pclcf->name.data, pclcf->name.len)
-               != 0)
+            && ngx_strncmp(clcf->name.data, pclcf->name.data, len) != 0)
 #else
-        if (ngx_strncmp(clcf->name.data, pclcf->name.data, pclcf->name.len)
-            != 0)
+        if (ngx_strncmp(clcf->name.data, pclcf->name.data, len) != 0)
 #endif
         {
             ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
@@ -2343,6 +2371,40 @@
     *cf = save;

     return rv;
+}
+
+
+static ngx_int_t
+ngx_http_core_regex_location(ngx_conf_t *cf, ngx_http_core_loc_conf_t *clcf,
+    ngx_str_t *regex, ngx_uint_t caseless)
+{
+#if (NGX_PCRE)
+    ngx_str_t  err;
+    u_char     errstr[NGX_MAX_CONF_ERRSTR];
+
+    err.len = NGX_MAX_CONF_ERRSTR;
+    err.data = errstr;
+
+    clcf->regex = ngx_regex_compile(regex, caseless ? NGX_REGEX_CASELESS: 0,
+                                    cf->pool, &err);
+
+    if (clcf->regex == NULL) {
+        ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "%s", err.data);
+        return NGX_ERROR;
+    }
+
+    clcf->name = *regex;
+
+    return NGX_OK;
+
+#else
+
+    ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
+                       "the using of the regex \"%V\" requires PCRE library",
+                       regex);
+    return NGX_ERROR;
+
+#endif
 }


Allow 0 value for fetch.error.backoff.ms

--- src/rdkafka_defaultconf.c
+++ src/rdkafka_defaultconf.c
@@ -238,7 +238,7 @@
 	  _RK(fetch_error_backoff_ms),
 	  "How long to postpone the next fetch request for a "
 	  "topic+partition in case of a fetch error.",
-	  1, 300*1000, 500 },
+	  0, 300*1000, 500 },
         { _RK_GLOBAL|_RK_CONSUMER, "group.id", _RK_C_STR,
           _RK(group_id_str),
           "Consumer group id string. All clients sharing the same group.id "


nothing important

nothing important

--- source/tests/canpie-fd/test_cp_main.c
+++ source/tests/canpie-fd/test_cp_main.c
@@ -17,12 +17,12 @@
 //----------------------------------------------------------------------------//
 static void RunAllTests(void)
 {
-   RUN_TEST_GROUP(CP_CORE);
+ //  RUN_TEST_GROUP(CP_CORE);

-   RUN_TEST_GROUP(CP_MSG_CCF);
+ //  RUN_TEST_GROUP(CP_MSG_CCF);
    RUN_TEST_GROUP(CP_MSG_CCM);
-   RUN_TEST_GROUP(CP_MSG_FDF);
-   RUN_TEST_GROUP(CP_MSG_FDM);
+ //  RUN_TEST_GROUP(CP_MSG_FDF);
+//   RUN_TEST_GROUP(CP_MSG_FDM);


Need to request an ALPHA channel here or it doesn't work with pbuffers.  May need to have a different set for pixel buffers so that it works on some Linux/Mesa PCs.

--- source/three_d_drawing/dm_interface.c
+++ source/three_d_drawing/dm_interface.c
@@ -106,18 +106,20 @@
 	static int visattrsRGB_with_depth[] =
 	{
 		GLX_RGBA,
-		GLX_RED_SIZE, 5,
-		GLX_GREEN_SIZE, 5,
-		GLX_BLUE_SIZE, 5,
-		GLX_DEPTH_SIZE, 5,
+		GLX_RED_SIZE, 8,
+		GLX_GREEN_SIZE, 8,
+		GLX_BLUE_SIZE, 8,
+		GLX_ALPHA_SIZE, 8,
+		GLX_DEPTH_SIZE, 8,
 		None
 	};
 	static int visattrsRGB_no_depth[] =
 	{
 		GLX_RGBA,
-		GLX_RED_SIZE, 5,
-		GLX_GREEN_SIZE, 5,
-		GLX_BLUE_SIZE, 5,
+		GLX_RED_SIZE, 8,
+		GLX_GREEN_SIZE, 8,
+		GLX_BLUE_SIZE, 8,
+		GLX_ALPHA_SIZE, 8,
 		None
 	};
 	int *visattrs;


nimble/ll: Remove not needed NULL check

nimble/ll: Remove not needed NULL check

scansm cannot be NULL here and was already dereferenced few lines
above.


Updated make_plaque to allow bipolar and unipolar regions

git-svn-id: 4705079bc6b8aadf675e3696f5c015a6aa4916e3@1115 3c1deb5b-d424-0410-962d-aba41a686d42

--- source/unemap/utilities/make_plaque.c
+++ source/unemap/utilities/make_plaque.c
@@ -1,7 +1,7 @@
 /*******************************************************************************
 FILE : make_plaque.c

-LAST MODIFIED : 1 October 2000
+LAST MODIFIED : 11 Januray 2001

 DESCRIPTION :
 Make a unemap configuration file for multiple flexible pcb plaques in a row.
@@ -15,8 +15,8 @@
 {
 	char file_name[121];
 	FILE *cnfg_file;
-	int ecg_module,electrode_number,i,j,number_of_pcbs,region_number,start1,
-		start2;
+	int bipolar,ecg_module,electrode_number,i,j,number_of_pcbs,number_in_row,
+		region_number,start1,start2,start3,start4;

 	printf("File name? (.cnfg assumed)\n");
 	scanf("%s",file_name);
@@ -30,51 +30,108 @@
 		electrode_number=0;
 		do
 		{
-			printf("Number of 64 channel modules for strip/region %d (0 to end, negative to skip)?\n",
+			printf(
+"Number of 64 channel modules for strip/region %d (0 to end, negative to skip)?\n",
 				region_number);
 			scanf("%d",&number_of_pcbs);
 			if (0!=number_of_pcbs)
 			{
 				if (0<number_of_pcbs)
 				{
+					printf("Bipolar (b) or unipolar (u) ?\n");
+					scanf("%s",file_name);
+					if (('b'==file_name[0])||('B'==file_name[0]))
+					{
+						bipolar=1;
+						number_in_row=15;
+					}
+					else
+					{
+						bipolar=0;
+						number_in_row=16;
+					}
 					fprintf(cnfg_file,"patch : region %d\n",region_number);
 					for (i=0;i<number_of_pcbs;i++)
 					{
 						if (ecg_module==(electrode_number/64)+i+1)
 						{
 							start1=2;
-							start2=1;
+							start2=0;
+							start3=1;
+							start4=0;
 						}
 						else
 						{
 							start1=0;
 							start2=0;
+							start3=0;
+							start4=0;
 						}
-						for (j=start1;j<16;j++)
+						for (j=start1;j<number_in_row;j++)
 						{
 							fprintf(cnfg_file,"electrode : %d\n",electrode_number+i*64+j+1);
-							fprintf(cnfg_file,"channel : %d\n",electrode_number+i*64+32-2*j);
+							if (bipolar)
+							{
+								fprintf(cnfg_file,"channel : %d\n",
+									electrode_number+i*64+64-2*j);
+							}
+							else
+							{
+								fprintf(cnfg_file,"channel : %d\n",
+									electrode_number+i*64+32-2*j);
+							}
 							fprintf(cnfg_file,"position : x = %d, y = %d\n",j,
 								(number_of_pcbs-i-1)*4+3);
 						}
-						for (j=0;j<16;j++)
+						for (j=start2;j<number_in_row;j++)
 						{
 							fprintf(cnfg_file,"electrode : %d\n",electrode_number+i*64+j+17);
-							fprintf(cnfg_file,"channel : %d\n",electrode_number+i*64+64-2*j);
+							if (bipolar)
+							{
+								fprintf(cnfg_file,"channel : %d\n",
+									electrode_number+i*64+32-2*j);
+							}
+							else
+							{
+								fprintf(cnfg_file,"channel : %d\n",
+									electrode_number+i*64+64-2*j);
+							}
 							fprintf(cnfg_file,"position : x = %d, y = %d\n",j,
 								(number_of_pcbs-i-1)*4+2);
 						}
-						for (j=start2;j<16;j++)
+						for (j=start3;j<number_in_row;j++)
 						{
 							fprintf(cnfg_file,"electrode : %d\n",electrode_number+i*64+j+33);
-							fprintf(cnfg_file,"channel : %d\n",electrode_number+i*64+31-2*j);
+							if (bipolar)
+							{
+								fprintf(cnfg_file,"channel : %d\n",
+									electrode_number+i*64+61-2*j);
+									/*???DB.  For 4 by 17
+									electrode_number+i*64+63-2*j);*/
+							}
+							else
+							{
+								fprintf(cnfg_file,"channel : %d\n",
+									electrode_number+i*64+31-2*j);
+							}
 							fprintf(cnfg_file,"position : x = %d, y = %d\n",j,
 								(number_of_pcbs-i-1)*4+1);
 						}
-						for (j=0;j<16;j++)
+						for (j=start4;j<number_in_row;j++)
 						{
 							fprintf(cnfg_file,"electrode : %d\n",electrode_number+i*64+j+49);
-							fprintf(cnfg_file,"channel : %d\n",electrode_number+i*64+63-2*j);
+							if (bipolar)
+							{
+								fprintf(cnfg_file,"channel : %d\n",
+									electrode_number+i*64+29-2*j);
+									/*???DB.  For 4 by 17
+									electrode_number+i*64+31-2*j);*/
+							}
+							else
+							{
+								fprintf(cnfg_file,"channel : %d\n",
+									electrode_number+i*64+63-2*j);
+							}
 							fprintf(cnfg_file,"position : x = %d, y = %d\n",j,
 								(number_of_pcbs-i-1)*4);
 						}


trivial: Another analyzer workaround

trivial: Another analyzer workaround

--- compose/asc-utils-l10n.c
+++ compose/asc-utils-l10n.c
@@ -66,6 +66,7 @@
 {
 	AscLocaleContext *ctx;
 	ctx = g_new0 (AscLocaleContext, 1);
+	ctx->translations = NULL;
 	return ctx;
 }

@@ -341,7 +342,7 @@
 	/* search for each translation ID */
 	for (guint i = 0; i < ctx->translations->len; i++) {
 		const gchar *location_hint;
-		AsTranslation *t = g_ptr_array_index (ctx->translations, i);
+		AsTranslation *t = AS_TRANSLATION (g_ptr_array_index (ctx->translations, i));

 		if (as_translation_get_kind (t) != AS_TRANSLATION_KIND_QT &&
 		    as_translation_get_kind (t) != AS_TRANSLATION_KIND_UNKNOWN)


doc change for CircularBuffer

doc change for CircularBuffer

--- geomc/CircularBuffer.h
+++ geomc/CircularBuffer.h
@@ -1,6 +1,8 @@
 #include <type_traits>
 #include <utility>
 #include <geomc/Storage.h>
+
+// todo: this guy wants an iterator

 namespace geom {
@@ -23,7 +25,8 @@
  * @tparam T Element type.
  * @tparam N Static capacity of the buffer. Adding more than this number of elements
  * to the buffer will incur a heap memory allocation. To always use heap allocation,
- * pass zero to this parameter.
+ * pass zero to this parameter, in which case memory will be allocated when the first
+ * element is added.
  */
 template <typename T, index_t N>
 class CircularBuffer {
@@ -51,7 +54,7 @@

 public:

-    /// Construct a new empty circular buffer.
+    /// Construct a new empty circular buffer, with capacity for `N` items.
     CircularBuffer():
             _data(_buf),
             _capacity(N),


add model for atf_tc_fail_requirement

add model for atf_tc_fail_requirement

--- util/models.c
+++ util/models.c
@@ -91,3 +91,7 @@
 	if (!mem) __coverity_panic__();
 	__coverity_free__(ptr);
 }
+
+void atf_tc_fail_requirement(const char *, const size_t, const char *, ...) {
+	__coverity_panic__();
+}


msg/mds.h: some updates

msg/mds.h: some updates

Signed-off-by: Colin McCabe <3142ce8a0bdba4a38073365893e6b74f72d9c512@alumni.cmu.edu>

--- msg/mds.h
+++ msg/mds.h
@@ -30,13 +30,13 @@
 	/** OSD heartbeat message */
 	MMM_OSD_HEARTBEAT,
 	/** Lookup some chunks for an open read-only file. */
-	MMM_LOOKUP_CHUNKS_REQ,
+	MMM_CHUNKFIND_REQ,
 	/** Get a new chunk for an open write-only file */
-	MMM_ALLOC_CHUNK_REQ,
+	MMM_CHUNKALLOC_REQ,
 	/** Make a directory and all ancestors */
 	MMM_MKDIRS_REQ,
 	/** List all files in a directory */
-	MMM_LIST_DIR_REQ,
+	MMM_LISTDIR_REQ,
 	/** Give stat information regarding a path */
 	MMM_STAT_REQ,
 	/** Client Change permissions request */
@@ -51,8 +51,6 @@
 	MMM_UNLINK_TREE_REQ,
 	/** Client rename request */
 	MMM_RENAME_REQ,
-	/** Client close remote file */
-	MMM_CLOSE_RFILE_REQ,
 };

 /* Create file */
@@ -63,13 +61,15 @@
 	uint16_t mode;
 	uint16_t repl;
 	uint64_t mtime;
-	char data[0];
+	uint16_t path_len;
+	char path[0];
 });
 PACKED(
 struct mmm_open_rfile_req {
 	struct msg base;
+	uint64_t atime;
 	uint16_t path_len;
-	struct mmm_path path;
+	char path[0];
 });
 PACKED(
 struct mmm_chunk_report {
@@ -88,20 +88,21 @@
 PACKED(
 struct mmm_alloc_chunk_req {
 	struct msg base;
-	int32_t rfile;
-	int32_t len;
-	int64_t start;
+	uint64_t nid;
 });
 PACKED(
 struct mmm_mkdirs_req {
 	struct msg base;
+	uint64_t mtime;
 	uint16_t mode;
-	struct mmm_path path;
+	uint16_t path_len;
+	char path[0];
 });
 PACKED(
 struct mmm_list_directory_req {
 	struct msg base;
-	struct mmm_path path;
+	uint16_t path_len;
+	char path[0];
 });
 PACKED(
 struct mmm_stat_req {


incremented version number to reflect latest bug fixes

--- ansilove/alconfig.h
+++ ansilove/alconfig.h
@@ -14,7 +14,7 @@
 #define alconfig_h

 // configuration defines
-#define VERSION "1.0.245"
+#define VERSION "1.0.248"

 #define PCBOARD_STRIP_CODES "@POFF@,@WAIT@"


warning about entropy.

warning about entropy.

git-svn-id: 606cd7bb7c4874b1f27fc28ef6a6d76dca18f877@828 be551aaa-1e26-0410-a405-d3ace91eadb9

--- util/random.c
+++ util/random.c
@@ -110,6 +110,7 @@
 				ERR_get_error());
 			return 0;
 		}
+		log_warn("openssl has no entropy, seeding with time");
 	}
 	ub_arc4random_stir(state->s);
 	return 1;


fixed could not find function error

fixed could not find function error

--- src/intel-edison-9dof-imu-i2c.c
+++ src/intel-edison-9dof-imu-i2c.c
@@ -1,7 +1,7 @@
 #include "../include/intel-edison-9dof-imu-i2c.h"
 #include <fcntl.h>

-int DMopenDevFile(){
+int DMOpenDevFile(){
 	int file;
 	if((file = open(I2C_DEV_NAME, O_RDWR)) < 0){
 		//Could not open i2c bus


Added some better logging for random test

--- util_tester.c
+++ util_tester.c
@@ -43,6 +43,7 @@
             break;
         default:
             printf("Invalid test case \n");
+            break;
     }
     return 0;
 }
@@ -55,14 +56,18 @@
     int *array;
     array = malloc(length*sizeof(int));
     memset(array,0,length*sizeof(int));
-    while(i<1800000)
+    int iterations = 1800000;
+    while(i<iterations)
     {
         r = randomInRange(0,length-1);
         array[r]++;
         i++;
     }
 #ifdef DEBUG
-    printf("Going to print occurences of each element \n");
+    printf("Ideal average value is %d \n",iterations/length);
+    printf("Going to print frequency of each number in range 0-%d \n",length-1);
+#else
+    printf("Random generation test needs to be built with DEBUG=y to see o/p\n");
 #endif
     printArray(array,length);
 }


include LDAP and VOMS in version string

include LDAP and VOMS in version string

--- myproxy.h
+++ myproxy.h
@@ -26,13 +26,24 @@
 #else
 #define MYPROXY_VERSION_KRB5 ""
 #endif
+#if defined(HAVE_LIBLDAP)
+#define MYPROXY_VERSION_LDAP " LDAP"
+#else
+#define MYPROXY_VERSION_LDAP ""
+#endif
+#if defined(HAVE_VOMS)
+#define MYPROXY_VERSION_VOMS " VOMS"
+#else
+#define MYPROXY_VERSION_VOMS ""
+#endif

 /* software version constants */
 #define MYPROXY_VERSION_MAJOR 3
 #define MYPROXY_VERSION_MINOR 5
 #define MYPROXY_VERSION_MICRO 0
 #define MYPROXY_VERSION_DATE "v3.5 14 Mar 2006" \
-        MYPROXY_VERSION_PAM MYPROXY_VERSION_SASL MYPROXY_VERSION_KRB5
+        MYPROXY_VERSION_PAM MYPROXY_VERSION_SASL MYPROXY_VERSION_KRB5 \
+        MYPROXY_VERSION_LDAP MYPROXY_VERSION_VOMS

 /*
  * myproxy_version()


[cdda] Fixed snprintf() related vulnerability.

--- interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_cdda.c
+++ interfaces/IFusionSoundMusicProvider/ifusionsoundmusicprovider_cdda.c
@@ -463,7 +463,7 @@
                          if (artist)
                               tracks[i].artist = D_STRDUP( artist );
                          if (title)
-                          tracks[i].title  = D_STRDUP( title );
+                              tracks[i].title  = D_STRDUP( title );
                          if (genre)
                               tracks[i].genre  = D_STRDUP( genre );
                          if (album)
@@ -701,26 +701,17 @@

           memset( &desc, 0, sizeof(desc) );

-          if (track->artist) {
-               snprintf( desc.artist,
-                         FS_TRACK_DESC_ARTIST_LENGTH, track->artist );
-          }
-          if (track->title) {
-               snprintf( desc.title,
-                         FS_TRACK_DESC_TITLE_LENGTH, track->title );
-          }
-          if (track->genre) {
-               snprintf( desc.genre,
-                         FS_TRACK_DESC_GENRE_LENGTH, track->genre );
-          }
-          if (track->album) {
-               snprintf( desc.album,
-                         FS_TRACK_DESC_ALBUM_LENGTH, track->album );
-          }
+          if (track->artist)
+               direct_snputs( desc.artist, track->artist, FS_TRACK_DESC_ARTIST_LENGTH );
+          if (track->title)
+               direct_snputs( desc.title, track->title, FS_TRACK_DESC_TITLE_LENGTH );
+          if (track->genre)
+               direct_snputs( desc.genre, track->genre, FS_TRACK_DESC_GENRE_LENGTH );
+          if (track->album)
+               direct_snputs( desc.album, track->album, FS_TRACK_DESC_ALBUM_LENGTH );
           desc.year = track->year;

-          snprintf( desc.encoding,
-                    FS_TRACK_DESC_ENCODING_LENGTH, "PCM 16 bit" );
+          direct_snputs( desc.encoding, "PCM 16 bit", FS_TRACK_DESC_ENCODING_LENGTH );
           desc.bitrate = CD_FRAMES_PER_SECOND * CD_BYTES_PER_FRAME * 8;

           if (callback( i, desc, callbackdata ) != DFENUM_OK)
@@ -759,26 +750,17 @@

      track = &data->tracks[data->current_track];

-     if (track->artist) {
-          snprintf( desc->artist,
-                    FS_TRACK_DESC_ARTIST_LENGTH, track->artist );
-     }
-     if (track->title) {
-          snprintf( desc->title,
-                    FS_TRACK_DESC_TITLE_LENGTH, track->title );
-     }
-     if (track->genre) {
-          snprintf( desc->genre,
-                    FS_TRACK_DESC_GENRE_LENGTH, track->genre );
-     }
-     if (track->album) {
-          snprintf( desc->album,
-                    FS_TRACK_DESC_ALBUM_LENGTH, track->album );
-     }
+     if (track->artist)
+          direct_snputs( desc->artist, track->artist, FS_TRACK_DESC_ARTIST_LENGTH );
+     if (track->title)
+          direct_snputs( desc->title, track->title, FS_TRACK_DESC_TITLE_LENGTH );
+     if (track->genre)
+          direct_snputs( desc->genre, track->genre, FS_TRACK_DESC_GENRE_LENGTH );
+     if (track->album)
+          direct_snputs( desc->album, track->album, FS_TRACK_DESC_ALBUM_LENGTH );
      desc->year = track->year;

-     snprintf( desc->encoding,
-               FS_TRACK_DESC_ENCODING_LENGTH, "PCM 16 bit" );
+     direct_snputs( desc->encoding, "PCM 16 bit", FS_TRACK_DESC_ENCODING_LENGTH );
      desc->bitrate = CD_FRAMES_PER_SECOND * CD_BYTES_PER_FRAME * 8;

      return DFB_OK;


Update author in grove_sound.h

Update author in grove_sound.h

--- grove_sound/grove_sound.h
+++ grove_sound/grove_sound.h
@@ -39,7 +39,7 @@
 //DESCRIPTION       "Grove - Sound Sensor can detect the sound strength of the environment. The main component of the module is a simple microphone, which is based on the LM358 amplifier and an electret microphone."
 //WIKI_URL          http://www.seeedstudio.com/wiki/Grove_-_Sound_Sensor
 //ADDED_AT          "2016-07-01"
-//AUTHOR            "SEEED"
+//AUTHOR            "Travis Brown"

 class GroveSound
 {


GESTrackObject: fixe the connect_properties_signals

--- ges/ges-track-object.c
+++ ges/ges-track-object.c
@@ -522,8 +522,9 @@
 static void
 connect_properties_signals (GESTrackObject * object)
 {
-  if (G_UNLIKELY (object->priv->properties_hashtable)) {
+  if (G_UNLIKELY (!object->priv->properties_hashtable)) {
     GST_WARNING ("The properties_hashtable hasn't been set");
+    return;
   }

   g_hash_table_foreach (object->priv->properties_hashtable,
@@ -801,7 +802,7 @@
  * ges_track_object_get_track:
  * @object: a #GESTrackObject
  *
- * Get the #GESTrack to which this object belongs.
+ * Get the #GESTrack to which this object belongs.
  *
  * Returns: (transfer none): The #GESTrack to which this object belongs. Can be %NULL if it
  * is not in any track


Warning fix

Warning fix

--- net/url.h
+++ net/url.h
@@ -17,7 +17,7 @@
 	UrlEncoder() : paramCount(0)
 	{
 		data.reserve(256);
-	};
+	}

 	void Add(const std::string &key, const std::string &value)
 	{
@@ -106,7 +106,7 @@

 class Url {
 public:
-	Url(const std::string url) : url_(url), valid_(false) {
+	Url(const std::string url) : valid_(false), url_(url) {
 		Split();
 	}


VC6 port of DataGenerators.h

VC6 port of DataGenerators.h

git-svn-id: 2bceadd671bcc8d4f7a34159d1bc3b98592acb3b@110 7ec92016-0320-0410-acc4-a06ded1c099a

error: pathspec 'MSVC/1200/DataGenerators.h' did not match any file(s) known to git

--- MSVC/1200/DataGenerators.h
+++ MSVC/1200/DataGenerators.h
@@ -0,0 +1,143 @@
+////////////////////////////////////////////////////////////////////////////////
+// The Loki Library
+// Data Generator by Shannon Barber
+// This code DOES NOT accompany the book:
+// Alexandrescu, Andrei. "Modern C++ Design: Generic Programming and Design
+//     Patterns Applied". Copyright (c) 2001. Addison-Wesley.
+//
+// Code covered by the MIT License
+// The author makes no representations about the suitability of this software
+//  for any purpose. It is provided "as is" without express or implied warranty.
+////////////////////////////////////////////////////////////////////////////////
+
+// Last update: Mar 04, 2003
+// MSVC 6.0 version
+
+#ifndef DATAGENERATORS_H
+#define DATAGENERATORS_H
+#include "Typelist.h"
+#include "MSVC6Helpers.h"
+namespace Loki
+{
+	namespace TL
+	{
+		template<typename T>
+		struct nameof_type
+		{
+			const char* operator()()
+			{
+				return typeid(T).name();
+			}
+		};
+		template<typename T>
+		struct sizeof_type
+		{
+			size_t operator()()
+			{
+				return sizeof(T);
+			}
+		};
+
+		// wrappers to workaround the need for template template parameters
+		struct nameof_type_wrapper
+		{
+			template <class T>
+			struct In
+			{
+				typedef nameof_type<T> type;
+			};
+		};
+
+		struct sizeof_type_wrapper
+		{
+			template <class T>
+			struct In
+			{
+				typedef sizeof_type<T> type;
+			};
+
+		};
+		template <class TList, class GenFunc>
+		struct IterateTypes;
+namespace Private
+{
+	// Specialization for a general typelist
+	template <unsigned Tag>
+	struct IterateTypesImpl
+	{
+		template <class TList, class GenFunc>
+		struct In
+		{
+			typedef typename TList::Head T1;
+			typedef typename TList::Tail T2;
+
+			typedef IterateTypes<T1, GenFunc> head_t;
+			head_t head;
+			typedef IterateTypes<T2, GenFunc> tail_t;
+			tail_t tail;
+
+			template<class II>
+			void operator()(II ii)
+			{
+				head.operator()(ii);
+				tail.operator()(ii);
+			}
+		};
+	};
+
+	// Specialization for a single type
+	template <>
+	struct IterateTypesImpl<TL::Private::NoneList_ID>
+	{
+		template <class AtomicType, class GenFunc>
+		struct In
+		{
+			template<class II>
+			void operator()(II ii)
+			{
+				typedef typename Loki::ApplyInnerType<GenFunc, AtomicType>::type gFunc;
+				gFunc genfunc;
+				*ii = genfunc();
+				++ii; //Is this even needed?
+			}
+		};
+	};
+
+	// Specialization for NullType
+	template <>
+	struct IterateTypesImpl<TL::Private::NullType_ID>
+	{
+		template <class T, class GenFunc>
+		struct In
+		{
+			template<class II>
+			void operator()(II ii)
+			{}
+		};
+	};
+}	// end ns Private
+
+		template <class TList, class GenFunc>
+		struct IterateTypes : public
+			Private::IterateTypesImpl
+			<
+				TL::Private::IsTypelist<TList>::type_id
+			>::template In<TList, GenFunc>
+		{};
+
+		template<typename Types, class UnitFunc, typename II>
+		void iterate_types(II ii)
+		{
+			Loki::TL::IterateTypes<Types, UnitFunc> it;
+			it(ii);
+		}
+	}//ns TL
+}//ns Loki
+
+#endif //DATAGENERATORS_H
+////////////////////////////////////////////////////////////////////////////////
+// Change log:
+// 9/20/02 Named changed from GenData to IterateTypes
+// 10/8/02 insertion iterators are passed-by-value, not by-reference (oops)
+// 03/04/03 ported by Benjamin Kaufmann to MSVC 6.0
+////////////////////////////////////////////////////////////////////////////////


MimoProcessor: change default FIFO size to 1024

--- apf/mimoprocessor.h
+++ apf/mimoprocessor.h
@@ -434,9 +434,9 @@
 APF_MIMOPROCESSOR_TEMPLATES
 APF_MIMOPROCESSOR_BASE::MimoProcessor(const parameter_map& params_)
   : interface_policy(params_)
-  , query_policy(params_.get("fifo_size", 128))
+  , query_policy(params_.get("fifo_size", 1024))
   , params(params_)
-  , _fifo(params.get("fifo_size", 128))
+  , _fifo(params.get("fifo_size", 1024))
   , _current_list(nullptr)
   , _num_threads(params.get("threads", APF_MIMOPROCESSOR_DEFAULT_THREADS))
   // Create worker threads.  NOTE: Number 0 is reserved for the main thread.


Ignore link-local addresses

Ignore link-local addresses

Closes: #705900

--- netlink.c
+++ netlink.c
@@ -178,6 +178,12 @@
                         if (!address)
                                 continue;

+			// Avoid link-local address
+			// http://bugs.debian.org/705900
+			if (ifaddrmsg->ifa_family == AF_INET6 &&
+			    IN6_IS_ADDR_LINKLOCAL((const struct in6_addr *)address))
+			    continue;
+
                         list = realloc(list, (n_list+1) * sizeof(struct address));
                         if (!list) {
                                 r = -ENOMEM;


forgot to remove some rprintfs

forgot to remove some rprintfs

--- apps/gps/ubx.c
+++ apps/gps/ubx.c
@@ -726,7 +726,7 @@

 	int mavlink_fd = open(MAVLINK_LOG_DEVICE, 0);

-	int err_skip_counter = 0;
+	//int err_skip_counter = 0;

 	while (!(*thread_should_exit)) {
 		/* if some values are to old reconfigure gps */
@@ -739,7 +739,7 @@
 //			printf("timestamp_now=%llu\n", timestamp_now);
 //			printf("last_message_timestamps=%llu\n", ubx_state->last_message_timestamps[i]);
 			if (timestamp_now - ubx_state->last_message_timestamps[i] > UBX_WATCHDOG_CRITICAL_TIME_MICROSECONDS) {
-				printf("Warning: GPS ubx message %d not received for a long time\n", i);
+				//printf("Warning: GPS ubx message %d not received for a long time\n", i);
 				all_okay = false;
 			}
 		}
@@ -749,13 +749,13 @@
 		if (!all_okay) {
 			/* gps error */
 			ubx_fail_count++;
-			if (err_skip_counter == 0)
-			{
-				printf("GPS Watchdog detected gps not running or having problems\n");
-				err_skip_counter = 20;
-			}
-			err_skip_counter--;
-			printf("gps_mode_try_all =%u, ubx_fail_count=%u, ubx_healthy=%u, once_ok=%u\n", gps_mode_try_all, ubx_fail_count, ubx_healthy, once_ok);
+//			if (err_skip_counter == 0)
+//			{
+//				printf("GPS Watchdog detected gps not running or having problems\n");
+//				err_skip_counter = 20;
+//			}
+//			err_skip_counter--;
+			//printf("gps_mode_try_all =%u, ubx_fail_count=%u, ubx_healthy=%u, once_ok=%u\n", gps_mode_try_all, ubx_fail_count, ubx_healthy, once_ok);

 			/* If we have too many failures and another mode or baud should be tried, exit... */


Clear the pixmap buffer between bands.

Clear the pixmap buffer between bands.

Ignore-this: e42b26a9d76fdd2dc2e0b5df5b13fe1

darcs-hash:20100624235729-f546f-8f223e81113c69dfdf98e31114690f2ce7f53c91.gz

--- apps/pdfdraw.c
+++ apps/pdfdraw.c
@@ -206,9 +206,6 @@
 	}

 	pix = fz_newpixmap((greyscale ? pdf_devicegray : pdf_devicergb), bbox.x0, bbox.y0, w, bh);
-	fz_clearpixmap(pix, 0xFF);
-
-	memset(pix->samples, 0xff, pix->h * pix->w * pix->n);

 	if (numbands > 1)
 	{
@@ -223,6 +220,7 @@

 	for (b = 0; b < numbands; b++)
 	{
+		fz_clearpixmap(pix, 0xFF);

 		dev = fz_newdrawdevice(drawcache, pix);


multiudpsink: Add missing socket.h include

Without this include, macro like SO_BINDTODEVICE is not visible and
associated feature gets out-compiled. This also affects the support for
SO_SNDBUF.

--- gst/udp/gstmultiudpsink.c
+++ gst/udp/gstmultiudpsink.c
@@ -36,6 +36,10 @@
 #include "gstmultiudpsink.h"

 #include <string.h>
+
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif

 #include "gst/net/net.h"
 #include "gst/glib-compat-private.h"


[gc] fix a small documentation note in src/io/core.c about what GC function calls it

git-svn-id: 6e74a02f85675cec270f5d931b0f6998666294a3@38845 d31e2699-5ff4-0310-a27c-f18f2fbe73fe

--- src/io/core.c
+++ src/io/core.c
@@ -107,7 +107,7 @@

 =item C<void Parrot_IOData_mark(PARROT_INTERP, ParrotIOData *piodata)>

-Called from C<trace_active_PMCs()> to mark the IO data live.
+Called from C<Parrot_gc_trace_root()> to mark the IO data live.

 =cut


Check if pixmap memory was actually allocated.

--- gdx/jni/gdx2d/gdx2d.c
+++ gdx/jni/gdx2d/gdx2d.c
@@ -229,6 +229,7 @@
 		return NULL;

 	gdx2d_pixmap* pixmap = (gdx2d_pixmap*)malloc(sizeof(gdx2d_pixmap));
+	if (!pixmap) return 0;
 	pixmap->width = (uint32_t)width;
 	pixmap->height = (uint32_t)height;
 	pixmap->format = (uint32_t)format;
@@ -255,10 +256,15 @@

 gdx2d_pixmap* gdx2d_new(uint32_t width, uint32_t height, uint32_t format) {
 	gdx2d_pixmap* pixmap = (gdx2d_pixmap*)malloc(sizeof(gdx2d_pixmap));
+	if (!pixmap) return 0;
 	pixmap->width = width;
 	pixmap->height = height;
 	pixmap->format = format;
 	pixmap->pixels = (unsigned char*)malloc(width * height * gdx2d_bytes_per_pixel(format));
+	if (!pixmap->pixels) {
+		free((void*)pixmap);
+		return 0;
+	}
 	return pixmap;
 }
 void gdx2d_free(const gdx2d_pixmap* pixmap) {


Network backend: Fix questionnable warning detected by Clang

Signed-off-by: Paul Cercueil <73d292422978d45c9eeef455bb1b24a0db453722@analog.com>

--- network.c
+++ network.c
@@ -749,7 +749,7 @@
 		char addr_str[AVAHI_ADDRESS_STR_MAX];
 		char port_str[6];
 		AvahiAddress address;
-		uint16_t port;
+		uint16_t port = IIOD_PORT;

 		memset(&address, 0, sizeof(address));


va tomando forma #2

va tomando forma #2

--- vamonosotro.c
+++ vamonosotro.c
@@ -47,7 +47,7 @@
 #include "net/ipv6/uip-ds6.h"
 #include "net/ip/uip-udp-packet.h"
 #include "sys/ctimer.h"
-
+#include "dev/leds.h"

 #include "dev/i2cmaster.h"
 #include "dev/adxl345.h"
@@ -72,7 +72,7 @@
 process_event_t event_motion_detected;

 #define SENSOR_READ_INTERVAL_MOTION (CLOCK_SECOND / 4)
-#define MOTION_TRESH 120
+#define MOTION_TRESH 224

 /*----NETWORK----*/

@@ -126,7 +126,8 @@
 PROCESS(consumer, "Consumer");

 //AUTOSTART_PROCESSES(&light_event_handler, &consumer);
-AUTOSTART_PROCESSES(&motion_event_handler, &light_event_handler, &consumer);
+AUTOSTART_PROCESSES(&motion_event_handler, &consumer);
+//AUTOSTART_PROCESSES(&motion_event_handler, &light_event_handler, &consumer);

 PROCESS_THREAD(motion_event_handler, ev, data)
 {
@@ -161,6 +162,11 @@
     x_axis = adxl345.value(X_AXIS);
     y_axis = adxl345.value(Y_AXIS);
     z_axis = adxl345.value(Z_AXIS);
+
+    printf("%d %d %d\n%d %d %d\n%d\n\n\n",
+           x_axis, y_axis, z_axis,
+           last_x_axis, last_y_axis, last_z_axis,
+           DELTA(last_x_axis, x_axis) + DELTA(last_y_axis, y_axis) + DELTA(last_z_axis,z_axis));

     if (!motion_detected && ((DELTA(x_axis, last_x_axis) +
                               DELTA(y_axis, last_y_axis) +
@@ -175,6 +181,10 @@
       motion_detected = 0;
     }

+    last_x_axis = x_axis;
+    last_y_axis = y_axis;
+    last_z_axis = z_axis;
+
     etimer_reset(&et_motion);
   }

@@ -268,12 +278,14 @@
       printf("LEVEL LIGHT CHANGE\n");
       msg.key = 1;
       msg.value = *((uint8_t *)data);
+      leds_toggle(LEDS_BLUE);
     }

     if (ev == event_motion_detected) {
       printf("MOTION DETECTED\n");
       msg.key = 2;
       msg.value = 0;
+      leds_toggle(LEDS_RED);
     }

     send_packet();