Skip to content
Snippets Groups Projects
  1. Jul 18, 2022
  2. Jul 13, 2022
  3. Jul 08, 2022
  4. Jun 06, 2022
  5. May 28, 2022
  6. May 25, 2022
  7. May 16, 2022
  8. May 14, 2022
  9. May 07, 2022
  10. May 04, 2022
    • Zhenwei Pi's avatar
      qga: Introduce disk smart · 22668881
      Zhenwei Pi authored
      
      After assigning a NVMe/SCSI controller to guest by VFIO, we lose
      everything on the host side. A guest uses these devices exclusively,
      we usually don't care the actions on these devices. But there is a
      low probability that hitting physical hardware warning, we need a
      chance to get the basic smart log info.
      
      Introduce disk smart, and implement NVMe smart on linux.
      
      Thanks to Keith and Marc-André.
      
      CC: Keith Busch <kbusch@kernel.org>
      Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Signed-off-by: default avatarzhenwei pi <pizhenwei@bytedance.com>
      Message-Id: <20220420022610.418052-3-pizhenwei@bytedance.com>
      22668881
    • Zhenwei Pi's avatar
      qga: Introduce NVMe disk bus type · d48f61c8
      Zhenwei Pi authored
      
      Assigning a NVMe disk by VFIO or emulating a NVMe controller by QEMU,
      a NVMe disk get exposed in guest side. Support NVMe disk bus type and
      implement posix version.
      
      Test PCI passthrough case:
      ~#virsh qemu-agent-command buster '{"execute":"guest-get-disks"}' | jq
        ...
          {
            "name": "/dev/nvme0n1",
            "dependencies": [],
            "partition": false,
            "address": {
              "serial": "SAMSUNG MZQL23T8HCLS-00A07_S64HNE0N500076",
              "bus-type": "nvme",
              "bus": 0,
              "unit": 0,
              "pci-controller": {
                "bus": 0,
                "slot": 22,
                "domain": 0,
                "function": 0
              },
              "dev": "/dev/nvme0n1",
              "target": 0
            }
        ...
      
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Signed-off-by: default avatarzhenwei pi <pizhenwei@bytedance.com>
      Message-Id: <20220420022610.418052-2-pizhenwei@bytedance.com>
      d48f61c8
    • Andrew Deason's avatar
      qga/commands-posix: 'guest-shutdown' for Solaris · c8ec041d
      Andrew Deason authored
      
      On Solaris, instead of the -P, -H, and -r flags, we need to provide
      the target init state to the 'shutdown' command: state 5 is poweroff,
      0 is halt, and 6 is reboot. We also need to pass -g0 to avoid the
      default 60-second delay, and -y to avoid a confirmation prompt.
      
      Implement this logic under an #ifdef CONFIG_SOLARIS, so the
      'guest-shutdown' command works properly on Solaris.
      
      Signed-off-by: default avatarAndrew Deason <adeason@sinenomine.net>
      Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-Id: <20220426195526.7699-6-adeason@sinenomine.net>
      c8ec041d
    • Andrew Deason's avatar
      qga/commands-posix: Log all net stats failures · a539dc8a
      Andrew Deason authored
      
      guest_get_network_stats can silently fail in a couple of ways. Add
      debug messages to these cases, so we're never completely silent on
      failure.
      
      Signed-off-by: default avatarAndrew Deason <adeason@sinenomine.net>
      Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-Id: <20220426195526.7699-5-adeason@sinenomine.net>
      a539dc8a
    • Andrew Deason's avatar
      qga/commands-posix: Fix listing ifaces for Solaris · 70335c46
      Andrew Deason authored
      
      The code for guest-network-get-interfaces needs a couple of small
      adjustments for Solaris:
      
      - The results from SIOCGIFHWADDR are documented as being in ifr_addr,
        not ifr_hwaddr (ifr_hwaddr doesn't exist on Solaris).
      
      - The implementation of guest_get_network_stats is Linux-specific, so
        hide it under #ifdef CONFIG_LINUX. On non-Linux, we just won't
        provide network interface stats.
      
      Signed-off-by: default avatarAndrew Deason <adeason@sinenomine.net>
      Reviewed-by: default avatarMichal Privoznik <mprivozn@redhat.com>
      Message-Id: <20220426195526.7699-4-adeason@sinenomine.net>
      70335c46
    • Andrew Deason's avatar
      qga/commands-posix: Fix iface hw address detection · aec0730e
      Andrew Deason authored
      
      Since its introduction in commit 3424fc9f ("qemu-ga: add
      guest-network-get-interfaces command"), guest-network-get-interfaces
      seems to check if a given interface has a hardware address by checking
      'ifa->ifa_flags & SIOCGIFHWADDR'. But ifa_flags is a field for IFF_*
      flags (IFF_UP, IFF_LOOPBACK, etc), and comparing it to an ioctl like
      SIOCGIFHWADDR doesn't make sense.
      
      On Linux, this isn't a big deal, since SIOCGIFHWADDR has so many bits
      set (0x8927), 'ifa->ifa_flags & SIOCGIFHWADDR' will usually have a
      nonzero result for any 'normal'-looking interfaces: anything with
      IFF_UP (0x1) or IFF_BROADCAST (0x2) set, as well as several
      less-common flags. This means we'll try to get the hardware address
      for most/all interfaces, even those that don't really have one (like
      the loopback device). For those interfaces, Linux just returns a
      hardware address of all zeroes.
      
      On Solaris, however, trying to get the hardware address for a loopback
      device returns an EADDRNOTAVAIL error. This causes us to return an
      error and the entire guest-network-get-interfaces call fails.
      
      Change this logic to always try to get the hardware address for each
      interface, and don't return an error if we fail to get it. Instead,
      just don't include the 'hardware-address' field in the result if we
      can't get the hardware address.
      
      Signed-off-by: default avatarAndrew Deason <adeason@sinenomine.net>
      Reviewed-by: default avatarMichal Privoznik <mprivozn@redhat.com>
      Message-Id: <20220426195526.7699-3-adeason@sinenomine.net>
      aec0730e
    • Andrew Deason's avatar
      qga/commands-posix: Use getifaddrs when available · 59e35c7b
      Andrew Deason authored
      
      Currently, commands-posix.c assumes that getifaddrs() is only
      available on Linux, and so the related guest agent command
      guest-network-get-interfaces is only implemented for #ifdef __linux__.
      This function does exist on other platforms, though, such as Solaris.
      So, add a meson check for getifaddrs(), and move the code for
      guest-network-get-interfaces to be built whenever getifaddrs() is
      available.
      
      The implementation for guest-network-get-interfaces still has some
      Linux-specific code, which is not fixed in this commit. This commit
      moves the relevant big chunks of code around without changing them, so
      a future commit can change the code in place.
      
      Signed-off-by: default avatarAndrew Deason <adeason@sinenomine.net>
      Reviewed-by: default avatarMichal Privoznik <mprivozn@redhat.com>
      Message-Id: <20220426195526.7699-2-adeason@sinenomine.net>
      59e35c7b
  11. May 03, 2022
  12. Apr 28, 2022
  13. Apr 21, 2022
  14. Apr 06, 2022
Loading