On Tue, Apr 02, 2024 at 03:01:50PM +0200, Kevin Wolf wrote: > Am 29.03.2024 um 04:45 hat Shaoqin Huang geschrieben: > > Hi Daniel, > > > > On 3/25/24 16:55, Daniel P. Berrangé wrote: > > > On Mon, Mar 25, 2024 at 01:35:58PM +0800, Shaoqin Huang wrote: > > > > Hi Daniel, > > > > > > > > Thanks for your reviewing. I see your comments in the v7. > > > > > > > > I have some doubts about what you said about the QAPI. Do you want me to > > > > convert the current design into the QAPI parsing like the > > > > IOThreadVirtQueueMapping? And we need to add new json definition in the > > > > qapi/ directory? > > > > I have defined the QAPI for kvm-pmu-filter like below: > > @@ -2439,6 +2441,7 @@ static Property arm_cpu_properties[] = { > > mp_affinity, ARM64_AFFINITY_INVALID), > > DEFINE_PROP_INT32("node-id", ARMCPU, node_id, CPU_UNSET_NUMA_NODE_ID), > > DEFINE_PROP_INT32("core-count", ARMCPU, core_count, -1), > > + DEFINE_PROP_KVM_PMU_FILTER("kvm-pmu-filter", ARMCPU, kvm_pmu_filter), > > DEFINE_PROP_END_OF_LIST() > > }; > > > > And I guess I can use the new json format input like below: > > > > qemu-system-aarch64 \ > > -cpu host, '{"filter": [{"action": "a", "start": 0x10, "end": "0x11"}]}' > > > > But it doesn't work. It seems like because the -cpu option doesn't > > support json format parameter. > > > > Maybe I'm wrong. So I want to double check with if the -cpu option > > support json format nowadays? > > As far as I can see, -cpu doesn't support JSON yet. But even if it did, > your command line would be invalid because the 'host,' part isn't JSON. > > > If the -cpu option doesn't support json format, how I can use the QAPI > > for kvm-pmu-filter property? > > This would probably mean QAPIfying all CPUs first, which sounds like a > major effort. I wonder if we can do a half-way house where we parse the JSON and turn it into regular QemuOpts internally, and then just use QAPI parsing for the filter property. IOW, publically give the illusion that -cpu has been QAPI-ified, but without actually doing the hard part yet. The idea being to avoid inventing a new cli syntax that has no analogue to QAPI. With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|