[PATCH] security: do not log password

2020-05-12 Thread Zhang Bo
It's insecure to log password, nomatter the password is encrypted or not. And do not log it even in debug mode, in the consideration of resilience, surposing that the log mode has been modified by the attacker. Signed-off-by: Zhang Bo --- src/libvirt-domain.c| 3 +-- src/qemu/qemu_monitor.c

[PATCHv2 0/5] update tls files without restarting libvirtd

2020-03-07 Thread Zhang Bo
v1: https://www.redhat.com/archives/libvir-list/2020-February/msg00370.html v2: according to Dienial's suggestion: * update each tls file one time -> update all of them at one time * forced to re-create the credentials object, rather than allowing to append to the original ones. Zhang Bo

[PATCHv2 1/5] virnetserver: Introduce virNetServerUpdateTlsFiles

2020-03-07 Thread Zhang Bo
Add an API to update server's tls context. --- src/libvirt_remote.syms| 1 + src/rpc/virnetserver.c | 51 ++ src/rpc/virnetserver.h | 2 ++ src/rpc/virnettlscontext.c | 46 ++ src/rpc/virnettlscontext.h | 3 +++ 5

[PATCHv2 4/5] virt-admin: Introduce command srv-update-tls

2020-03-07 Thread Zhang Bo
wire-up virAdmServerUpdateTlsFiles API into virt-admin client. --- tools/virt-admin.c | 64 ++ 1 file changed, 64 insertions(+) diff --git a/tools/virt-admin.c b/tools/virt-admin.c index 32edfe5757..a8e5e0a5af 100644 --- a/tools/virt-admin.c +++

[PATCHv2 2/5] tls: Add a mutex lock on 'tlsCtxt'

2020-03-07 Thread Zhang Bo
Prevent the handshake function from reading 'tlsCtxt' while updating 'tlsCtxt'. --- src/rpc/virnetserverclient.c | 4 1 file changed, 4 insertions(+) diff --git a/src/rpc/virnetserverclient.c b/src/rpc/virnetserverclient.c index 4d85ee25d7..657108239f 100644 ---

[PATCHv2 3/5] admin: Introduce virAdmServerUpdateTlsFiles

2020-03-07 Thread Zhang Bo
The server needs to use CA certificate, CRL, server certificate/key to complete the TLS handshake. If these files change, we needed to restart libvirtd for them to take effect. This API can update the TLS context *ONLINE* without restarting libvirtd. --- include/libvirt/libvirt-admin.h | 3

[PATCHv2 5/5] docs: update virt-admin.rst for server-update-tls

2020-03-07 Thread Zhang Bo
Update the manpage for the 'server-update-tls' command --- docs/manpages/virt-admin.rst | 16 1 file changed, 16 insertions(+) diff --git a/docs/manpages/virt-admin.rst b/docs/manpages/virt-admin.rst index 51c3d3917e..3e0d127790 100644 --- a/docs/manpages/virt-admin.rst +++

[PATCH 3/6] admin: Introduce virAdmServerUpdateTlsFiles

2020-02-09 Thread Zhang Bo
The server needs to use CA certificate, CRL, server certificate/key to complete the TLS handshake. If these files change, we need to restart libvirtd for them to take effect. This API can update the TLS context without restarting libvirtd. --- include/libvirt/libvirt-admin.h | 4

[PATCH 0/6] update tls files without restarting libvirtd

2020-02-09 Thread Zhang Bo
restarts will affect the reliability of cluster virtual machine management(such as openstack) services. These patches add a virt-admin command to update the tls related files *online*. Zhang Bo (6): virnettlscontext: refactoring virNetTLSContextLoadCredentials virnetserver: Introduce

[PATCH 4/6] admin: support server cert update mode

2020-02-09 Thread Zhang Bo
virAdmServerUpdateTlsFiles: @flags specifies how to update server cert/key in tls service. Two modes are currently supported: append mode and clear mode, means whether to clear the original cert then add the new one, or just append to the original one. --- include/libvirt/libvirt-admin.h | 14

[PATCH 1/6] virnettlscontext: refactoring virNetTLSContextLoadCredentials

2020-02-09 Thread Zhang Bo
Encapsulate the code for setting TLS-related files into functions, which is convenient for other modules to call. --- src/rpc/virnettlscontext.c | 135 ++--- 1 file changed, 82 insertions(+), 53 deletions(-) diff --git a/src/rpc/virnettlscontext.c

[PATCH 5/6] virt-admin: Introduce command srv-update-tls

2020-02-09 Thread Zhang Bo
wire-up virAdmServerUpdateTlsFiles API into virt-admin client. --- tools/virt-admin.c | 88 ++ 1 file changed, 88 insertions(+) diff --git a/tools/virt-admin.c b/tools/virt-admin.c index 32edfe5757..85235ae03d 100644 --- a/tools/virt-admin.c +++

[PATCH 2/6] virnetserver: Introduce virNetServerUpdateTlsFiles

2020-02-09 Thread Zhang Bo
Add an API to update server's tls context before admin method can be introduced. --- include/libvirt/libvirt-admin.h | 8 src/libvirt_remote.syms | 1 + src/rpc/virnetserver.c | 72 + src/rpc/virnetserver.h | 3 ++

[PATCH 6/6] docs: update virt-admin.rst for server-update-tls

2020-02-09 Thread Zhang Bo
Update the manpage for the 'server-update-tls' command --- docs/manpages/virt-admin.rst | 21 + 1 file changed, 21 insertions(+) diff --git a/docs/manpages/virt-admin.rst b/docs/manpages/virt-admin.rst index 51c3d3917e..e19d1f1577 100644 --- a/docs/manpages/virt-admin.rst +++

Re: [libvirt] ambiguous ret of qemuDomainDetachVirtioDiskDevice

2015-07-30 Thread zhang bo
On 2015/7/30 17:41, zhang bo wrote: On 2015/7/28 16:33, Ján Tomko wrote: On Tue, Jul 28, 2015 at 04:25:13PM +0800, zhang bo wrote: static int qemuDomainDetachVirtioDiskDevice(virQEMUDriverPtr driver, virDomainObjPtr vm

Re: [libvirt] ambiguous ret of qemuDomainDetachVirtioDiskDevice

2015-07-30 Thread zhang bo
On 2015/7/28 16:33, Ján Tomko wrote: On Tue, Jul 28, 2015 at 04:25:13PM +0800, zhang bo wrote: static int qemuDomainDetachVirtioDiskDevice(virQEMUDriverPtr driver, virDomainObjPtr vm, virDomainDiskDefPtr detach

[libvirt] ambiguous ret of qemuDomainDetachVirtioDiskDevice

2015-07-28 Thread zhang bo
static int qemuDomainDetachVirtioDiskDevice(virQEMUDriverPtr driver, virDomainObjPtr vm, virDomainDiskDefPtr detach) { ... rc = qemuDomainWaitForDeviceRemoval(vm); if (rc == 0 || rc == 1) ret =

[libvirt] shall libvirtd validate guest's name ?

2015-07-09 Thread zhang bo
linux-ZyvZnF:~ # virsh list --all IdName State - redhat7;reboot shut off - oscar-vm-5 shut off As shown above, 1 we use command virsh define a.xml to define a guest

Re: [libvirt] [PATCHv3] qemu: add a check for slot and base when build dimm address

2015-06-15 Thread zhang bo
On 2015/6/15 20:33, Luyao Huang wrote: When hot-plug a memory device, we don't check if there is a memory device have the same address with the memory device we want hot-pluged. Qemu forbid use/hot-plug 2 memory device with same slot or the same base(qemu side this elemnt named addr). +

Re: [libvirt] [PATCH] qemu: update netdevs of the same mac addrs correctly

2015-06-14 Thread zhang bo
On 2015/6/15 8:27, zhang bo wrote: ping On 2015/6/8 16:25, zhang bo wrote: If a guest has multiple network devices with the same MAC address, when we online update the second device, libvirtd always updates the first one. commit def31e4c forgot to fix the online updating scenario. We

Re: [libvirt] [PATCH] qemu: update netdevs of the same mac addrs correctly

2015-06-14 Thread zhang bo
ping On 2015/6/8 16:25, zhang bo wrote: If a guest has multiple network devices with the same MAC address, when we online update the second device, libvirtd always updates the first one. commit def31e4c forgot to fix the online updating scenario. We need to use virDomainNetFindIdx

Re: [libvirt] [RFC] get guest OS infos

2015-06-12 Thread zhang bo
+0800, zhang bo wrote: Different OSes have different capabilities and behaviors sometimes. We have to distinguish them then. For example, our clients want to send NMI interrupts to certain guests(eg.Linux distributions), but not others(eg.Windows guests). They want to acquire the list below

Re: [libvirt] [RFC] get guest OS infos

2015-06-12 Thread zhang bo
On 2015/6/12 17:05, Daniel P. Berrange wrote: On Fri, Jun 12, 2015 at 04:56:17PM +0800, zhang bo wrote: On 2015/6/11 21:54, Daniel P. Berrange wrote: On Thu, Jun 11, 2015 at 08:47:12AM -0500, Dennis Jenkins wrote: On Thu, Jun 11, 2015 at 3:51 AM, Daniel P. Berrange berra...@redhat.com wrote

Re: [libvirt] [PATCH 0/8] logically memory hotplug via guest agent

2015-06-10 Thread zhang bo
On 2015/6/10 16:39, Vasiliy Tolstov wrote: 2015-06-10 11:37 GMT+03:00 Daniel P. Berrange berra...@redhat.com: The udev rules are really something the OS vendor should setup, so that it just works I think so, also for vcpu hotplug this also covered by udev. May be we need something to hot

Re: [libvirt] [PATCH 0/8] logically memory hotplug via guest agent

2015-06-10 Thread zhang bo
On 2015/6/10 13:40, Vasiliy Tolstov wrote: 2015-06-10 5:28 GMT+03:00 zhang bo oscar.zhan...@huawei.com: Thank you for your reply. Before this patch, we needed to manually online memory blocks inside the guest, after dimm memory hotplug for most *nix OSes. (Windows guests automatically get

Re: [libvirt] [PATCH 0/8] logically memory hotplug via guest agent

2015-06-10 Thread zhang bo
On 2015/6/10 17:31, Daniel P. Berrange wrote: On Wed, Jun 10, 2015 at 10:28:08AM +0100, Daniel P. Berrange wrote: On Wed, Jun 10, 2015 at 05:24:50PM +0800, zhang bo wrote: On 2015/6/10 16:39, Vasiliy Tolstov wrote: 2015-06-10 11:37 GMT+03:00 Daniel P. Berrange berra...@redhat.com: The udev

[libvirt] [RFC] get guest OS infos

2015-06-10 Thread zhang bo
Different OSes have different capabilities and behaviors sometimes. We have to distinguish them then. For example, our clients want to send NMI interrupts to certain guests(eg.Linux distributions), but not others(eg.Windows guests). They want to acquire the list below: guest1: RHEL 7

[libvirt] [PATCH 0/8] logically memory hotplug via guest agent

2015-06-09 Thread Zhang Bo
blocks online/offline. Note that because we hotplug memory logically by online/offline MEMORY BLOCKS, and each memory block has a size much bigger than KiB, there's a deviation with the range of (0, block_size). block_size may be 128MB or 256MB or etc., it differs on different OSes. Zhang Bo (8

[libvirt] [PATCH 2/8] qemu: agent: define structure of qemuAgentMemblockInfo

2015-06-09 Thread Zhang Bo
add the definition of qemuAgentMemblockInfo, according to the json format: { 'struct': 'GuestMemoryBlock', 'data': {'phys-index': 'uint64', 'online': 'bool', '*can-offline': 'bool'} } Signed-off-by: Zhang Bo oscar.zhan...@huawei.com Signed-off-by: Li Bin binlibin

[libvirt] [PATCH 7/8] qemu: memory: logically hotplug memory with guest agent

2015-06-09 Thread Zhang Bo
). Signed-off-by: Zhang Bo oscar.zhan...@huawei.com Signed-off-by: Li Bin binlibin...@huawei.com --- src/qemu/qemu_driver.c | 42 +- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 580cd60

[libvirt] [PATCH 6/8] qemu: agent: implement function qemuAgetSetMemblocks

2015-06-09 Thread Zhang Bo
. Signed-off-by: Zhang Bo oscar.zhan...@huawei.com Signed-off-by: Li Bin binlibin...@huawei.com --- src/qemu/qemu_agent.c | 117 ++ src/qemu/qemu_agent.h | 1 + 2 files changed, 118 insertions(+) diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c

[libvirt] [PATCH 3/8] qemu: agent: implement qemuAgentGetMemblocks

2015-06-09 Thread Zhang Bo
: true, phys-index: 1 }, .. ] } please refer to http://git.qemu.org/?p=qemu.git;a=log;h=0dd38a03f5e1498aabf7d053a9fab792a5eeec5c for more information. Signed-off-by: Zhang Bo oscar.zhan...@huawei.com Signed-off-by: Li Bin binlibin...@huawei.com --- src/qemu

[libvirt] [PATCH 5/8] qemu: agent: implement qemuAgentUpdateMemblocks

2015-06-09 Thread Zhang Bo
function qemuAgentUpdateMemblocks() checks whether it needs to plug/unplug memory blocks to reach the target memory. it's similar to qemuAgentUpdateCPUInfo(). Signed-off-by: Zhang Bo oscar.zhan...@huawei.com Signed-off-by: Li Bin binlibin...@huawei.com --- src/qemu/qemu_agent.c | 69

[libvirt] [PATCH 1/8] lifecycle: add flag VIR_DOMAIN_MEM_GUEST for viDomainSetMemoryFlags

2015-06-09 Thread Zhang Bo
just add the flag and description for function virDomainSetMemoryFlags(). Signed-off-by: Zhang Bo oscar.zhan...@huawei.com Signed-off-by: Li Bin binlibin...@huawei.com --- include/libvirt/libvirt-domain.h | 1 + src/libvirt-domain.c | 4 src/qemu/qemu_driver.c | 3

[libvirt] [PATCH 4/8] qemu: agent: implement qemuAgentGetMemblockGeneralInfo

2015-06-09 Thread Zhang Bo
for the guest memory blocks. Signed-off-by: Zhang Bo oscar.zhan...@huawei.com Signed-off-by: Li Bin binlibin...@huawei.com --- src/qemu/qemu_agent.c | 50 +- src/qemu/qemu_agent.h | 7 +++ 2 files changed, 56 insertions(+), 1 deletion(-) diff --git

[libvirt] [PATCH 8/8] virsh: support memory hotplug with guest agent in virsh

2015-06-09 Thread Zhang Bo
support memory hotplug with the arg --guest in virsh command 'setmem'. fix a little bug in qemu_driver.c at the meanwhile. Signed-off-by: Zhang Bo oscar.zhan...@huawei.com Signed-off-by: Li Bin binlibin...@huawei.com --- src/libvirt-domain.c | 5 - src/qemu/qemu_driver.c | 3 ++- tools

Re: [libvirt] [PATCH 0/8] logically memory hotplug via guest agent

2015-06-09 Thread zhang bo
: On Tue, Jun 09, 2015 at 01:22:49PM +0200, Peter Krempa wrote: On Tue, Jun 09, 2015 at 11:05:16 +0100, Daniel Berrange wrote: On Tue, Jun 09, 2015 at 05:33:24PM +0800, Zhang Bo wrote: ... 2) The guest OS sometimes needs to enable the memory region after ACPI memory hotplug. The GA would

[libvirt] [PATCH] qemu: update netdevs of the same mac addrs correctly

2015-06-08 Thread zhang bo
-by: Zhou Yimin zhouyi...@huawei.com Signed-off-by: Zhang Bo oscar.zhan...@huawei.com --- src/qemu/qemu_hotplug.c | 23 +++ 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 94ebe35..d455bd6 100644 --- a/src/qemu

Re: [libvirt] Libvirt now using Zanata for translation

2015-05-27 Thread zhang bo
On 2015/5/27 17:00, Daniel P. Berrange wrote: On Wed, May 27, 2015 at 08:45:09AM +0800, zhang bo wrote: On 2015/3/6 21:20, Daniel P. Berrange wrote: As of current GIT master, libvirt is fully using Zanata for po file translation After some trouble with the zanata python client, I have now

Re: [libvirt] Libvirt now using Zanata for translation

2015-05-26 Thread zhang bo
On 2015/3/6 21:20, Daniel P. Berrange wrote: As of current GIT master, libvirt is fully using Zanata for po file translation After some trouble with the zanata python client, I have now successfully refreshed pushed the current libvirt.pot file, and synchronized all the translation po

Re: [libvirt] [PATCH] po: fix translation error for caller in zh_CN.po

2015-05-26 Thread zhang bo
On 2015/5/26 10:43, Eric Blake wrote: On 05/25/2015 08:28 PM, zhang bo wrote: IME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit caller should be translated to 璋冪敤绋嬪簭 rather than 璋冨害绋嬪簭, which in fact refers to scheduler in English. --- po/zh_CN.po

Re: [libvirt] [PATCH] po: fix translation error for caller in zh_CN.po

2015-05-25 Thread zhang bo
On 2015/5/26 10:48, Eric Blake wrote: On 05/25/2015 08:43 PM, Eric Blake wrote: On 05/25/2015 08:28 PM, zhang bo wrote: IME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit caller should be translated to 璋冪敤绋嬪簭 rather than 璋冨害绋嬪簭, which in fact refers

[libvirt] [PATCH] po: fix translation error for caller in zh_CN.po

2015-05-25 Thread zhang bo
IME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit caller should be translated to 璋冪敤绋嬪簭 rather than 璋冨害绋嬪簭, which in fact refers to scheduler in English. --- po/zh_CN.po | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/po/zh_CN.po

Re: [libvirt] [PATCH] po: fix translation error for caller in zh_CN.po

2015-05-25 Thread zhang bo
the headers of zh_CN.po at the meanwhile? eg. POT-Creation-Date, PO-Revision-Date, Last-Translator. On 2015/5/26 10:28, zhang bo wrote: IME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit caller should be translated to 璋冪敤绋嬪簭 rather than 璋冨害绋嬪簭, which in fact

[libvirt] [PATCH] util: make it more robust to calculate timeout value

2015-05-15 Thread zhang bo
to make the codes more robust. Signed-off-by: Wang Yufei james.wangyu...@huawei.com Signed-off-by: Zhang Bo oscar.zhan...@huawei.com --- src/util/vireventpoll.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/util/vireventpoll.c b/src/util/vireventpoll.c index ffda206

[libvirt] [PATCH] qemu: clear useless code

2015-05-13 Thread zhang bo
The variable 'now' is useless in qemuMigrationPrepareAny(), so I clear it. Signed-off-by: Wang Yufei james.wangyu...@huawei.com Signed-off-by: Zhang Bo oscar.zhan...@huawei.com --- src/qemu/qemu_migration.c | 4 1 file changed, 4 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src

[libvirt] time: event poll may become un-triggerable after changing system clock.

2015-05-12 Thread zhang bo
event poll may become un-triggerable after changing system clock. The steps to reproduce the problem: 1 run event-test 1 define and start a domain with name vm1. 2 destroy vm1 3 change system time to 1 hour before when timer.expiresAt has been set in virEventPollUpdateTimeout (and before

Re: [libvirt] time: event poll may become un-triggerable after changing system clock.

2015-05-12 Thread zhang bo
On 2015/5/12 16:56, Daniel P. Berrange wrote: On Tue, May 12, 2015 at 04:14:37PM +0800, zhang bo wrote: So, Is there any other better solution? thanks in advance. Simply don't change the system time by massive deltas. Libvirt is not going to be the only app to be affected. As you mention

[libvirt] [PATCH 0/2] remove 2 unused functions

2015-05-12 Thread Zhang Bo
From: YueWenyuan yueweny...@huawei.com remove unused functions virTimeFieldsNow() and virTimeFieldsNowRaw() YueWenyuan (2): remove unused function virTimeFieldsNow remove unused function virTimeFieldsNowRaw src/libvirt_private.syms | 2 -- src/util/virtime.c | 43

[libvirt] [PATCH 2/2] remove unused function virTimeFieldsNowRaw

2015-05-12 Thread Zhang Bo
From: YueWenyuan yueweny...@huawei.com remove unused function virTimeFieldsNowRaw() in src/libvirt_private.syms, src/util/virtime.c and src/util/virtime.h Signed-off-by: YueWenyuan yueweny...@huawei.com Signed-off-by: Zhang Bo oscar.zhan...@huawei.com --- src/libvirt_private.syms | 1 - src

[libvirt] [PATCH 1/2] remove unused function virTimeFieldsNow

2015-05-12 Thread Zhang Bo
From: YueWenyuan yueweny...@huawei.com remove unused function virTimeFieldsNow() in src/libvirt_private.syms, src/util/virtime.c and src/util/virtime.h Signed-off-by: YueWenyuan yueweny...@huawei.com Signed-off-by: Zhang Bo oscar.zhan...@huawei.com --- src/libvirt_private.syms | 1 - src/util

[libvirt] [PATCH 6/6] conf: fix memleak in virDomainHostdevDefClear

2015-04-27 Thread Zhang Bo
use virNetworkRouteDefFree() instead of VIR_FREE to free routes, otherwise the element 'family' would not be freed. Signed-off-by: Zhang Bo oscar.zhan...@huawei.com --- src/conf/domain_conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf

[libvirt] [PATCH 4/6] qemu: fix memleak in virCapabilitiesDomainDataLookup

2015-04-27 Thread Zhang Bo
virBufferContentAndReset() doesn't free buf contents, we should use virBufferFreeAndReset() to get buf freed. Signed-off-by: Zhang Bo oscar.zhan...@huawei.com --- src/conf/capabilities.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/conf/capabilities.c b/src/conf

[libvirt] [PATCH] util: fix memleak in virStorageSourceClear

2015-04-27 Thread zhang bo
snapshot and configFile are not freed, free them. Signed-off-by: Zhang Bo oscar.zhan...@huawei.com --- src/util/virstoragefile.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index 9507ca1..6c3017c 100644 --- a/src/util

[libvirt] [PATCH 1/6] tests: fix some memleaks in tests

2015-04-27 Thread Zhang Bo
Signed-off-by: Zhang Bo oscar.zhan...@huawei.com --- tests/commandtest.c | 1 + tests/domaincapstest.c | 1 + tests/qemucommandutiltest.c | 1 + 3 files changed, 3 insertions(+) diff --git a/tests/commandtest.c b/tests/commandtest.c index 6400ea2..f001a39 100644 --- a/tests

[libvirt] [PATCH 0/6] fix a serial of memleaks

2015-04-27 Thread Zhang Bo
Zhang Bo (6): tests: fix some memleaks in tests util: fix memleak in virFindSCSIHostByPCI qemu: fix memleaks in qemuBuildCommandLine qemu: fix memleak in virCapabilitiesDomainDataLookup conf: fix memleak in virDomainNetIpParseXML conf: fix memleak in virDomainHostdevDefClear src

[libvirt] [PATCH 3/6] qemu: fix memleaks in qemuBuildCommandLine

2015-04-27 Thread Zhang Bo
free boot_opts_str and boot_order_str both in normal and error paths. Signed-off-by: Zhang Bo oscar.zhan...@huawei.com --- src/qemu/qemu_command.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 29b876e..a54f3a3 100644 --- a/src/qemu

[libvirt] [PATCH 2/6] util: fix memleak in virFindSCSIHostByPCI

2015-04-27 Thread Zhang Bo
free buf in cleanup. Signed-off-by: Zhang Bo oscar.zhan...@huawei.com --- src/util/virutil.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/util/virutil.c b/src/util/virutil.c index 79cdb7a..0426517 100644 --- a/src/util/virutil.c +++ b/src/util/virutil.c @@ -1815,6 +1815,8

[libvirt] question: any conference available?

2015-04-27 Thread zhang bo
Besides the maillist and IRC, are there any other means of communication available for libvirt? I'm much concerned about scheduled conference, including online conferences(weekly? monthly?) or face-to-face conference. so that developers from all around could join together to share about

[libvirt] [PATCH 5/6] conf: fix memleak in virDomainNetIpParseXML

2015-04-27 Thread Zhang Bo
use cleanup instead of error, so that the allocated strings could also get freed when there's no error. Signed-off-by: Zhang Bo oscar.zhan...@huawei.com --- src/conf/domain_conf.c | 16 +--- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/conf/domain_conf.c b/src

[libvirt] [PATCH 0/2] tests: fix memleak in qemumonitorjsontest

2015-04-27 Thread Zhang Bo
the free callback should be qemuMonitorChardevInfoFree rather than just 'free' when virHashCreate'ing the chardevInfo hash. Zhang Bo (2): qemu: make qemuMonitorChardevInfoFree non-static tests: free ChardevInfo correctly in qemumonitorjsontest src/qemu/qemu_monitor.c | 2 +- src/qemu

[libvirt] [PATCH 1/2] qemu: make qemuMonitorChardevInfoFree non-static

2015-04-27 Thread Zhang Bo
It would be used in qemumonitorjsontest, thus we make it non-static. Signed-off-by: Zhang Bo oscar.zhan...@huawei.com Signed-off-by: Zhou Yimin zhouyi...@huawei.com --- src/qemu/qemu_monitor.c | 2 +- src/qemu/qemu_monitor.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git

[libvirt] [PATCH 2/2] tests: free ChardevInfo correctly in qemumonitorjsontest

2015-04-27 Thread Zhang Bo
the free callback should be qemuMonitorChardevInfoFree rather than just 'free' when virHashCreate'ing the chardevInfo hash. Signed-off-by: Zhang Bo oscar.zhan...@huawei.com Signed-off-by: Zhou Yimin zhouyi...@huawei.com --- tests/qemumonitorjsontest.c | 4 ++-- 1 file changed, 2 insertions(+), 2

[libvirt] [PATCH] typo: fix typo error in virLXCControllerSetupResourceLimits

2015-04-25 Thread zhang bo
iff - if rather then - rather than Signed-off-by: YueWenyuan yueweny...@huawei.com --- src/lxc/lxc_controller.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c index e144c2d..7ad9d50 100644 --- a/src/lxc/lxc_controller.c

Re: [libvirt] [PATCH] qemu: lock: unlock vm during qemuBuildCommandLine

2015-04-23 Thread zhang bo
On 2015/4/23 17:46, Michal Privoznik wrote: On 23.04.2015 11:32, Peter Krempa wrote: On Thu, Apr 23, 2015 at 11:19:34 +0200, Michal Privoznik wrote: On 23.04.2015 10:30, Peter Krempa wrote: On Thu, Apr 23, 2015 at 11:44:49 +0800, zhang bo wrote: The function qemuBuildCommandLine() may take

Re: [libvirt] [PATCH] qemu: lock: unlock vm during qemuBuildCommandLine

2015-04-23 Thread zhang bo
On 2015/4/23 19:06, Daniel P. Berrange wrote: On Thu, Apr 23, 2015 at 07:00:21PM +0800, zhang bo wrote: The reason for the problem is that: 1 guestA locks vm while creating each tapDev(virNetDevTapCreate) in qemuBuildCommandLine(), for 10seconds 2 guestB calls qemuMigrationPrepareAny

Re: [libvirt] [PATCH 0/5] Make virDomainObjListFindByName run in O(1)

2015-04-23 Thread zhang bo
On 2015/4/24 1:14, Michal Privoznik wrote: As discussed here: https://www.redhat.com/archives/libvir-list/2015-April/msg01135.html Michal Privoznik (5): virDomainObjListAddLocked: s/false/NULL/ for @oldDef virDomainObjListNew: Use virObjectFreeHashData Introduce virDomainObjEndAPI

Re: [libvirt] [PATCH 0/5] Make virDomainObjListFindByName run in O(1)

2015-04-23 Thread zhang bo
On 2015/4/24 1:14, Michal Privoznik wrote: As discussed here: https://www.redhat.com/archives/libvir-list/2015-April/msg01135.html Michal Privoznik (5): virDomainObjListAddLocked: s/false/NULL/ for @oldDef virDomainObjListNew: Use virObjectFreeHashData Introduce virDomainObjEndAPI

[libvirt] [PATCH] qemu: Don't fail to reboot domains with unresponsive agent

2015-04-22 Thread zhang bo
just as what b8e25c35d7f80a2fadc0e51e95318e39db3d1687 did, we fall back to the ACPI method when the guest agent is unresponsive in qemuDomainReboot. Signed-off-by: YueWenyuan yueweny...@huawei.com Signed-off-by: Zhang Bo oscar.zhan...@huawei.com --- src/qemu/qemu_driver.c | 67

[libvirt] [PATCH] qemu: lock: unlock vm during qemuBuildCommandLine

2015-04-22 Thread zhang bo
The function qemuBuildCommandLine() may take a long time, for example if we configure tens of vifs for the guest, each may cost hundrands of milliseconds to create tap dev, senconds in total. Thus, unlock vm before calling it. Signed-off-by: Zhang Bo oscar.zhan...@huawei.com Signed-off-by: Zhou

Re: [libvirt] [PATCH] qemu: lifecycle: guest get rebooted after reboot and shutdown

2015-04-19 Thread zhang bo
On 2015/4/17 17:54, Michal Privoznik wrote: On 17.04.2015 02:43, zhang bo wrote: Maybe I should have been more specific when requiring you to send the patch. If you look at 'git log' you'll see this commit message diverges from the rest. I've fixed it, ACKed and pushed. Michal Sorry

[libvirt] util: log: How about online change logLevel?

2015-04-17 Thread zhang bo
Sometimes, when we encounter with a problem, we need to set libvirtd log level to DEBUG to dig detailed information. But changing log level requires us to *restart* libvirtd. 1) #vim /etc/libvirt/libvirtd.conf log_level = 1 2) *service libvirtd restart* We think that it makes

[libvirt] qemu: lifecycle: reboot + shutdown, unexpected vm status.

2015-04-16 Thread zhang bo
Steps: 1 virsh reboot guest1 --mode=acpi 2 virsh shutdown guest1 --mode=agent Expected result: As the SHUTDOWN job is after REBOOT, we expected the guest to be *shutoff*. (Do you think so?) Exacted result: After the 2 steps above, the guest got *rebooted*. The reason to this

Re: [libvirt] util: client: shall libvirtd record task histories?

2015-04-16 Thread zhang bo
On 2015/4/10 15:54, Jiri Denemark wrote: On Wed, Apr 08, 2015 at 15:40:36 +0800, zhang bo wrote: We recently encountered a problem: 1) migrate a domain 2) the client unexpectedly got *crashed* (let's take it as virsh command) 3) *libvirtd still kept migrating the domain* 4

[libvirt] [PATCH] Add source check before attaching device

2015-04-16 Thread zhang bo
Source device/file is not unique now, we should check it when attach device. Signed-off-by: YueWenyuan yueweny...@huawei.com Signed-off-by: Zhang Bo oscar.zhan...@huawei.com --- src/conf/domain_conf.c | 15 +++ src/conf/domain_conf.h | 1 + src/libvirt_private.syms | 1 + src

Re: [libvirt] [PATCH] Add source check before attaching device

2015-04-16 Thread zhang bo
On 2015/4/16 17:44, Jiri Denemark wrote: On Thu, Apr 16, 2015 at 16:51:52 +0800, zhang bo wrote: Source device/file is not unique now, we should check it when attach device. The check is vary fragile and unreliable. It would be very hard (perhaps even impossible) to really detect

[libvirt] [PATCH] qemu: lifecycle: guest get rebooted after reboot and shutdown

2015-04-16 Thread zhang bo
fakeReboot: --- shutdown reboot acpiY(0) Y(1) agent *Y(0)* N --- we let agent-mode shutdown set fakeReboot to 0. Signed-off-by: Zhang Bo oscar.zhan

[libvirt] util: client: shall libvirtd record task histories?

2015-04-08 Thread zhang bo
We recently encountered a problem: 1) migrate a domain 2) the client unexpectedly got *crashed* (let's take it as virsh command) 3) *libvirtd still kept migrating the domain* 4) after it's restarted, the client didn't know the guest is still migrating. The problem is that libvirtd and

[libvirt] qemu: migration: continuously sending and receiving ARP packets guest mistakenly thinks there's another guest with the same IP.

2015-04-03 Thread zhang bo
Problem Description: Live-migrate a guest, which has a tap device and continuously sends and receives ARP packets, it would mistakenly think there's another guest with the same IP, immedially after migration. The steps to reproduce the problem: 1 define and start a domain with its network

[libvirt] [PATCH] qemu: lifecycle: make agent-mode shutdown and reboot timeout

2015-04-01 Thread zhang bo
When we shutdown/reboot a guest using agent-mode, if the guest itself blocks infinitely, libvirt would block in qemuAgentShutdown() forever. Thus, we set a timeout for shutdown/reboot, from our experience, 60 seconds would be fine. Signed-off-by: Zhang Bo oscar.zhan...@huawei.com Signed-off

Re: [libvirt] [openstack-dev] [nova] The risk of hanging when shutdown instance.

2015-03-30 Thread zhang bo
On 2015/3/28 18:06, Rui Chen wrote: Thank you for reply, Chris. 2015-03-27 23:15 GMT+08:00 Chris Friesen chris.frie...@windriver.com mailto:chris.frie...@windriver.com: On 03/26/2015 07:44 PM, Rui Chen wrote: Yes, you are right, but we found our instance hang at first

Re: [libvirt] connect: ssh: Shall we remove the dependency of netcat ?

2015-03-30 Thread zhang bo
On 2015/3/28 0:25, Peter Krempa wrote: On Fri, Mar 27, 2015 at 10:54:26 +0800, zhang bo wrote: Too powerful? That is a ridiculous statement that probably originates from some kind of misunderstanding when creating a security policy or stuff like that. If a policy bans nc as powerful

Re: [libvirt] [openstack-dev] [nova] The risk of hanging when shutdown instance.

2015-03-30 Thread zhang bo
On 2015/3/31 4:36, Eric Blake wrote: On 03/30/2015 06:08 AM, Michal Privoznik wrote: On 30.03.2015 11:28, zhang bo wrote: On 2015/3/28 18:06, Rui Chen wrote: snip/ The API virDomainShutdown's description is out of date, it's not correct. In fact, virDomainShutdown would block

[libvirt] connect: ssh: Shall we remove the dependency of netcat ?

2015-03-26 Thread zhang bo
1 When we connect libvirt with URI qemu+ssh, it uses 'nc' command to connect to libvirt-sock. # virsh -c qemu+ssh://root@9.61.1.74/system list Password: //ask users to input passwords here. IdName State 11

[libvirt] lifecycle: shutdown: should it have timeout when using qemu-agent?

2015-03-23 Thread zhang bo
The problem we encountered is: 1) use qemu-agent to shutdown a domain. 2) libvirt will block in qemuAgentShutdown(), if the domain itself got stucked when it powers-off. It's the *guest domain*'s fault that it stucks when shutdown. However, we could not handle the domain in libvirt anymore,

Re: [libvirt] [PATCH v2] util: don't fail if no PortData is found while getting migrateData

2015-03-22 Thread zhang bo
Thanks for your reply, this patch has already been commited by John on Mar.14, the commit ID is: 25df57db73adc3e610193ee1fcdd202c47ba471d Thank you all the same:) On 2015/3/21 0:10, Michal Privoznik wrote: On 04.03.2015 03:59, zhang bo wrote: I've tried to review this patch. However

Re: [libvirt] [PATCH] util: vhost user: support for bootindex

2015-03-18 Thread zhang bo
On 2015/3/13 17:17, zhang bo wrote: Problem Description: When we set boot order for a vhost-user network interface, we found the boot index doesn't work. Cause of the Problem: In the function qemuBuildVhostuserCommandLine(), it forcely set the arg bootindex of function

[libvirt] [PATCH] util: vhost user: support for bootindex

2015-03-13 Thread zhang bo
missing. Solution: Trans the arg bootindex down. Signed-off-by: Gao Haifeng gaohaifeng@huawei.com Signed-off-by: Zhang Bo oscar.zhan...@huawei.com --- src/qemu/qemu_command.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu

[libvirt] Should logging in the library set its default outputs?

2015-03-13 Thread zhang bo
If the env LIBVIRT_DEBUG and LIBVIRT_LOG_OUTPUTS are not set, the logging in the library would not log into any file. So: Is it necessary to set the default level and outputs in virGlobalInit(), just in case the maintainer forgets to set the ENVs ? Thanks in advance. -- libvir-list mailing

[libvirt] logging: how about adding a ProcessName field in logging file?

2015-03-13 Thread zhang bo
Suppose there are 3 or more clients of libvirt: 1)nova 2)bash virsh commands 3)user customized ELF 4)etc The env LIBVIRT_DEBUG and LIBVIRT_LOG_OUTPUTS affects all of these clients, thus, they will all accumulate the logs into *ONE* file set by LIBVIRT_LOG_OUTPUTS. eg: [2015-03-07 00:33:30]:

Re: [libvirt] logging: how about adding a ProcessName field in logging file?

2015-03-13 Thread zhang bo
On 2015/3/13 17:29, Daniel P. Berrange wrote: On Fri, Mar 13, 2015 at 05:08:54PM +0800, zhang bo wrote: Suppose there are 3 or more clients of libvirt: 1)nova 2)bash virsh commands 3)user customized ELF 4)etc The env LIBVIRT_DEBUG and LIBVIRT_LOG_OUTPUTS affects all of these clients

[libvirt] [PATCH v3] util: don't fail if no PortData is found while getting migrateData

2015-03-04 Thread zhang bo
. Signed-off-by: Zhou Yimin zhouyi...@huawei.com Signed-off-by: Zhang Bo oscar.zhan...@huawei.com --- V1 here: https://www.redhat.com/archives/libvir-list/2015-February/msg00388.html V2: Add --if-exists option to ovs-vsctl cmd, making ovs-vsctl not raise error if there's no portData available

[libvirt] [PATCH v2] util: don't fail if no PortData is found while getting migrateData

2015-03-03 Thread zhang bo
...@huawei.com Signed-off-by: Zhang Bo oscar.zhan...@huawei.com --- src/util/virnetdevopenvswitch.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/util/virnetdevopenvswitch.c b/src/util/virnetdevopenvswitch.c index e5c87bb..722d0dd 100644 --- a/src/util

Re: [libvirt] [PATCH] util: do not take it as wrong if no PortData is found while getting migrateData

2015-02-25 Thread zhang bo
On 2015/2/20 18:05, Martin Kletzander wrote: On Thu, Feb 12, 2015 at 12:08:54PM +0800, Zhang Bo wrote: The function virNetDevOpenvswitchGetMigrateData() uses the cmd ovs-vsctl to get portdata. If no portdata is available, rather than failure in running the cmd, we think we should just print

[libvirt] why not shutdown the src vm to avoid split-brain

2015-02-14 Thread zhang bo
In func doPeer2PeerMigrate3(), in the finish step, it checks whether domainMigrateFinish3() returns NULL or not. if it(ddomain) is NULL, it just restarts the guest on the source. Please consider the scenario that the ddomain has already been running on the dest, but it fails to tell the source

[libvirt] [PATCH] util: do not resotre the VF that is in use by another active guest

2015-02-12 Thread Zhang Bo
/var/run/libvirt/hostdevmgr/ethX_vfX, and set it back to the VF, making the VF unusable) This patch checks whether the VF is already in use before restoring it. Signed-off-by: Zhang Bo oscar.zhan...@huawei.com Signed-off-by: Zhuang Yanying zhuangyany

[libvirt] [PATCH] Fix a syntax error in the description text of libvirtd.conf

2015-02-11 Thread Zhang Bo
not yet not - not yet. Signed-off-by: Zhang Bo oscar.zhan...@huawei.com --- daemon/libvirtd.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon/libvirtd.conf b/daemon/libvirtd.conf index d4f6a1c..069ef3a 100644 --- a/daemon/libvirtd.conf +++ b/daemon/libvirtd.conf

[libvirt] [PATCH] conf: Fix libvirtd crash and memory leak caused by virDomainVcpuPinDel()

2015-02-11 Thread Zhang Bo
(virnetserver.c:172) Steps to reproduce the problem: 1) use virDomainPinVcpuFlags() to pin a guest's vcpu to all the pcpus of the host. This patch uses def-cputune.vcpupin instead of vcpupin_list to do the realloc() job, to avoid invalid read or memory leaking. Signed-off-by: Zhang Bo oscar.zhan

[libvirt] [PATCH] util: do not take it as wrong if no PortData is found while getting migrateData

2015-02-11 Thread Zhang Bo
if portdata is unavailable. Signed-off-by: Zhang Bo oscar.zhan...@huawei.com Signed-off-by: Zhou Yimin zhouyi...@huawei.com --- src/util/virnetdevopenvswitch.c | 28 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/src/util/virnetdevopenvswitch.c b/src

[libvirt] It does not support hot-plugging VHOST-USER networkcard in libvirt?

2015-01-12 Thread zhang bo
It works well if we use qmp command to directly interact with qemu 2.1 to hot-add vhost-user network card. However, libvirt seems not support hotplugging well. Steps to use qmp commands to directly(without libvirtd) interact with qemu 2.1 : 1 (qemu) chardev-add

  1   2   >