1. 18 12月, 2018 1 次提交
  2. 31 10月, 2018 3 次提交
  3. 17 7月, 2018 2 次提交
  4. 04 7月, 2018 8 次提交
    • D
      qga: removing bios_supports_mode · 73e1d8eb
      Daniel Henrique Barboza 提交于
      bios_support_mode verifies if the guest has support for a certain
      suspend mode but it doesn't inform back which suspend tool
      provides it. The caller, guest_suspend, executes all suspend
      strategies in order again.
      
      After adding systemd suspend support, bios_support_mode now will
      verify for support for systemd, then pmutils, then Linux sys state
      file. In a worst case scenario where both systemd and pmutils isn't
      supported but Linux sys state is:
      
      - bios_supports_mode will check for systemd, then pmutils, then
      Linux sys state. It will tell guest_suspend that there is support,
      but it will not tell who provides it;
      
      - guest_suspend will try to execute (and fail) systemd suspend,
      then pmutils suspend, to only then use the Linux sys suspend.
      The time spent executing systemd and pmutils suspend was wasted
      and could be avoided, but only bios_support_mode knew it but
      didn't inform it back.
      
      A quicker approach is to nuke bios_supports_mode and control
      whether we found support at all with a bool flag inside
      guest_suspend. guest_suspend will search for suspend support
      and execute it as soon as possible. If the a given suspend
      mechanism fails, continue to the next. If no suspend
      support is found, the "not supported" message is still being
      sent back to the user.
      Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
      Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
      73e1d8eb
    • D
      qga: systemd hibernate/suspend/hybrid-sleep support · 067927d6
      Daniel Henrique Barboza 提交于
      pmutils isn't being supported by newer OSes like Fedora 27
      or Mint. This means that the only suspend option QGA offers
      for these guests are writing directly into the Linux sys state
      file. This also means that QGA also loses the ability to do
      hybrid suspend in those guests - this suspend mode is only
      available when using pmutils.
      
      Newer guests can use systemd facilities to do all the suspend
      types QGA supports. The mapping in comparison with pmutils is:
      
      - pm-hibernate -> systemctl hibernate
      - pm-suspend -> systemctl suspend
      - pm-suspend-hybrid -> systemctl hybrid-sleep
      
      To discover whether systemd supports these functions, we inspect
      the status of the services that implements them.
      
      With this patch, we can offer hybrid suspend again for newer
      guests that do not have pmutils support anymore.
      Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
      Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
      067927d6
    • D
      qga: removing switch statements, adding run_process_child · 8b020b5e
      Daniel Henrique Barboza 提交于
      This is a cleanup of the resulting code after detaching
      pmutils and Linux sys state file logic:
      
      - remove the SUSPEND_MODE_* macros and use an enumeration
      instead. At the same time, drop the switch statements
      at the start of each function and use the enumeration
      index to get the right binary/argument;
      
      - create a new function called run_process_child(). This
      function uses g_spawn_sync() to execute a shell command,
      returning the exit code. This is a common operation in the
      pmutils functions and will be used in the systemd implementation
      as well, so this function will avoid code repetition.
      
      There are more places inside commands-posix.c where this new
      run_process_child function can also be used, but one step
      at a time.
      Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
      *check/propagate local_err before setting errp directly
      Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
      8b020b5e
    • D
      qga: guest_suspend: decoupling pm-utils and sys logic · 246d76eb
      Daniel Henrique Barboza 提交于
      Following the same logic of the previous patch, let's also
      decouple the suspend logic from guest_suspend into specialized
      functions, one for each strategy we support at this moment.
      Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
      Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
      246d76eb
    • D
      qga: bios_supports_mode: decoupling pm-utils and sys logic · a5fcf0e3
      Daniel Henrique Barboza 提交于
      In bios_supports_mode there is a verification to assert if
      the chosen suspend mode is supported by the pmutils tools and,
      if not, we see if the Linux sys state files supports it.
      
      This verification is done in the same function, one after
      the other, and it works for now. But, when adding a new
      suspend mechanism that will not necessarily follow the same
      return 0 or 1 logic of pmutils, this code will be hard
      to deal with.
      
      This patch decouple the two existing logics into their own
      functions, pmutils_supports_mode and linux_sys_state_supports_mode,
      which in turn are used inside bios_support_mode. The existing
      logic is kept but now it's easier to extend it.
      Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
      Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
      a5fcf0e3
    • D
      qga: refactoring qmp_guest_suspend_* functions · 304a0fcb
      Daniel Henrique Barboza 提交于
      To be able to add new suspend mechanisms we need to detach
      the existing QMP functions from the current implementation
      specifics.
      
      At this moment we have functions such as qmp_guest_suspend_ram
      calling bios_suspend_mode and guest_suspend passing the
      pmutils command and arguments as parameters. This patch
      removes this logic from the QMP functions, moving them to
      the respective functions that will have to deal with which
      binary to use.
      Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
      Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
      304a0fcb
    • M
      qemu-ga: make get-fsinfo work over pci bridges · 743c71d0
      Marc-André Lureau 提交于
      Iterate over the PCI bridges to lookup the PCI device associated with
      the block device.
      
      This allows to lookup the driver under the following syspath:
      /sys/devices/pci0000:00/0000:00:02.2/0000:03:00.0/virtio2/block/vda/vda3
      
      It also works with an "old-style" Q35 libvirt hierarchy: root complex
      -> DMI-PCI bridge -> PCI-PCI bridge -> virtio controller, ex:
      /sys/devices/pci0000:00/0000:00:03.0/0000:01:01.0/0000:02:01.0/virtio1/block/vda/vda3
      
      The setup can be reproduced with the following qemu command line
      (Thanks Marcel for help):
      
      qemu-system-x86_64 -M q35 \
        -device i82801b11-bridge,id=dmi2pci_bridge,bus=pcie.0
        -device pci-bridge,id=pci_bridge,bus=dmi2pci_bridge,addr=0x1,chassis_nr=1
        -device virtio-blk-pci,scsi=off,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1,bus=pci_bridge,addr=0x1
      
      For consistency with other syspath-related debug messages, replace a
      \"%s\" in the message with '%s'.
      
      Fixes:
      https://bugzilla.redhat.com/show_bug.cgi?id=1567041Signed-off-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Reviewed-by: NLaszlo Ersek <lersek@redhat.com>
      Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
      743c71d0
    • C
      qga: add mountpoint usage info to GuestFilesystemInfo · 25b5ff1a
      Chen Hanxiao 提交于
      This patch adds support for getting the usage of mounted
      filesystem.
      The usage of fs stored as used_bytes and total_bytes.
      It's very useful when we try to monitor guest's filesystem.
      
      Cc: Michael Roth <mdroth@linux.vnet.ibm.com>
      Cc: Daniel P. Berrangé <berrange@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NChen Hanxiao <chenhanxiao@gmail.com>
      Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
      25b5ff1a
  5. 03 7月, 2018 2 次提交
  6. 02 6月, 2018 1 次提交
  7. 06 3月, 2018 1 次提交
  8. 03 3月, 2018 1 次提交
  9. 10 2月, 2018 1 次提交
  10. 09 2月, 2018 1 次提交
  11. 26 10月, 2017 1 次提交
  12. 18 7月, 2017 3 次提交
  13. 04 6月, 2017 1 次提交
  14. 07 5月, 2017 1 次提交
  15. 27 4月, 2017 1 次提交
    • V
      qga: Add 'guest-get-users' command · 161a56a9
      Vinzenz Feenstra 提交于
      A command that will list all currently logged in users, and the time
      since when they are logged in.
      
      Examples:
      
      virsh # qemu-agent-command F25 '{ "execute": "guest-get-users" }'
      {"return":[{"login-time":1490622289.903835,"user":"root"}]}
      
      virsh # qemu-agent-command Win2k12r2 '{ "execute": "guest-get-users" }'
      {"return":[{"login-time":1490351044.670552,"domain":"LADIDA",
      "user":"Administrator"}]}
      Signed-off-by: NVinzenz Feenstra <vfeenstr@redhat.com>
      * make g_hash_table_contains compat func inline to avoid
        unused warnings
      Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
      161a56a9
  16. 31 3月, 2017 1 次提交
    • M
      qga: don't fail if mount doesn't have slave devices · 8251a72f
      Michael Roth 提交于
      In some cases the slave devices of a virtual block device are tracked
      by the parent in the corresponding sysfs node. For instance, if we
      have a loop-back mount of the form:
      
        /dev/loop3p1 on /home/mdroth/mnt type ext4 (rw,relatime,data=ordered)
      
      this will be reflected in sysfs as:
      
        /sys/devices/virtual/block/loop3/
        ...
        /sys/devices/virtual/block/loop3/slaves
        /sys/devices/virtual/block/loop3/loop3p1
      
      The current code however assumes the mounted virtual block device,
      loop3p1 in this case, contains the slaves directory, and reports an
      error otherwise. This breaks 'make check' in certain environments.
      
      Fix this by simply skipping attempts to generate disk topology
      information in these cases. Since this information is documented
      in QAPI as optionally-reported, this should be ok from an API
      perspective.
      
      In the future, this can possibly be improved upon by collecting
      topology information from the parent in these cases.
      Reported-by: NPeter Maydell <peter.maydell@linaro.org>
      Cc: Peter Maydell <peter.maydell@linaro.org>
      Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
      Tested-by: NPeter Maydell <peter.maydell@linaro.org>
      8251a72f
  17. 06 3月, 2017 1 次提交
  18. 20 6月, 2016 1 次提交
    • E
      coccinelle: Remove unnecessary variables for function return value · 9be38598
      Eduardo Habkost 提交于
      Use Coccinelle script to replace 'ret = E; return ret' with
      'return E'. The script will do the substitution only when the
      function return type and variable type are the same.
      
      Manual fixups:
      
      * audio/audio.c: coding style of "read (...)" and "write (...)"
      * block/qcow2-cluster.c: wrap line to make it shorter
      * block/qcow2-refcount.c: change indentation of wrapped line
      * target-tricore/op_helper.c: fix coding style of
        "remainder|quotient"
      * target-mips/dsp_helper.c: reverted changes because I don't
        want to argue about checkpatch.pl
      * ui/qemu-pixman.c: fix line indentation
      * block/rbd.c: restore blank line between declarations and
        statements
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      Message-Id: <1465855078-19435-4-git-send-email-ehabkost@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      [Unused Coccinelle rule name dropped along with a redundant comment;
      whitespace touched up in block/qcow2-cluster.c; stale commit message
      paragraph deleted]
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      9be38598
  19. 07 6月, 2016 2 次提交
  20. 23 3月, 2016 1 次提交
  21. 25 2月, 2016 1 次提交
  22. 05 2月, 2016 1 次提交
    • P
      qga: Clean up includes · 4459bf38
      Peter Maydell 提交于
      Clean up includes so that osdep.h is included first and headers
      which it implies are not included manually.
      
      This commit was created with scripts/clean-includes.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Message-id: 1454089805-5470-9-git-send-email-peter.maydell@linaro.org
      4459bf38
  23. 13 1月, 2016 1 次提交
  24. 19 12月, 2015 1 次提交
  25. 26 11月, 2015 2 次提交