@@ -1219,7 +1219,8 @@ int kvm_init(void)
s->vmfd = -1;
s->fd = qemu_open("/dev/kvm", O_RDWR);
if (s->fd == -1) {
- fprintf(stderr, "Could not access KVM kernel module: %m\n");
+ fprintf(stderr, "Could not access KVM kernel module: %s\n",
+ strerror(errno));
ret = -errno;
goto err;
}
@@ -116,7 +116,7 @@ static void sigfd_handler(void *opaque)
}
if (len != sizeof(info)) {
- printf("read from sigfd returned %zd: %m\n", len);
+ printf("read from sigfd returned %zd: %s\n", len, strerror(errno));
return;
}
@@ -42,7 +42,7 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr, int vnet_hdr_required
TFR(fd = open(PATH_NET_TUN, O_RDWR));
if (fd < 0) {
- error_report("could not open %s: %m", PATH_NET_TUN);
+ error_report("could not open %s: %s", PATH_NET_TUN, strerror(errno));
return -1;
}
memset(&ifr, 0, sizeof(ifr));
@@ -74,9 +74,11 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr, int vnet_hdr_required
ret = ioctl(fd, TUNSETIFF, (void *) &ifr);
if (ret != 0) {
if (ifname[0] != '\0') {
- error_report("could not configure %s (%s): %m", PATH_NET_TUN, ifr.ifr_name);
+ error_report("could not configure %s (%s): %s", PATH_NET_TUN,
+ ifr.ifr_name, strerror(errno));
} else {
- error_report("could not configure %s: %m", PATH_NET_TUN);
+ error_report("could not configure %s: %s", PATH_NET_TUN,
+ strerror(errno));
}
close(fd);
return -1;
@@ -213,8 +213,7 @@ static void *nbd_client_thread(void *arg)
fd = open(device, O_RDWR);
if (fd < 0) {
- /* Linux-only, we can use %m in printf. */
- fprintf(stderr, "Failed to open %s: %m", device);
+ fprintf(stderr, "Failed to open %s: %s", device, strerror(errno));
goto out;
}