qga-win32-pull-2022-05-25
-----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEwsLBCepDxjwUI+uE711egWG6hOcFAmKN8xQACgkQ711egWG6 hOd1UA/9GJ/rBSnulyEwIyw5bZ2u6eihehHhKCfeVuak769r5+DPYblkvu0+j1WI 9pKCEMsX807+F+Xz+0d9JXQo8++8M3HmgvsKgtRvdg5iAaPIIWLIKOi745NhM4dc /VRWzFl96NQYbpVx9XB4QBnRMhlceTp7e9Km+FZBcjJzaIrd7O85CiRtpItQsaOZ DgANH+XX39eTYGnzuvOBxYjRf+bkh5MIFoS7/hnLTmB4PFvm/cig40WkolWerdbk x2ZYfv9uUTGEsDjGido63A3wvc7zGJOY+hJWo0Tves2NHOTHF7UQScLM/xEydwQA hMvh4qIQ/98JWsPCJe0SlDVA7xwE+/nB3xneSSj4xSXcTGy3kTdOhlWkGLSKzj25 dHvnu35eB8W52eLowsTl0d/cpRpInLspi/t1MziFkyOA/GMk9p5MhawKoLfEaH9E 9LTj7c/ONNMOdrVXH0LfNR7KBxSOaK8Gy0hsqJqu9MPQyX3A0N5+KUTqi5yx6oQm TfDkMsIjNDg3xLhpyKxGOsmGDjIYbOF6Q32Ehy/JZVpc8GJ/63nDJfDP9YXxZ4PE MyyccmIzAKotQA1SnATl1Z+bGjRMW5NfcNRcnlNxLnvXNC1byvcrGehlqsraWZ09 EGZLEbRtL7Hckm/MnKTnqbHtSBgZz04G78Dy3A4gxUpypRLmaDc= =lA0c -----END PGP SIGNATURE----- Merge tag 'qga-win32-pull-2022-05-25' of github.com:kostyanf14/qemu into staging qga-win32-pull-2022-05-25 # -----BEGIN PGP SIGNATURE----- # # iQIzBAABCgAdFiEEwsLBCepDxjwUI+uE711egWG6hOcFAmKN8xQACgkQ711egWG6 # hOd1UA/9GJ/rBSnulyEwIyw5bZ2u6eihehHhKCfeVuak769r5+DPYblkvu0+j1WI # 9pKCEMsX807+F+Xz+0d9JXQo8++8M3HmgvsKgtRvdg5iAaPIIWLIKOi745NhM4dc # /VRWzFl96NQYbpVx9XB4QBnRMhlceTp7e9Km+FZBcjJzaIrd7O85CiRtpItQsaOZ # DgANH+XX39eTYGnzuvOBxYjRf+bkh5MIFoS7/hnLTmB4PFvm/cig40WkolWerdbk # x2ZYfv9uUTGEsDjGido63A3wvc7zGJOY+hJWo0Tves2NHOTHF7UQScLM/xEydwQA # hMvh4qIQ/98JWsPCJe0SlDVA7xwE+/nB3xneSSj4xSXcTGy3kTdOhlWkGLSKzj25 # dHvnu35eB8W52eLowsTl0d/cpRpInLspi/t1MziFkyOA/GMk9p5MhawKoLfEaH9E # 9LTj7c/ONNMOdrVXH0LfNR7KBxSOaK8Gy0hsqJqu9MPQyX3A0N5+KUTqi5yx6oQm # TfDkMsIjNDg3xLhpyKxGOsmGDjIYbOF6Q32Ehy/JZVpc8GJ/63nDJfDP9YXxZ4PE # MyyccmIzAKotQA1SnATl1Z+bGjRMW5NfcNRcnlNxLnvXNC1byvcrGehlqsraWZ09 # EGZLEbRtL7Hckm/MnKTnqbHtSBgZz04G78Dy3A4gxUpypRLmaDc= # =lA0c # -----END PGP SIGNATURE----- # gpg: Signature made Wed 25 May 2022 02:12:52 AM PDT # gpg: using RSA key C2C2C109EA43C63C1423EB84EF5D5E8161BA84E7 # gpg: Good signature from "Kostiantyn Kostiuk (Upstream PR sign) <kkostiuk@redhat.com>" [unknown] # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: C2C2 C109 EA43 C63C 1423 EB84 EF5D 5E81 61BA 84E7 * tag 'qga-win32-pull-2022-05-25' of github.com:kostyanf14/qemu: qga-win32: Add support for NVME bus type tests: Bump Fedora image version for cross-compilation trivial: qga: Log version on start qga: add guest-get-diskstats command for Linux guests Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
commit
ffae6d9585
@ -2783,6 +2783,122 @@ GuestMemoryBlockInfo *qmp_guest_get_memory_block_info(Error **errp)
|
||||
return info;
|
||||
}
|
||||
|
||||
#define MAX_NAME_LEN 128
|
||||
static GuestDiskStatsInfoList *guest_get_diskstats(Error **errp)
|
||||
{
|
||||
#ifdef CONFIG_LINUX
|
||||
GuestDiskStatsInfoList *head = NULL, **tail = &head;
|
||||
const char *diskstats = "/proc/diskstats";
|
||||
FILE *fp;
|
||||
size_t n;
|
||||
char *line = NULL;
|
||||
|
||||
fp = fopen(diskstats, "r");
|
||||
if (fp == NULL) {
|
||||
error_setg_errno(errp, errno, "open(\"%s\")", diskstats);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
while (getline(&line, &n, fp) != -1) {
|
||||
g_autofree GuestDiskStatsInfo *diskstatinfo = NULL;
|
||||
g_autofree GuestDiskStats *diskstat = NULL;
|
||||
char dev_name[MAX_NAME_LEN];
|
||||
unsigned int ios_pgr, tot_ticks, rq_ticks, wr_ticks, dc_ticks, fl_ticks;
|
||||
unsigned long rd_ios, rd_merges_or_rd_sec, rd_ticks_or_wr_sec, wr_ios;
|
||||
unsigned long wr_merges, rd_sec_or_wr_ios, wr_sec;
|
||||
unsigned long dc_ios, dc_merges, dc_sec, fl_ios;
|
||||
unsigned int major, minor;
|
||||
int i;
|
||||
|
||||
i = sscanf(line, "%u %u %s %lu %lu %lu"
|
||||
"%lu %lu %lu %lu %u %u %u %u"
|
||||
"%lu %lu %lu %u %lu %u",
|
||||
&major, &minor, dev_name,
|
||||
&rd_ios, &rd_merges_or_rd_sec, &rd_sec_or_wr_ios,
|
||||
&rd_ticks_or_wr_sec, &wr_ios, &wr_merges, &wr_sec,
|
||||
&wr_ticks, &ios_pgr, &tot_ticks, &rq_ticks,
|
||||
&dc_ios, &dc_merges, &dc_sec, &dc_ticks,
|
||||
&fl_ios, &fl_ticks);
|
||||
|
||||
if (i < 7) {
|
||||
continue;
|
||||
}
|
||||
|
||||
diskstatinfo = g_new0(GuestDiskStatsInfo, 1);
|
||||
diskstatinfo->name = g_strdup(dev_name);
|
||||
diskstatinfo->major = major;
|
||||
diskstatinfo->minor = minor;
|
||||
|
||||
diskstat = g_new0(GuestDiskStats, 1);
|
||||
if (i == 7) {
|
||||
diskstat->has_read_ios = true;
|
||||
diskstat->read_ios = rd_ios;
|
||||
diskstat->has_read_sectors = true;
|
||||
diskstat->read_sectors = rd_merges_or_rd_sec;
|
||||
diskstat->has_write_ios = true;
|
||||
diskstat->write_ios = rd_sec_or_wr_ios;
|
||||
diskstat->has_write_sectors = true;
|
||||
diskstat->write_sectors = rd_ticks_or_wr_sec;
|
||||
}
|
||||
if (i >= 14) {
|
||||
diskstat->has_read_ios = true;
|
||||
diskstat->read_ios = rd_ios;
|
||||
diskstat->has_read_sectors = true;
|
||||
diskstat->read_sectors = rd_sec_or_wr_ios;
|
||||
diskstat->has_read_merges = true;
|
||||
diskstat->read_merges = rd_merges_or_rd_sec;
|
||||
diskstat->has_read_ticks = true;
|
||||
diskstat->read_ticks = rd_ticks_or_wr_sec;
|
||||
diskstat->has_write_ios = true;
|
||||
diskstat->write_ios = wr_ios;
|
||||
diskstat->has_write_sectors = true;
|
||||
diskstat->write_sectors = wr_sec;
|
||||
diskstat->has_write_merges = true;
|
||||
diskstat->write_merges = wr_merges;
|
||||
diskstat->has_write_ticks = true;
|
||||
diskstat->write_ticks = wr_ticks;
|
||||
diskstat->has_ios_pgr = true;
|
||||
diskstat->ios_pgr = ios_pgr;
|
||||
diskstat->has_total_ticks = true;
|
||||
diskstat->total_ticks = tot_ticks;
|
||||
diskstat->has_weight_ticks = true;
|
||||
diskstat->weight_ticks = rq_ticks;
|
||||
}
|
||||
if (i >= 18) {
|
||||
diskstat->has_discard_ios = true;
|
||||
diskstat->discard_ios = dc_ios;
|
||||
diskstat->has_discard_merges = true;
|
||||
diskstat->discard_merges = dc_merges;
|
||||
diskstat->has_discard_sectors = true;
|
||||
diskstat->discard_sectors = dc_sec;
|
||||
diskstat->has_discard_ticks = true;
|
||||
diskstat->discard_ticks = dc_ticks;
|
||||
}
|
||||
if (i >= 20) {
|
||||
diskstat->has_flush_ios = true;
|
||||
diskstat->flush_ios = fl_ios;
|
||||
diskstat->has_flush_ticks = true;
|
||||
diskstat->flush_ticks = fl_ticks;
|
||||
}
|
||||
|
||||
diskstatinfo->stats = g_steal_pointer(&diskstat);
|
||||
QAPI_LIST_APPEND(tail, diskstatinfo);
|
||||
diskstatinfo = NULL;
|
||||
}
|
||||
free(line);
|
||||
fclose(fp);
|
||||
return head;
|
||||
#else
|
||||
g_debug("disk stats reporting available only for Linux");
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
GuestDiskStatsInfoList *qmp_guest_get_diskstats(Error **errp)
|
||||
{
|
||||
return guest_get_diskstats(errp);
|
||||
}
|
||||
|
||||
#else /* defined(__linux__) */
|
||||
|
||||
void qmp_guest_suspend_disk(Error **errp)
|
||||
@ -3131,6 +3247,13 @@ GuestDiskInfoList *qmp_guest_get_disks(Error **errp)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
GuestDiskStatsInfoList *qmp_guest_get_diskstats(Error **errp)
|
||||
{
|
||||
error_setg(errp, QERR_UNSUPPORTED);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
#endif /* CONFIG_FSFREEZE */
|
||||
|
||||
#if !defined(CONFIG_FSTRIM)
|
||||
|
@ -490,6 +490,11 @@ static GuestDiskBusType win2qemu[] = {
|
||||
#if (_WIN32_WINNT >= 0x0601)
|
||||
[BusTypeVirtual] = GUEST_DISK_BUS_TYPE_VIRTUAL,
|
||||
[BusTypeFileBackedVirtual] = GUEST_DISK_BUS_TYPE_FILE_BACKED_VIRTUAL,
|
||||
/*
|
||||
* BusTypeSpaces currently is not suported
|
||||
*/
|
||||
[BusTypeSpaces] = GUEST_DISK_BUS_TYPE_UNKNOWN,
|
||||
[BusTypeNvme] = GUEST_DISK_BUS_TYPE_NVME,
|
||||
#endif
|
||||
};
|
||||
|
||||
@ -2532,3 +2537,9 @@ char *qga_get_host_name(Error **errp)
|
||||
|
||||
return g_utf16_to_utf8(tmp, size, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
GuestDiskStatsInfoList *qmp_guest_get_diskstats(Error **errp)
|
||||
{
|
||||
error_setg(errp, QERR_UNSUPPORTED);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -1271,6 +1271,8 @@ static GAState *initialize_agent(GAConfig *config, int socket_activation)
|
||||
g_log_set_fatal_mask(NULL, G_LOG_LEVEL_ERROR);
|
||||
ga_enable_logging(s);
|
||||
|
||||
g_debug("Guest agent version %s started", QEMU_FULL_VERSION);
|
||||
|
||||
#ifdef _WIN32
|
||||
/* On win32 the state directory is application specific (be it the default
|
||||
* or a user override). We got past the command line parsing; let's create
|
||||
|
@ -1490,3 +1490,89 @@
|
||||
{ 'command': 'guest-ssh-remove-authorized-keys',
|
||||
'data': { 'username': 'str', 'keys': ['str'] },
|
||||
'if': 'CONFIG_POSIX' }
|
||||
|
||||
##
|
||||
# @GuestDiskStats:
|
||||
#
|
||||
# @read-sectors: sectors read
|
||||
#
|
||||
# @read-ios: reads completed successfully
|
||||
#
|
||||
# @read-merges: read requests merged
|
||||
#
|
||||
# @write-sectors: sectors written
|
||||
#
|
||||
# @write-ios: writes completed
|
||||
#
|
||||
# @write-merges: write requests merged
|
||||
#
|
||||
# @discard-sectors: sectors discarded
|
||||
#
|
||||
# @discard-ios: discards completed successfully
|
||||
#
|
||||
# @discard-merges: discard requests merged
|
||||
#
|
||||
# @flush-ios: flush requests completed successfully
|
||||
#
|
||||
# @read-ticks: time spent reading(ms)
|
||||
#
|
||||
# @write-ticks: time spent writing(ms)
|
||||
#
|
||||
# @discard-ticks: time spent discarding(ms)
|
||||
#
|
||||
# @flush-ticks: time spent flushing(ms)
|
||||
#
|
||||
# @ios-pgr: number of I/Os currently in flight
|
||||
#
|
||||
# @total-ticks: time spent doing I/Os (ms)
|
||||
#
|
||||
# @weight-ticks: weighted time spent doing I/Os since the last update of this field(ms)
|
||||
#
|
||||
# Since: 7.1
|
||||
##
|
||||
{ 'struct': 'GuestDiskStats',
|
||||
'data': {'*read-sectors': 'uint64',
|
||||
'*read-ios': 'uint64',
|
||||
'*read-merges': 'uint64',
|
||||
'*write-sectors': 'uint64',
|
||||
'*write-ios': 'uint64',
|
||||
'*write-merges': 'uint64',
|
||||
'*discard-sectors': 'uint64',
|
||||
'*discard-ios': 'uint64',
|
||||
'*discard-merges': 'uint64',
|
||||
'*flush-ios': 'uint64',
|
||||
'*read-ticks': 'uint64',
|
||||
'*write-ticks': 'uint64',
|
||||
'*discard-ticks': 'uint64',
|
||||
'*flush-ticks': 'uint64',
|
||||
'*ios-pgr': 'uint64',
|
||||
'*total-ticks': 'uint64',
|
||||
'*weight-ticks': 'uint64'
|
||||
} }
|
||||
|
||||
##
|
||||
# @GuestDiskStatsInfo:
|
||||
#
|
||||
# @name disk name
|
||||
#
|
||||
# @major major device number of disk
|
||||
#
|
||||
# @minor minor device number of disk
|
||||
##
|
||||
{ 'struct': 'GuestDiskStatsInfo',
|
||||
'data': {'name': 'str',
|
||||
'major': 'uint64',
|
||||
'minor': 'uint64',
|
||||
'stats': 'GuestDiskStats' } }
|
||||
|
||||
##
|
||||
# @guest-get-diskstats:
|
||||
#
|
||||
# Retrieve information about disk stats.
|
||||
# Returns: List of disk stats of guest.
|
||||
#
|
||||
# Since: 7.1
|
||||
##
|
||||
{ 'command': 'guest-get-diskstats',
|
||||
'returns': ['GuestDiskStatsInfo']
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM registry.fedoraproject.org/fedora:33
|
||||
FROM registry.fedoraproject.org/fedora:35
|
||||
|
||||
# Please keep this list sorted alphabetically
|
||||
ENV PACKAGES \
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM registry.fedoraproject.org/fedora:33
|
||||
FROM registry.fedoraproject.org/fedora:35
|
||||
|
||||
# Please keep this list sorted alphabetically
|
||||
ENV PACKAGES \
|
||||
|
Loading…
Reference in New Issue
Block a user