1. 25 7月, 2017 1 次提交
  2. 04 4月, 2017 1 次提交
  3. 06 3月, 2017 3 次提交
    • J
      Test virSystemd APIs twice to check the cache effects · 9b1bd138
      Ján Tomko 提交于
      Test virSystemd APIs twice to check the cache effects.
      9b1bd138
    • J
      Cache the presence of machine1 service · f10bd740
      Ján Tomko 提交于
      After the system has been booted, it should not change.
      
      Cache the return value of virSystemdHasMachined.
      Allow starting and terminating machines with just one
      DBus call, instead of three, reducing the chance of
      the call timing out.
      
      Also introduce a small function for resetting the cache
      to be used in tests.
      f10bd740
    • J
      Use macros for testing virSystemd APIs · 27cdbcb9
      Ján Tomko 提交于
      This hides the unused third parameter from every line
      and prepares for resetting the environment after each test
      case in the future.
      27cdbcb9
  4. 08 6月, 2016 1 次提交
  5. 12 2月, 2016 1 次提交
  6. 11 2月, 2016 1 次提交
    • M
      dbus: Don't unref NULL messages · 862298a2
      Michal Privoznik 提交于
      Apparently we are not the only ones with dumb free functions
      because dbus_message_unref() does not accept NULL either. But if
      I were to vote, this one is even more evil. Instead of returning
      an error just like we do it immediately dereference any pointer
      passed and thus crash you app. Well done DBus!
      
        Program received signal SIGSEGV, Segmentation fault.
        [Switching to Thread 0x7f878ebda700 (LWP 31264)]
        0x00007f87be4016e5 in ?? () from /usr/lib64/libdbus-1.so.3
        (gdb) bt
        #0  0x00007f87be4016e5 in ?? () from /usr/lib64/libdbus-1.so.3
        #1  0x00007f87be3f004e in dbus_message_unref () from /usr/lib64/libdbus-1.so.3
        #2  0x00007f87bf6ecf95 in virSystemdGetMachineNameByPID (pid=9849) at util/virsystemd.c:228
        #3  0x00007f879761bd4d in qemuConnectCgroup (driver=0x7f87600a32a0, vm=0x7f87600c7550) at qemu/qemu_cgroup.c:909
        #4  0x00007f87976386b7 in qemuProcessReconnect (opaque=0x7f87600db840) at qemu/qemu_process.c:3386
        #5  0x00007f87bf6edfff in virThreadHelper (data=0x7f87600d5580) at util/virthread.c:206
        #6  0x00007f87bb602334 in start_thread (arg=0x7f878ebda700) at pthread_create.c:333
        #7  0x00007f87bb3481bd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
        (gdb) frame 2
        #2  0x00007f87bf6ecf95 in virSystemdGetMachineNameByPID (pid=9849) at util/virsystemd.c:228
        228         dbus_message_unref(reply);
        (gdb) p reply
        $1 = (DBusMessage *) 0x0
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      862298a2
  7. 05 2月, 2016 1 次提交
    • M
      systemd: Modernize machine naming · c3bd0019
      Martin Kletzander 提交于
      So, systemd-machined has this philosophy that machine names are like
      hostnames and hence should follow the same rules.  But we always allowed
      international characters in domain names.  Thus we need to modify the
      machine name we are passing to systemd.
      
      In order to change some machine names that we will be passing to systemd,
      we also need to call TerminateMachine at the end of a lifetime of a
      domain.  Even for domains that were started with older libvirt.  That
      can be achieved thanks to virSystemdGetMachineNameByPID().  And because
      we can change machine names, we can get rid of the inconsistent and
      pointless escaping of domain names when creating machine names.
      
      So this patch modifies the naming in the following way.  It creates the
      name as <drivername>-<id>-<name> where invalid hostname characters are
      stripped out of the name and if the resulting name is longer, it
      truncates it to 64 characters.  That way we can start domains we
      couldn't start before.  Well, at least on systemd.
      
      To make it work all together, the machineName (which is needed only with
      systemd) is saved in domain's private data.  That way the generation is
      moved to the driver and we don't need to pass various unnecessary
      arguments to cgroup functions.
      
      The only thing this complicates a bit is the scope generation when
      validating a cgroup where we must check both old and new naming, so a
      slight modification was needed there.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1282846Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      c3bd0019
  8. 03 2月, 2016 2 次提交
  9. 27 11月, 2015 1 次提交
  10. 26 11月, 2015 1 次提交
  11. 22 7月, 2015 1 次提交
    • P
      cgroup: Drop resource partition from virSystemdMakeScopeName · 88f6c007
      Peter Krempa 提交于
      The scope name, even according to our docs is
      "machine-$DRIVER\x2d$VMNAME.scope" virSystemdMakeScopeName would use the
      resource partition name instead of "machine-" if it was specified thus
      creating invalid scope paths.
      
      This makes libvirt drop cgroups for a VM that uses custom resource
      partition upon reconnecting since the detected scope name would not
      match the expected name generated by virSystemdMakeScopeName.
      
      The error is exposed by the following log entry:
      
      debug : virCgroupValidateMachineGroup:302 : Name 'machine-qemu\x2dtestvm.scope' for controller 'cpu' does not match 'testvm', 'testvm.libvirt-qemu' or 'machine-test-qemu\x2dtestvm.scope'
      
      for a "/machine/test" resource and "testvm" vm.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1238570
      88f6c007
  12. 15 1月, 2015 1 次提交
    • D
      Add support for systemd-machined CreateMachineWithNetwork · 318df5a0
      Daniel P. Berrange 提交于
      systemd-machined introduced a new method CreateMachineWithNetwork
      that obsoletes CreateMachine. It expects to be given a list of
      VETH/TAP device indexes for the host side device(s) associated
      with a container/machine.
      
      This falls back to the old CreateMachine method when the new
      one is not supported.
      318df5a0
  13. 12 9月, 2014 1 次提交
  14. 21 5月, 2014 1 次提交
    • E
      tests: avoid dlsym mocking on mingw · fa8701ea
      Eric Blake 提交于
      I got a build failure when cross-compiling to mingw with the
      mingw64-dbus package installed:
      
        CC       virmockdbus_la-virmockdbus.lo
      ../../tests/virmockdbus.c:29:6: error: 'dbus_connection_set_change_sigpipe' redeclared without dllimport attribute: previous dllimport ignored [-Werror=attributes]
       VIR_MOCK_STUB_VOID_ARGS(dbus_connection_set_change_sigpipe,
            ^
      ../../tests/virmockdbus.c:33:18: error: 'dbus_bus_get' redeclared without dllimport attribute: previous dllimport ignored [-Werror=attributes]
       VIR_MOCK_STUB_RET_ARGS(dbus_bus_get,
      ...
      
      Well duh - mingw lacks dlopen and friends, even if it can support
      dbus.  A similar failure occured in virsystemdtest.c; but in that
      file, we know that systemd is a Linux-only concept.
      
      * tests/virmockdbus.c: Cripple on mingw.
      * tests/virsystemdtest.c: Cripple on non-Linux.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      fa8701ea
  15. 12 4月, 2014 1 次提交
  16. 08 4月, 2014 1 次提交
  17. 18 3月, 2014 2 次提交
  18. 04 3月, 2014 1 次提交
  19. 08 10月, 2013 1 次提交
  20. 30 9月, 2013 1 次提交
  21. 18 9月, 2013 1 次提交
    • E
      build: skip ld_preload tests on non-Linux systems · caf65892
      Eric Blake 提交于
      A cross build to mingw fails with:
      
        CC       virsystemdtest-virsystemdtest.o
      ../../tests/virsystemdtest.c: In function 'testCreateNoSystemd':
      ../../tests/virsystemdtest.c:97:9: error: implicit declaration of function 'unsetenv' [-Werror=implicit-function-declaration]
               unsetenv("FAIL_NO_SERVICE");
               ^
      ../../tests/virsystemdtest.c:97:9: error: nested extern declaration of 'unsetenv' [-Werror=nested-externs]
      
      We could cop out and pull in the gnulib unsetenv module.  But when
      you stop and think about it, this test requires LD_PRELOAD to work,
      and systemd is a Linux-only concept anyways, both of which mean
      the test could never work on mingw in the first place.  Simpler is
      to just fix the test to behave like our other LD_PRELOAD tests.
      
      * tests/virsystemdtest.c: Provide non-Linux implementation.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      caf65892
  22. 11 9月, 2013 1 次提交
  23. 01 8月, 2013 1 次提交
  24. 24 7月, 2013 1 次提交
  25. 22 7月, 2013 1 次提交