diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 8b8bc5a421..b46b1305a7 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -3871,7 +3871,7 @@ static void vfio_pci_class_init(ObjectClass *klass, const void *data) "(DEBUG)"); object_class_property_set_description(klass, /* 5.2, 8.0 non-experimetal */ "enable-migration", - "Enale device migration. Also requires a host VFIO PCI " + "Enable device migration. Also requires a host VFIO PCI " "variant or mdev driver with migration support enabled"); object_class_property_set_description(klass, /* 8.1 */ "vf-token", diff --git a/hw/virtio/virtio-qmp.c b/hw/virtio/virtio-qmp.c index b338344c6c..968299fda0 100644 --- a/hw/virtio/virtio-qmp.c +++ b/hw/virtio/virtio-qmp.c @@ -299,7 +299,7 @@ static const qmp_virtio_feature_map_t virtio_net_feature_map[] = { FEATURE_ENTRY(VIRTIO_NET_F_GUEST_USO4, \ "VIRTIO_NET_F_GUEST_USO4: Driver can receive USOv4"), FEATURE_ENTRY(VIRTIO_NET_F_GUEST_USO6, \ - "VIRTIO_NET_F_GUEST_USO4: Driver can receive USOv6"), + "VIRTIO_NET_F_GUEST_USO6: Driver can receive USOv6"), FEATURE_ENTRY(VIRTIO_NET_F_HOST_USO, \ "VIRTIO_NET_F_HOST_USO: Device can receive USO"), FEATURE_ENTRY(VIRTIO_NET_F_HASH_REPORT, \ diff --git a/qga/commands-posix.c b/qga/commands-posix.c index 66f3e6f673..837be51c40 100644 --- a/qga/commands-posix.c +++ b/qga/commands-posix.c @@ -216,12 +216,6 @@ out: return retcode; } -static bool file_exists(const char *path) -{ - struct stat st; - return stat(path, &st) == 0 && (S_ISREG(st.st_mode) || S_ISLNK(st.st_mode)); -} - #define POWEROFF_CMD_PATH "/sbin/poweroff" #define HALT_CMD_PATH "/sbin/halt" #define REBOOT_CMD_PATH "/sbin/reboot" @@ -248,17 +242,17 @@ void qmp_guest_shutdown(const char *mode, Error **errp) slog("guest-shutdown called, mode: %s", mode); if (!mode || strcmp(mode, "powerdown") == 0) { - if (file_exists(POWEROFF_CMD_PATH)) { + if (access(POWEROFF_CMD_PATH, X_OK) == 0) { shutdown_cmd = POWEROFF_CMD_PATH; } shutdown_flag = powerdown_flag; } else if (strcmp(mode, "halt") == 0) { - if (file_exists(HALT_CMD_PATH)) { + if (access(HALT_CMD_PATH, X_OK) == 0) { shutdown_cmd = HALT_CMD_PATH; } shutdown_flag = halt_flag; } else if (strcmp(mode, "reboot") == 0) { - if (file_exists(REBOOT_CMD_PATH)) { + if (access(REBOOT_CMD_PATH, X_OK) == 0) { shutdown_cmd = REBOOT_CMD_PATH; } shutdown_flag = reboot_flag;