Re: [PATCH v2 10/12] target/riscv: Add kvm_riscv_get/put_regs_timer

2021-12-12 Thread Anup Patel
On Fri, Dec 10, 2021 at 3:37 PM Yifei Jiang wrote: > > Add kvm_riscv_get/put_regs_timer to synchronize virtual time context > from KVM. > > To set register of RISCV_TIMER_REG(state) will occur a error from KVM > on kvm_timer_state == 0. It's better to adapt in KVM, but it doesn't matter > that

Re: [PATCH v2 12/12] target/riscv: Support virtual time context synchronization

2021-12-12 Thread Anup Patel
On Fri, Dec 10, 2021 at 3:38 PM Yifei Jiang wrote: > > Add virtual time context description to vmstate_kvmtimer. After cpu being > loaded, virtual time context is updated to KVM. > > Signed-off-by: Yifei Jiang > Signed-off-by: Mingwang Li > --- > target/riscv/machine.c | 37

Re: [PATCH v2 11/12] target/riscv: Implement virtual time adjusting with vm state changing

2021-12-12 Thread Anup Patel
On Fri, Dec 10, 2021 at 3:38 PM Yifei Jiang wrote: > > We hope that virtual time adjusts with vm state changing. When a vm > is stopped, guest virtual time should stop counting and kvm_timer > should be stopped. When the vm is resumed, guest virtual time should > continue to count and kvm_timer

Re: [PATCH v2 08/12] target/riscv: Handle KVM_EXIT_RISCV_SBI exit

2021-12-12 Thread Anup Patel
On Fri, Dec 10, 2021 at 3:37 PM Yifei Jiang wrote: > > Use char-fe to handle console sbi call, which implement early > console io while apply 'earlycon=sbi' into kernel parameters. > > Signed-off-by: Yifei Jiang > Signed-off-by: Mingwang Li Looks good to me. Reviewed-by: Anup Patel Regards,

Re: [PATCH v2 07/12] target/riscv: Support setting external interrupt by KVM

2021-12-12 Thread Anup Patel
On Fri, Dec 10, 2021 at 3:37 PM Yifei Jiang wrote: > > When KVM is enabled, set the S-mode external interrupt through > kvm_riscv_set_irq function. > > Signed-off-by: Yifei Jiang > Signed-off-by: Mingwang Li > Reviewed-by: Alistair Francis > --- > target/riscv/cpu.c | 6 +- >

Re: [PATCH v2 06/12] target/riscv: Support start kernel directly by KVM

2021-12-12 Thread Anup Patel
On Fri, Dec 10, 2021 at 3:37 PM Yifei Jiang wrote: > > Get kernel and fdt start address in virt.c, and pass them to KVM > when cpu reset. In addition, add kvm_riscv.h to place riscv specific > interface. > > Signed-off-by: Yifei Jiang > Signed-off-by: Mingwang Li > Reviewed-by: Alistair Francis

Re: [PATCH v2 05/12] target/riscv: Implement kvm_arch_put_registers

2021-12-12 Thread Anup Patel
On Fri, Dec 10, 2021 at 3:37 PM Yifei Jiang wrote: > > Put GPR CSR and FP registers to kvm by KVM_SET_ONE_REG ioctl > > Signed-off-by: Yifei Jiang > Signed-off-by: Mingwang Li > Reviewed-by: Alistair Francis Looks good to me. Reviewed-by: Anup Patel Regards, Anup > --- >

Re: [PATCH v2 04/12] target/riscv: Implement kvm_arch_get_registers

2021-12-12 Thread Anup Patel
On Fri, Dec 10, 2021 at 3:37 PM Yifei Jiang wrote: > > Get GPR CSR and FP registers from kvm by KVM_GET_ONE_REG ioctl. > > Signed-off-by: Yifei Jiang > Signed-off-by: Mingwang Li > Reviewed-by: Alistair Francis Looks good to me. Reviewed-by: Anup Patel Regards, Anup > --- >

Re: [PATCH v2 03/12] target/riscv: Implement function kvm_arch_init_vcpu

2021-12-12 Thread Anup Patel
On Fri, Dec 10, 2021 at 3:37 PM Yifei Jiang wrote: > > Get isa info from kvm while kvm init. > > Signed-off-by: Yifei Jiang > Signed-off-by: Mingwang Li > Reviewed-by: Alistair Francis Looks good to me. Reviewed-by: Anup Patel Regards, Anup > --- > target/riscv/kvm.c | 32

Re: [PATCH 6/7] util: Check for pkttyagent availability properly

2021-12-12 Thread Martin Kletzander
On Sun, Dec 12, 2021 at 10:40:46AM -0700, Jim Fehlig wrote: On 12/11/21 03:28, Martin Kletzander wrote: On Sat, Dec 11, 2021 at 11:16:13AM +0100, Martin Kletzander wrote: On Fri, Dec 10, 2021 at 05:48:03PM -0700, Jim Fehlig wrote: Hi Martin! I recently received a bug report (sorry, not

[libvirt PATCH 02/12] util: rename/move iptablesFormatNetwork to virSocketAddrFormatWithPrefix

2021-12-12 Thread Laine Stump
This function formats an address + prefix as, e.g. 192.168.122.0/24, which is useful in places other than iptables. Move it to virsocketaddr.c and make it public so that others can use it. While moving, the bit that masks off the host bits of the address is made optional, so that the function is

[libvirt PATCH 09/12] util: move and rename virFirewallBackendSynchronize()

2021-12-12 Thread Laine Stump
This function doesn't have anything to do with manipulating virFirewall objects, but rather should be called in response to dbus events about the firewalld service. Move this function into virfirewalld.c, and rename it to virFirewallDSynchronize(). Signed-off-by: Laine Stump ---

[libvirt PATCH 08/12] util: simplify virFirewallBackendSynchronize()

2021-12-12 Thread Laine Stump
This function doesn't need to check for a backend - synchronization with firewalld should always be done whenever firewalld is registered and available, not just when the firewalld backend is selected. Signed-off-by: Laine Stump --- src/util/virfirewall.c | 54

[libvirt PATCH 11/12] util: remove currentBackend from virfirewall.c

2021-12-12 Thread Laine Stump
Since the currentBackend (direct vs. firewalld) setting is no longer used for anything, we don't need to set it (either explicitly from tests, or implicitly during init), and can completely remove it. Signed-off-by: Laine Stump --- src/libvirt_private.syms | 1 - src/util/virfirewall.c

[libvirt PATCH 07/12] util: eliminate pointless switch in virFirewallApplyRule

2021-12-12 Thread Laine Stump
Since commit b19863640 both useful cases of the switch statement in this function have made the same call (and the other/default case is just an error that can never happen). Eliminate the switch to help eliminate use of currentBackend. Signed-off-by: Laine Stump --- src/util/virfirewall.c | 25

[libvirt PATCH 12/12] util: remove virFirewallOnceInit()

2021-12-12 Thread Laine Stump
There is no longer anything to initialize at binary startup time. Signed-off-by: Laine Stump --- src/util/virfirewall.c | 16 +--- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/util/virfirewall.c b/src/util/virfirewall.c index 98d78857df..70092f2ef6 100644 ---

[libvirt PATCH 10/12] util: remove check for iptables binary during virFirewallInit

2021-12-12 Thread Laine Stump
It's unclear exactly why this check exists; possibly a parallel to a long-removed check for the firewall-cmd binary (added to viriptables.c with the initial support for firewalld in commit bf156385a03 in 2012, and long since removed), or possibly because virFirewallOnceInit() was intended to be

[libvirt PATCH 03/12] util: rename iptables operators to something less generic

2021-12-12 Thread Laine Stump
Rather than calling these "ADD" and "REMOVE", which could be confused with some other random items with the same names, make them more specific by prepending "VIR_NETFILTER_" (because they will also be used by the nftables backend) and rename them to match the iptables/nftables operators they

[libvirt PATCH 06/12] tests: document why virgdbus must be mocked in networkxml2firewalltest.c

2021-12-12 Thread Laine Stump
It isn't intuitive (to me) that a test just converting xml text into iptables commands should need to call dbus, so rather than forcing the next person to look through the commit logs and/or run the test under gdb to understand why this is needed, just add a short comment in the source.

[libvirt PATCH 05/12] tests: remove unnecessary ret variables and cleanup labels

2021-12-12 Thread Laine Stump
Several functions were simplified to remove the only cleanup code at the cleanup label, making it unnecessary. Signed-off-by: Laine Stump --- tests/virfirewalltest.c | 92 ++--- 1 file changed, 31 insertions(+), 61 deletions(-) diff --git

[libvirt PATCH 04/12] tests: remove firewalld backend tests from virfirewalltest.c

2021-12-12 Thread Laine Stump
When libvirt added support for firewalld, all iptables/ebtables rules were added via the firewalld "passthrough" API when firewalld was enabled (the "firewalld backend"), or run directly by libvirt when firewalld was disabled (the so-called "direct backend"). virfirewalltest.c dutifully ran each

[libvirt PATCH 00/12] Clean up cruft in firewall/iptables code (in preparation for nftables)

2021-12-12 Thread Laine Stump
These patches make no functional change, they just remove a bunch of cruft that accumulated over the years and is no longer needed. This is all in advance of adding support for native nftable support, but there is nothing nftables-specific being added here; I just wanted to get these cleanups out

[libvirt PATCH 01/12] network: eliminate code that uses default iptables chains

2021-12-12 Thread Laine Stump
The network driver has put all its rules into private chains (created by libvirt) since commit 7431b3eb9a, which was included in libvirt-5.1.0. When the conversion was made, code was included that would attempt to delete existing rules in the default chains, to make it possible to upgrade libvirt

Re:Re: [PATCH] Fixes: #253

2021-12-12 Thread Jorhson_Deng
Thanks, This is my first fatch to libvirt project and there are some rules I am not familar to. I feel starnge that the comment, becasue the live-migration do the refresh in qemuMigrationDstFinish, but restore method is not called this function. And the live-migration in