[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v6 6/6] hmp: add virtio commands
From: |
Jonah Palmer |
Subject: |
Re: [PATCH v6 6/6] hmp: add virtio commands |
Date: |
Wed, 21 Jul 2021 05:11:33 -0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 |
On 7/13/21 10:40 PM, Jason Wang wrote:
在 2021/7/12 下午6:35, Jonah Palmer 写道:
+void hmp_virtio_queue_status(Monitor
*mon, const QDict *qdict)
+{
+ Error *err = NULL;
+ const char *path = qdict_get_try_str(qdict, "path");
+ int queue = qdict_get_int(qdict, "queue");
+ VirtQueueStatus *s = qmp_x_debug_virtio_queue_status(path,
queue, &err);
+
+ if (err != NULL) {
+ hmp_handle_error(mon, err);
+ return;
+ }
+
+ monitor_printf(mon, "%s:\n", path);
+ monitor_printf(mon, " device_type: %s\n",
+ VirtioType_str(s->device_type));
+ monitor_printf(mon, " index: %d\n",
s->queue_index);
+ monitor_printf(mon, " inuse: %d\n",
s->inuse);
+ monitor_printf(mon, " last_avail_idx: %d (%"PRId64"
%% %"PRId64")\n",
+ s->last_avail_idx, s->last_avail_idx %
s->vring_num,
+ s->vring_num);
+ monitor_printf(mon, " shadow_avail_idx: %d (%"PRId64"
%% %"PRId64")\n",
+ s->shadow_avail_idx,
s->shadow_avail_idx % s->vring_num,
+ s->vring_num);
+ monitor_printf(mon, " used_idx: %d (%"PRId64"
%% %"PRId64")\n",
+ s->used_idx, s->used_idx %
s->vring_num, s->vring_num);
The modular information is not the case of packed ring where the
queue size does not have to be a power of 2.
Doesn't modulo work for any integer, regardless if it's a power of 2 or not? Could you clarify this for me?
Thank you,
Jonah
Thanks
+ monitor_printf(mon, "
signalled_used: %d (%"PRId64" %% %"PRId64")\n",
+ s->signalled_used, s->signalled_used %
s->vring_num,
+ s->vring_num);
+ monitor_printf(mon, " signalled_used_valid: %d\n",
s->signalled_used_valid);
+ monitor_printf(mon, " VRing:\n");
+ monitor_printf(mon, " num: %"PRId64"\n",
s->vring_num);
+ monitor_printf(mon, " num_default: %"PRId64"\n",
s->vring_num_default);
+ monitor_printf(mon, " align: %"PRId64"\n",
s->vring_align);
+ monitor_printf(mon, " desc: 0x%016"PRIx64"\n",
s->vring_desc);
+ monitor_printf(mon, " avail: 0x%016"PRIx64"\n",
s->vring_avail);
+ monitor_printf(mon, " used: 0x%016"PRIx64"\n",
s->vring_used);
+
+ qapi_free_VirtQueueStatus(s);
- [PATCH v6 1/6] qmp: add QMP command x-debug-query-virtio, (continued)
[PATCH v6 3/6] qmp: decode feature bits in virtio-status, Jonah Palmer, 2021/07/12
[PATCH v6 5/6] qmp: add QMP command x-debug-virtio-queue-element, Jonah Palmer, 2021/07/12
[PATCH v6 6/6] hmp: add virtio commands, Jonah Palmer, 2021/07/12
Re: [PATCH v6 0/6] hmp,qmp: Add some commands to introspect virtio devices, Michael S. Tsirkin, 2021/07/13
Re: [PATCH v6 0/6] hmp, qmp: Add some commands to introspect virtio devices, Jason Wang, 2021/07/13