1. 22 5月, 2013 6 次提交
    • J
      vbox: fix VIR_STRDUP value check · 1c65362f
      Ján Tomko 提交于
      In my review of 31532cab I missed the fact that VIR_STRDUP
      now returns 1 on success, and 0 if the source was NULL.
      
      (This still doesn't add proper OOM error handling.)
      1c65362f
    • O
      syntax-check: Add the rule to forbid whitespace before ";" · ba0880b2
      Osier Yang 提交于
      Only a few cases are allowed:
      
      1) The expression is empty for "for" loop, E.g.
      
        for (i = 0; ; i++)
      
      2) An empty statement
      
        while (write(statuswrite, &status, 1) == -1 &&
               errno == EINTR)
            ; /* empty */
      
      3) ";" is inside double-quote, I.e, as part of const string. E.g.
      
        vshPrint(ctl, "a ; b ; cd;\n");
      
      The "for" loop in src/rpc/virnettlscontext.c is the special case,
      1) applies for it, so change it together in this patch.
      ba0880b2
    • O
      nwfilter: Change the comment style · 1f49c0e1
      Osier Yang 提交于
      The more common habit is to add the comment after the statements.
      1f49c0e1
    • O
      Fix the syntax-check failure · 1f9dcbc7
      Osier Yang 提交于
      Introduced by commit 7ac2c4fe, pushed under build-breaker rule.
      1f9dcbc7
    • G
      interface: list all interfaces with flags == 0 · 7ac2c4fe
      Guannan Ren 提交于
      virConnectListAllInterfaces should support to list all of
      interfaces when the value of flags is 0. The behaviour is
      consistent with other virConnectListAll* APIs
      7ac2c4fe
    • E
      cgroup: be robust against cgroup movement races · 83e4c775
      Eric Blake 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=965169 documents a
      problem starting domains when cgroups are enabled; I was able
      to reliably reproduce the race about 5% of the time when I added
      hooks to domain startup by 3 seconds (as that seemed to be about
      the length of time that qemu created and then closed a temporary
      thread, probably related to aio handling of initially opening
      a disk image).  The problem has existed since we introduced
      virCgroupMoveTask in commit 91028296 (v0.10.0).
      
      There are some inherent TOCTTOU races when moving tasks between
      kernel cgroups, precisely because threads can be created or
      completed in the window between when we read a thread id from the
      source and when we write to the destination.  As the goal of
      virCgroupMoveTask is merely to move ALL tasks into the new
      cgroup, it is sufficient to iterate until no more threads are
      being created in the old group, and ignoring any threads that
      die before we can move them.
      
      It would be nicer to start the threads in the right cgroup to
      begin with, but by default, all child threads are created in
      the same cgroup as their parent, and we don't want vcpu child
      threads in the emulator cgroup, so I don't see any good way
      of avoiding the move.  It would also be nice if the kernel were
      to implement something like rename() as a way to atomically move
      a group of threads from one cgroup to another, instead of forcing
      a window where we have to read and parse the source, then format
      and write back into the destination.
      
      * src/util/vircgroup.c (virCgroupAddTaskStrController): Ignore
      ESRCH, because a thread ended between read and write attempts.
      (virCgroupMoveTask): Loop until all threads have moved.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      83e4c775
  2. 21 5月, 2013 34 次提交