[libvirt] by libvirt api(virStoragePoolRefresh) to refresh pool, discovered the connection is very slow
Hello In ours project,use libvirt(libvirt-0.10.2-46.el6) to manage storage pool(the type of pool is ceph rbd), by libvirt api(virStoragePoolRefresh) to refresh pool, discovered the connection(libvirt to ceph) is very slow libvirt is how to deal with pool refresh. tks!!! Jason rao -邮件原件- 发件人: libvir-list-boun...@redhat.com [mailto:libvir-list-boun...@redhat.com] 代表 libvir-list-requ...@redhat.com 发送时间: 2015年9月24日 7:19 收件人: libvir-list@redhat.com 主题: libvir-list Digest, Vol 118, Issue 146 Send libvir-list mailing list submissions to libvir-list@redhat.com To subscribe or unsubscribe via the World Wide Web, visit https://www.redhat.com/mailman/listinfo/libvir-list or, via email, send a message with subject or body 'help' to libvir-list-requ...@redhat.com You can reach the person managing the list at libvir-list-ow...@redhat.com When replying, please edit your Subject line so it is more specific than "Re: Contents of libvir-list digest..." Today's Topics: 1. [PATCH] domain: Fix migratable XML with graphics/@listen (Jiri Denemark) 2. [PATCH] storage: Fix incorrect format for XML (John Ferlan) 3. Re: [PATCH v2] qemuDomainDeviceDefPostParse: Drop useless checks (John Ferlan) 4. Re: [PATCH RFC 4/7] libxl: implement virDomainBlockStats (Jim Fehlig) 5. [PATCH 0/6] Fix some Coverity issues (John Ferlan) -- Message: 1 Date: Wed, 23 Sep 2015 22:48:14 +0200 From: Jiri Denemark To: libvir-list@redhat.com Subject: [libvirt] [PATCH] domain: Fix migratable XML with graphics/@listen Message-ID: <1e763711f268f0f5d09f6a70aab87bf13dd459f9.1443041294.git.jdene...@redhat.com> As of commit 6992994, we set graphics/@listen attribute according to the first listen child element even if that element is of type='network'. This was done for backward compatibility with applications which only support the original listen attribute. However, by doing so we broke migration to older libvirt which tried to check that the listen attribute matches one of the listen child elements but which did not take type='network' elements into account. We are not concerned about compatibility with old applications when formatting domain XML for migration for two reasons. The XML is consumed only by libvirtd and the IP address associated with type='network' listen address on the source host is just useless on the destination host. Thus, we can safely avoid propagating the type='network' IP address to graphics/@listen attribute when creating migratable XML. https://bugzilla.redhat.com/show_bug.cgi?id=1265111 Signed-off-by: Jiri Denemark --- src/conf/domain_conf.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index c890977..033ae46 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -21020,19 +21020,17 @@ virDomainGraphicsDefFormat(virBufferPtr buf, * . This is done to improve backward compatibility. */ for (i = 0; i < def->nListens; i++) { -virDomainGraphicsListenType listenType; - if (flags & VIR_DOMAIN_DEF_FORMAT_MIGRATABLE && def->listens[i].fromConfig) continue; -listenType = virDomainGraphicsListenGetType(def, i); -if (listenType == VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_ADDRESS || -(listenType == VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NETWORK && - !(flags & VIR_DOMAIN_DEF_FORMAT_INACTIVE))) { -if ((listenAddr = virDomainGraphicsListenGetAddress(def, i))) -break; -} +if (def->listens[i].type == VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NETWORK && +flags & (VIR_DOMAIN_DEF_FORMAT_INACTIVE | + VIR_DOMAIN_DEF_FORMAT_MIGRATABLE)) +continue; + +if ((listenAddr = virDomainGraphicsListenGetAddress(def, i))) +break; } virBufferAsprintf(buf, " To: libvir-list@redhat.com Subject: [libvirt] [PATCH] storage: Fix incorrect format for XML Message-ID: <1443041675-19738-1-git-send-email-jfer...@redhat.com> https://bugzilla.redhat.com/show_bug.cgi?id=1256999 When creating a copy of the 'authdef', need to take into account the slight variation between and before blindly copying the 'authType' field. This ensures virStorageAuthDefFormat will properly format the XML for a . Signed-off-by: John Ferlan --- src/util/virstoragefile.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index 2aa1d90..0b72cb3 100644 --- a/src/util/virstoragefile.c +++ b/src/util/virstoragefile.c @@ -1522,7 +1522,12 @@ virStorageAuthDefCopy(const virStorageAuthDef *src) /* Not present for storage pool, but used for disk source */ if (VIR_STRDUP(ret->secrettype, src->secrettype) < 0)
Re: [libvirt] add a rbd disk by virsh attach-device , the operation fails
The problem has been resolved,. qemu-kvm is required to support the Ceph RBD versions, and restart the virtual machine; --- -邮件原件- 发件人: Martin Kletzander [mailto:mklet...@redhat.com] 发送时间: 2015年5月5日 14:15 收件人: 饶俊明 抄送: libvir-list@redhat.com 主题: Re: [libvirt] add a rbd disk by virsh attach-device , the operation fails On Tue, May 05, 2015 at 03:25:39AM +, 饶俊明 wrote: >Hello: > add a rbd disk by virsh attach-device ,the operation fails; libvirt >version: libvirt-0.10.2-46.el6.x86_64 operated virsh pool-info, pool-edit, >attach-device domain_id /tmp/rbddisk.xml command: > Hi there, this list is for upstream discussions and as I can see, the version of libvirt you are using is a little old and it's downstream. Try whether this problem persist with e.g. the now released version 1.2.15 or feel free to contact your support specialist in case you are using RHEL. >virsh # pool-info 0a081d22-070b-3f58-a883-78e29012b052 >Name: 0a081d22-070b-3f58-a883-78e29012b052 >UUID: 0a081d22-070b-3f58-a883-78e29012b052 >State: running >Persistent: no >Autostart: no >Capacity: 305.50 TiB >Allocation: 173.06 GiB >Available: 304.98 TiB > >virsh # pool-edit 0a081d22-070b-3f58-a883-78e29012b052 > > 0a081d22-070b-3f58-a883-78e29012b052 > 0a081d22-070b-3f58-a883-78e29012b052 > 335898508001280 > 185824236409 > 335327800442880 > > >ebs_sz_01_01 > > > > > > >virsh # attach-device 52 /tmp/rbddisk.xml >error: Failed to attach device from /tmp/rbddisk.xml >error: internal error unable to execute QEMU command >'__com.redhat_drive_add': Device 'drive-virtio-disk1' could not be >initialized > This error comes from qemu, but it doesn't say much. Does the domain fail to start with the disk already in the XML or is this a problem just with hot-plugging? >This context of /tmp/rbddisk.xml : > > > > > > name='ebs_sz_01_01/5eba8a02-f251-4674-88b8-e368a07d50c5'> > > > > function='0x0'/> > > >This error information in libvirtd log file: >2015-05-05 02:51:52.005+: 32082: error : >qemuMonitorJSONCheckError:359 : internal error unable to execute QEMU >command '__com.redhat_drive_add': Device 'drive-virtio-disk1' could not >be initialized > This is only one line and it doesn't say anything more than the error from virsh. Try looking at more context, or rather in the domain's log file where qemu might've said more about the error. The information in this email is confidential and may be legally privileged. If you have received this email in error or are not the intended recipient, please immediately notify the sender and delete this message from your computer. Any use, distribution, or copying of this email other than by the intended recipient is strictly prohibited. All messages sent to and from us may be monitored to ensure compliance with internal policies and to protect our business. Emails are not secure and cannot be guaranteed to be error free as they can be intercepted, amended, lost or destroyed, or contain viruses. Anyone who communicates with us by email is taken to accept these risks. 收发邮件者请注意: 本邮件含保密信息,若误收本邮件,请务必通知发送人并直接删去,不得使用、传播或复制本邮件。 进出邮件均受到本公司合规监控。邮件可能发生被截留、被修改、丢失、被破坏或包含计算机病毒等不安全情况。 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] add a rbd disk by virsh attach-device , the operation fails
Hello: add a rbd disk by virsh attach-device ,the operation fails; libvirt version: libvirt-0.10.2-46.el6.x86_64 operated virsh pool-info, pool-edit, attach-device domain_id /tmp/rbddisk.xml command: virsh # pool-info 0a081d22-070b-3f58-a883-78e29012b052 Name: 0a081d22-070b-3f58-a883-78e29012b052 UUID: 0a081d22-070b-3f58-a883-78e29012b052 State: running Persistent: no Autostart: no Capacity: 305.50 TiB Allocation: 173.06 GiB Available: 304.98 TiB virsh # pool-edit 0a081d22-070b-3f58-a883-78e29012b052 0a081d22-070b-3f58-a883-78e29012b052 0a081d22-070b-3f58-a883-78e29012b052 335898508001280 185824236409 335327800442880 ebs_sz_01_01 virsh # attach-device 52 /tmp/rbddisk.xml error: Failed to attach device from /tmp/rbddisk.xml error: internal error unable to execute QEMU command '__com.redhat_drive_add': Device 'drive-virtio-disk1' could not be initialized This context of /tmp/rbddisk.xml : This error information in libvirtd log file: 2015-05-05 02:51:52.005+: 32082: error : qemuMonitorJSONCheckError:359 : internal error unable to execute QEMU command '__com.redhat_drive_add': Device 'drive-virtio-disk1' could not be initialized Thanks!! The information in this email is confidential and may be legally privileged. If you have received this email in error or are not the intended recipient, please immediately notify the sender and delete this message from your computer. Any use, distribution, or copying of this email other than by the intended recipient is strictly prohibited. All messages sent to and from us may be monitored to ensure compliance with internal policies and to protect our business. Emails are not secure and cannot be guaranteed to be error free as they can be intercepted, amended, lost or destroyed, or contain viruses. Anyone who communicates with us by email is taken to accept these risks. ��跺�浠惰��璇锋敞���锛� ��浠跺��淇�瀵�淇℃��锛���ヨ舵�浠讹��璇峰�″���ュ�浜哄苟��存�ュ伙��涓�寰�浣跨�ㄣ��浼���澶���舵�浠躲�� 杩���洪��浠跺���版���稿��瑙��с�浠跺藉�琚��琚�淇���广��涓㈠け���琚���村���璁$虹��姣�绛�涓�瀹���ㄦ点�� -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] 答复: libvirt-0.10.2-46 compress failed
Dear michal I have modified the code ,then, The result is success by rpmbuild -bb libvirt.spec Because my office environment causal relationship can not commit this code; Modified code info: 284 struct rados_cluster_stat_t modstat; 285 if (rados_cluster_stat(ptr.cluster, &modstat) < 0) { 286 virReportError(VIR_ERR_INTERNAL_ERROR, "%s", 287_("failed to stat the RADOS cluster")); 288 goto cleanup; 289 } 290 291 struct rados_pool_stat_t poolstat; 292 if (rados_ioctx_pool_stat(ptr.ioctx, &poolstat) < 0) { 293 virReportError(VIR_ERR_INTERNAL_ERROR, 294_("failed to stat the RADOS pool '%s'"), 295pool->def->source.name); 296 goto cleanup; 297 } 298 299 pool->def->capacity = modstat.kb * 1024; 300 pool->def->available = modstat.kb_avail * 1024; 301 pool->def->allocation = poolstat.num_bytes; 302 303 VIR_DEBUG("Utilization of RBD pool %s: (kb: %llu kb_avail: %llu num_bytes: %llu)", 304 pool->def->source.name, (unsigned long long)modstat.kb, 305 (unsigned long long)modstat.kb_avail, 306 (unsigned long long)poolstat.num_bytes); -----邮件原件- 发件人: Michal Privoznik [mailto:mpriv...@redhat.com] 发送时间: 2015年4月21日 20:35 收件人: 饶俊明; libvir-list@redhat.com 主题: Re: [libvirt] libvirt-0.10.2-46 compress failed On 21.04.2015 08:48, 饶俊明 wrote: > Hello > > When compress libvirt-0.10.2-46.el6.src.rpm to support rbd, then > failed; > > Error log: > cc1: warnings being treated as errors > storage/storage_backend_rbd.c: In function 'virStorageBackendRBDRefreshPool': > storage/storage_backend_rbd.c:284: error: declaration of 'stat' > shadows a global declaration [-Wshadow] > /usr/include/sys/stat.h:455: error: shadowed declaration is here > [-Wshadow] At top level: > cc1: error: unrecognized command line option "-Wno-suggest-attribute=const" > cc1: error: unrecognized command line option "-Wno-suggest-attribute=pure" > make[3]: *** [libvirt_driver_storage_impl_la-storage_backend_rbd.lo] > Error 1 > make[3]: *** Waiting for unfinished jobs > make[3]: Leaving directory `/home/ada/rpmbuild/BUILD/libvirt-0.10.2/src' > make[2]: *** [all] Error 2 > make[2]: Leaving directory `/home/ada/rpmbuild/BUILD/libvirt-0.10.2/src' > make[1]: *** [all-recursive] Error 1 > make[1]: Leaving directory `/home/ada/rpmbuild/BUILD/libvirt-0.10.2' > make: *** [all] Error 2 > error: Bad exit status from /var/tmp/rpm-tmp.g0IuFq (%build) RPM build > errors: > Bad exit status from /var/tmp/rpm-tmp.g0IuFq (%build) > > Thanks!!! > Seems like this patch needs to be backported: commit 6100cd985c9958f5590875e80597e26118e58bd9 Author: Michael Chapman AuthorDate: Wed Dec 11 19:14:51 2013 +1100 Commit: Michal Privoznik CommitDate: Wed Dec 11 10:18:15 2013 +0100 storage_backend_rbd: rename "stat" variable This variable shadows the stat(2) function, which only became visible in this scope as of commit 9cac8639. Rename the variable so it doesn't conflict. Signed-off-by: Michael Chapman v1.2.0-117-g6100cd9 Michal The information in this email is confidential and may be legally privileged. If you have received this email in error or are not the intended recipient, please immediately notify the sender and delete this message from your computer. Any use, distribution, or copying of this email other than by the intended recipient is strictly prohibited. All messages sent to and from us may be monitored to ensure compliance with internal policies and to protect our business. Emails are not secure and cannot be guaranteed to be error free as they can be intercepted, amended, lost or destroyed, or contain viruses. Anyone who communicates with us by email is taken to accept these risks. 收发邮件者请注意: 本邮件含保密信息,若误收本邮件,请务必通知发送人并直接删去,不得使用、传播或复制本邮件。 进出邮件均受到本公司合规监控。邮件可能发生被截留、被修改、丢失、被破坏或包含计算机病毒等不安全情况。 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] libvirt-0.10.2-46 compress failed
Hello When compress libvirt-0.10.2-46.el6.src.rpm to support rbd, then failed; Error log: cc1: warnings being treated as errors storage/storage_backend_rbd.c: In function 'virStorageBackendRBDRefreshPool': storage/storage_backend_rbd.c:284: error: declaration of 'stat' shadows a global declaration [-Wshadow] /usr/include/sys/stat.h:455: error: shadowed declaration is here [-Wshadow] At top level: cc1: error: unrecognized command line option "-Wno-suggest-attribute=const" cc1: error: unrecognized command line option "-Wno-suggest-attribute=pure" make[3]: *** [libvirt_driver_storage_impl_la-storage_backend_rbd.lo] Error 1 make[3]: *** Waiting for unfinished jobs make[3]: Leaving directory `/home/ada/rpmbuild/BUILD/libvirt-0.10.2/src' make[2]: *** [all] Error 2 make[2]: Leaving directory `/home/ada/rpmbuild/BUILD/libvirt-0.10.2/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/ada/rpmbuild/BUILD/libvirt-0.10.2' make: *** [all] Error 2 error: Bad exit status from /var/tmp/rpm-tmp.g0IuFq (%build) RPM build errors: Bad exit status from /var/tmp/rpm-tmp.g0IuFq (%build) Thanks!!! The information in this email is confidential and may be legally privileged. If you have received this email in error or are not the intended recipient, please immediately notify the sender and delete this message from your computer. Any use, distribution, or copying of this email other than by the intended recipient is strictly prohibited. All messages sent to and from us may be monitored to ensure compliance with internal policies and to protect our business. Emails are not secure and cannot be guaranteed to be error free as they can be intercepted, amended, lost or destroyed, or contain viruses. Anyone who communicates with us by email is taken to accept these risks. ��跺�浠惰��璇锋敞���锛� ��浠跺��淇�瀵�淇℃��锛���ヨ舵�浠讹��璇峰�″���ュ�浜哄苟��存�ュ伙��涓�寰�浣跨�ㄣ��浼���澶���舵�浠躲�� 杩���洪��浠跺���版���稿��瑙��с�浠跺藉�琚��琚�淇���广��涓㈠け���琚���村���璁$虹��姣�绛�涓�瀹���ㄦ点�� -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list