[libvirt] [PATCH] Priority of vzctl create should be lower
Hi all About OpenVZ, it uses vzctl command that produces tar/gzip commands. I think we should lower these commands for running other procedures prior to them. This is the patch to achieve it with nice/ionice commands. From ff3cf022995ef541136bd40579af2eeb20aeafdb Mon Sep 17 00:00:00 2001 From: root r...@node13.nvlab.org Date: Mon, 26 Oct 2009 02:44:43 + Subject: [PATCH] lower priority for running tar and gzip during vzctl create --- src/openvz/openvz_driver.c |8 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c index f64ad1e..59d38ae 100644 --- a/src/openvz/openvz_driver.c +++ b/src/openvz/openvz_driver.c @@ -130,6 +130,14 @@ openvzDomainDefineCmd(virConnectPtr conn, } while (0) narg = 0; + +/* lower priority for running tar and gzip */ +ADD_ARG_LIT(nice); +ADD_ARG_LIT(-n); +ADD_ARG_LIT(19); +ADD_ARG_LIT(ionice); +ADD_ARG_LIT(-c3); + ADD_ARG_LIT(VZCTL); ADD_ARG_LIT(--quiet); ADD_ARG_LIT(create); -- 1.5.3.4 - Yuji Nishida nish...@nict.go.jp -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] Add a default log_level to qemudSetLogging to remove a build warning.
Cole Robinson wrote: On 10/23/2009 07:01 AM, Chris Lalancette wrote: (original patch from Charles Duffy) Signed-off-by: Chris Lalancette clala...@redhat.com --- daemon/libvirtd.c | 11 +++ 1 files changed, 3 insertions(+), 8 deletions(-) diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c index 03bc1b4..4eb33bc 100644 --- a/daemon/libvirtd.c +++ b/daemon/libvirtd.c @@ -2509,8 +2509,9 @@ remoteReadSaslAllowedUsernameList (virConfPtr conf ATTRIBUTE_UNUSED, * debugging is asked for then output informations or debug. */ static int -qemudSetLogging(virConfPtr conf, const char *filename) { -int log_level; +qemudSetLogging(virConfPtr conf, const char *filename) +{ +int log_level = 0; char *log_filters = NULL; char *log_outputs = NULL; int ret = -1; @@ -2531,12 +2532,6 @@ qemudSetLogging(virConfPtr conf, const char *filename) { * level has been set, we must process variables in the opposite * order, each one overriding the previous. */ -/* - * GET_CONF_INT returns 0 when there is no log_level setting in - * the config file. The conditional below eliminates a false - * warning in that case, but also has the side effect of missing - * a warning if the user actually does say log_level=0. - */ GET_CONF_INT (conf, filename, log_level); if (log_level != 0) virLogSetDefaultPriority(log_level); ACK Thanks, committed. -- Chris Lalancette -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] Add a new syntax-check rule for gethostname.
Cole Robinson wrote: On 10/23/2009 07:01 AM, Chris Lalancette wrote: We should always be using virGetHostname in place of gethostname; thus add in a new syntax-check rule to make sure no new uses creep in. Signed-off-by: Chris Lalancette clala...@redhat.com --- .x-sc_prohibit_gethostname |2 ++ Makefile.am|1 + cfg.mk |5 + src/libvirt.c |2 +- 4 files changed, 9 insertions(+), 1 deletions(-) create mode 100644 .x-sc_prohibit_gethostname diff --git a/.x-sc_prohibit_gethostname b/.x-sc_prohibit_gethostname new file mode 100644 index 000..e7acb03 --- /dev/null +++ b/.x-sc_prohibit_gethostname @@ -0,0 +1,2 @@ +^src/util/util\.c$ +^ChangeLog-old$ diff --git a/Makefile.am b/Makefile.am index 14fc593..32cd96a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -23,6 +23,7 @@ EXTRA_DIST = \ .x-sc_m4_quote_check \ .x-sc_prohibit_asprintf \ .x-sc_prohibit_gethostby \ + .x-sc_prohibit_gethostname \ .x-sc_prohibit_have_config_h \ .x-sc_prohibit_HAVE_MBRTOWC \ .x-sc_prohibit_nonreentrant \ diff --git a/cfg.mk b/cfg.mk index c1d3864..45d6531 100644 --- a/cfg.mk +++ b/cfg.mk @@ -94,6 +94,11 @@ sc_prohibit_strncpy: msg='use virStrncpy, not strncpy' \ $(_prohibit_regexp) +sc_prohibit_gethostname: +@re='gethostname *\(' \ +msg='use virGetHostname, not gethostname' \ + $(_prohibit_regexp) + sc_prohibit_VIR_ERR_NO_MEMORY: @re='\V''IR_ERR_NO_MEMORY\' \ msg='use virReportOOMError, not V'IR_ERR_NO_MEMORY \ diff --git a/src/libvirt.c b/src/libvirt.c index 5787f22..4e244bb 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -1441,7 +1441,7 @@ error: * @conn: pointer to a hypervisor connection * * This returns the system hostname on which the hypervisor is - * running (the result of the gethostname(2) system call). If + * running (the result of the gethostname system call). If * we are connected to a remote system, then this returns the * hostname of the remote system. * ACK Thanks, committed. -- Chris Lalancette -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] Better error message when libvirtd fails to start.
Cole Robinson wrote: On 10/23/2009 07:01 AM, Chris Lalancette wrote: Signed-off-by: Chris Lalancette clala...@redhat.com --- daemon/libvirtd.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c index 78dfb2d..03bc1b4 100644 --- a/daemon/libvirtd.c +++ b/daemon/libvirtd.c @@ -2972,7 +2972,9 @@ int main(int argc, char **argv) { if (mkdir (rundir, 0755)) { if (errno != EEXIST) { -VIR_ERROR0 (_(unable to create rundir)); +char ebuf[1024]; +VIR_ERROR(_(unable to create rundir %s: %s), rundir, + virStrerror(errno, ebuf, sizeof(ebuf))); return -1; } } ACK Thanks, committed. -- Chris Lalancette -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] Remove a completely bogus reference increment in the Xen driver.
Cole Robinson wrote: On 10/23/2009 07:01 AM, Chris Lalancette wrote: xenUnifiedDomainEventRegister() calls out to virDomainEventCallbackListAdd(), which increments the reference count on the connection. That is fine, but then xenUnifiedDomainEventRegister() increments the usage count again, leading to a usage count leak. Remove the increment in the xen register, and the UnrefConnect in the xen unregister. Signed-off-by: Chris Lalancette clala...@redhat.com --- src/xen/xen_driver.c |6 -- 1 files changed, 0 insertions(+), 6 deletions(-) diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c index 5273a11..f2744b0 100644 --- a/src/xen/xen_driver.c +++ b/src/xen/xen_driver.c @@ -1502,9 +1502,6 @@ xenUnifiedDomainEventRegister (virConnectPtr conn, ret = virDomainEventCallbackListAdd(conn, priv-domainEventCallbacks, callback, opaque, freefunc); -if (ret == 0) -conn-refs++; - xenUnifiedUnlock(priv); return (ret); } @@ -1530,9 +1527,6 @@ xenUnifiedDomainEventDeregister (virConnectPtr conn, ret = virDomainEventCallbackListRemove(conn, priv-domainEventCallbacks, callback); -if (ret == 0) -virUnrefConnect(conn); - xenUnifiedUnlock(priv); return ret; } ACK. Thanks, committed. -- Chris Lalancette -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] Replace a gethostname by virGetHostname in libvirtd.c
Cole Robinson wrote: On 10/23/2009 07:01 AM, Chris Lalancette wrote: Signed-off-by: Chris Lalancette clala...@redhat.com --- daemon/libvirtd.c | 10 +++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c index 4eb33bc..02bd287 100644 --- a/daemon/libvirtd.c +++ b/daemon/libvirtd.c @@ -937,15 +937,19 @@ static struct qemud_server *qemudNetworkInit(struct qemud_server *server) { server-mdns = libvirtd_mdns_new(); if (!mdns_name) { -char groupname[64], localhost[HOST_NAME_MAX+1], *tmp; +char groupname[64], *localhost, *tmp; /* Extract the host part of the potentially FQDN */ -gethostname(localhost, HOST_NAME_MAX); -localhost[HOST_NAME_MAX] = '\0'; +localhost = virGetHostname(); +if (localhost == NULL) { +virReportOOMError(NULL); +goto cleanup; +} if ((tmp = strchr(localhost, '.'))) *tmp = '\0'; snprintf(groupname, sizeof(groupname)-1, Virtualization Host %s, localhost); groupname[sizeof(groupname)-1] = '\0'; group = libvirtd_mdns_add_group(server-mdns, groupname); +VIR_FREE(localhost); } else { group = libvirtd_mdns_add_group(server-mdns, mdns_name); } ACK Thanks, committed. -- Chris Lalancette -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] Replace gethostname by virGetHostname in xend_internal.c
Cole Robinson wrote: On 10/23/2009 07:01 AM, Chris Lalancette wrote: --- src/xen/xend_internal.c | 11 +-- 1 files changed, 1 insertions(+), 10 deletions(-) diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c index 27d215e..d3ab019 100644 --- a/src/xen/xend_internal.c +++ b/src/xen/xend_internal.c @@ -4342,21 +4342,12 @@ xenDaemonDomainMigratePrepare (virConnectPtr dconn, const char *dname ATTRIBUTE_UNUSED, unsigned long resource ATTRIBUTE_UNUSED) { -int r; -char hostname [HOST_NAME_MAX+1]; - /* If uri_in is NULL, get the current hostname as a best guess * of how the source host should connect to us. Note that caller * deallocates this string. */ if (uri_in == NULL) { -r = gethostname (hostname, HOST_NAME_MAX+1); -if (r == -1) { -virReportSystemError(dconn, errno, - _(unable to resolve name %s), hostname); -return -1; -} -*uri_out = strdup (hostname); +*uri_out = virGetHostname(); if (*uri_out == NULL) { virReportOOMError(dconn); return -1; ACK Thanks, committed. -- Chris Lalancette -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] Replace two strcmp() by STREQ() in qemu_driver.c
Cole Robinson wrote: On 10/23/2009 07:01 AM, Chris Lalancette wrote: Signed-off-by: Chris Lalancette clala...@redhat.com --- src/qemu/qemu_driver.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 4cd235d..da7dda7 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -4142,7 +4142,7 @@ qemudCanonicalizeMachineFromInfo(virDomainDefPtr def, if (!machine-canonical) continue; -if (strcmp(def-os.machine, machine-name) != 0) +if (STRNEQ(def-os.machine, machine-name)) continue; if (!(*canonical = strdup(machine-canonical))) { @@ -4171,7 +4171,7 @@ qemudCanonicalizeMachineDirect(virDomainDefPtr def, char **canonical) if (!machines[i]-canonical) continue; -if (strcmp(def-os.machine, machines[i]-name) != 0) +if (STRNEQ(def-os.machine, machines[i]-name)) continue; *canonical = machines[i]-canonical; ACK, We add a make syntax-check for that. Thanks, committed. -- Chris Lalancette -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] Various syntax-check fixes.
Cole Robinson wrote: On 10/23/2009 07:01 AM, Chris Lalancette wrote: Make a pass over the syntax-check files, tightening up regex's, un-ignoring certain files, and cleaning things up. Signed-off-by: Chris Lalancette clala...@redhat.com --- .x-sc_prohibit_VIR_ERR_NO_MEMORY | 13 + .x-sc_prohibit_gethostby |5 ++--- .x-sc_prohibit_strcmp_and_strncmp |7 +++ .x-sc_prohibit_strncpy|2 +- .x-sc_require_config_h|1 - Makefile.am | 14 -- cfg.mk|8 +++- 7 files changed, 30 insertions(+), 20 deletions(-) diff --git a/.x-sc_prohibit_VIR_ERR_NO_MEMORY b/.x-sc_prohibit_VIR_ERR_NO_MEMORY index fbefbeb..5c96e83 100644 --- a/.x-sc_prohibit_VIR_ERR_NO_MEMORY +++ b/.x-sc_prohibit_VIR_ERR_NO_MEMORY @@ -1,8 +1,5 @@ -ChangeLog -docs/devhelp/libvirt-virterror.html -docs/html/libvirt-virterror.html -docs/libvirt-api.xml -docs/libvirt-refs.xml -include/libvirt/virterror.h -daemon/dispatch.c -src/util/virterror.c +^ChangeLog$ +^ChangeLog-old$ +^include/libvirt/virterror\.h$ +^daemon/dispatch\.c$ +^src/util/virterror\.c$ diff --git a/.x-sc_prohibit_gethostby b/.x-sc_prohibit_gethostby index c771142..7c052f4 100644 --- a/.x-sc_prohibit_gethostby +++ b/.x-sc_prohibit_gethostby @@ -1,3 +1,2 @@ -gnulib/lib/getaddrinfo.c -gnulib/m4/ -src/xend_internal.c +^gnulib/lib/getaddrinfo\.c$ +^gnulib/m4/ diff --git a/.x-sc_prohibit_strcmp_and_strncmp b/.x-sc_prohibit_strcmp_and_strncmp index b7c456e..c0d8793 100644 --- a/.x-sc_prohibit_strcmp_and_strncmp +++ b/.x-sc_prohibit_strcmp_and_strncmp @@ -1 +1,8 @@ ^gnulib/ +^ChangeLog-old$ +^examples/domain-events/events-c/event-test\.c$ +^src/internal\.h$ +^src/lxc/lxc_container\.c$ +^src/node_device/node_device_devkit\.c$ +^src/node_device/node_device_hal\.c$ +^src/storage/parthelper\.c$ diff --git a/.x-sc_prohibit_strncpy b/.x-sc_prohibit_strncpy index 10bc29c..70e2300 100644 --- a/.x-sc_prohibit_strncpy +++ b/.x-sc_prohibit_strncpy @@ -1 +1 @@ -src/util/util.c +^src/util/util\.c$ diff --git a/.x-sc_require_config_h b/.x-sc_require_config_h index e1f6e10..a530ae0 100644 --- a/.x-sc_require_config_h +++ b/.x-sc_require_config_h @@ -1,5 +1,4 @@ ^examples/ ^gnulib/lib/dummy\.c$ ^gnulib/tests/dummy\.c$ -^daemon/remote_protocol\.c$ ^ChangeLog$ diff --git a/Makefile.am b/Makefile.am index 977ad0c..14fc593 100644 --- a/Makefile.am +++ b/Makefile.am @@ -17,12 +17,22 @@ EXTRA_DIST = \ mingw32-libvirt.spec.in \ libvirt.pc libvirt.pc.in \ autobuild.sh \ + .x-sc_avoid_ctype_macros \ .x-sc_avoid_if_before_free \ - .x-sc_require_config_h_first \ + .x-sc_avoid_write \ + .x-sc_m4_quote_check \ + .x-sc_prohibit_asprintf \ + .x-sc_prohibit_gethostby \ + .x-sc_prohibit_have_config_h \ + .x-sc_prohibit_HAVE_MBRTOWC \ + .x-sc_prohibit_nonreentrant \ .x-sc_prohibit_strcmp \ .x-sc_prohibit_strcmp_and_strncmp \ + .x-sc_prohibit_strncpy \ + .x-sc_prohibit_VIR_ERR_NO_MEMORY \ .x-sc_require_config_h \ - .x-sc_prohibit_nonreentrant \ + .x-sc_require_config_h_first \ + .x-sc_trailing_blank \ Makefile.nonreentrant \ autogen.sh \ examples/domain-events/events-python \ diff --git a/cfg.mk b/cfg.mk index 44cfd17..c1d3864 100644 --- a/cfg.mk +++ b/cfg.mk @@ -79,11 +79,9 @@ sc_avoid_write: # Use STREQ rather than comparing strcmp == 0, or != 0. # Similarly, use STREQLEN or STRPREFIX rather than strncmp. sc_prohibit_strcmp_and_strncmp: -@grep -nE '! *strn?cmp *\(|\strn?cmp *\([^)]+\) *==' \ -$$($(VC_LIST_EXCEPT)) \ - | grep -vE ':# *define STREQ(LEN)?\(' \ - { echo '$(ME): use STREQ(LEN) in place of the above uses of strcmp(strncmp)' \ -12; exit 1; } || : +@re='strn?cmp *\(' \ +msg='use STREQ() in place of the above uses of str[n]cmp' \ + $(_prohibit_regexp) # Use virAsprintf rather than a'sprintf since *strp is undefined on error. sc_prohibit_asprintf: ACK Thanks, committed. -- Chris Lalancette -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 19/21] Start of support for QEMU JSON based monitor protocol
On 10/23/2009 03:05 PM, Daniel P. Berrange wrote: +if (mon-json) +ret = qemuMonitorJSONSystemPowerdown(mon); +else +ret = qemuMonitorTextSystemPowerdown(mon); Why not make a vtable? Paolo -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] Re: iSCSI Multi-IQN (Libvirt Support)
shyam_i...@dell.com wrote: -Original Message- From: Dave Allan [mailto:dal...@redhat.com] Sent: Friday, October 23, 2009 2:55 AM To: Iyer, Shyam Cc: libvir-list@redhat.com; Bellad, Sudhir; Domsch, Matt; KM, Paniraja Subject: Re: [libvirt] Re: iSCSI Multi-IQN (Libvirt Support) shyam_i...@dell.com wrote: I like the functionality. To restate what I said when you first proposed it, though, each pool is currently based on one iSCSI session, so to preserve that paradigm, you should only allow zero or one initiator IQNs per pool. If the pool contains an initiator IQN, it will be used when creating the session. If it does not contain an initiator IQN, the system default initiator IQN will be used. If you require multiple initiator IQNs, you create multiple pools, one per initiator IQN each with the same target. I think that approach will result in a very small patch. Do you have a specific use case for which that approach would not work? Dave Yes. Let us say I want to consider the LUNs behind a Target IQN as pool A.(Target centric terminology) If each initiator iqn creates separate pools than there will be duplicity of the same set of LUNs. And this is a side effect not necessarily a deliberate one. I'm not sure I understood you. If a LUN is visible on multiple sessions, there's going to be duplication of LUNs regardless of whether you use one pool with multiple sessions or multiple pools with one session per pool, because you're still establishing those sessions. You're also not guaranteed to have the same set of LUNs on both sessions, so you can't trust that the set of LUNs you get on one session is the same as the set on another session. Sorry. I wasn't clear. The present design allows the following - Hi Shyam, Your ASCII diagram got mangled by the emailing process. Would you mind sending a text document with it? I think I see what you're saying, but I'd like to confirm with your diagram before I comment further. Dave 1) --LUN A | -Initiator IQN1Session 1--Target IQN A--LUN B | | --LUN A | | Pool A---Initiator IQN2Session 2--Target IQN A--LUN B | | -Initiator IQN3Session 3--Target IQN B--LUN C Target IQN A, B and C Or, --LUN A 2) | -Initiator IQN1Session 1--Target IQN A--LUN B | | --LUN C | | Pool A---Initiator IQN2Session 2--Target IQN B--LUN D | | -Initiator IQN3Session 3--Target IQN C--LUN E And also, the one that you are describing. One pool for each initiator IQN 3) --LUN A | | Pool AInitiator IQN1---Session 1--Target IQN A--LUN B | | --LUN C Today, the pool concept abstracts multiple LUNs behind a Target IQN into a common storage pool with a single session. The advantage of doing that with one pool is that managing the multiple LUNs with one pool becomes easy. By also abstracting multiple initiator iqns into a pool concept, the management of storage pools becomes easy for the same reason - LUN management. At the same time it allows flexibility to realize a one pool per initiator iqn scenario that exists today. Consider the following example. If we use a separate pool for each initiator IQNs. #virsh virsh pool create StorageArray_1_initiatoriqn1 virsh pool create StorageArray_1_initiatoriqn2 ... ... virsh pool create StorageArray_1_initiatoriqnN If all pools associated with StorageArray_1 had to be destroyed then the following would happen. virsh pool destroy StorageArray_1_initiatoriqn1 virsh pool destroy StorageArray_1_initiatoriqn2 ... ... virsh pool destroy StorageArray_1_initiatoriqnN In the design that allows multiple initiator IQNs for a pool. #virsh virsh pool create StorageArray_1 In this design the XML contains Multiple initiator IQNs and multiple sessions can be established for the pool StorageArray_1. virsh pool destroy StorageArray_1 With this design all the sessions for this pool will get destroyed with one effort. -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
RE: [libvirt] Re: iSCSI Multi-IQN (Libvirt Support)
shyam_i...@dell.com wrote: I like the functionality. To restate what I said when you first proposed it, though, each pool is currently based on one iSCSI session, so to preserve that paradigm, you should only allow zero or one initiator IQNs per pool. If the pool contains an initiator IQN, it will be used when creating the session. If it does not contain an initiator IQN, the system default initiator IQN will be used. If you require multiple initiator IQNs, you create multiple pools, one per initiator IQN each with the same target. I think that approach will result in a very small patch. Do you have a specific use case for which that approach would not work? Dave Yes. Let us say I want to consider the LUNs behind a Target IQN as pool A.(Target centric terminology) If each initiator iqn creates separate pools than there will be duplicity of the same set of LUNs. And this is a side effect not necessarily a deliberate one. I'm not sure I understood you. If a LUN is visible on multiple sessions, there's going to be duplication of LUNs regardless of whether you use one pool with multiple sessions or multiple pools with one session per pool, because you're still establishing those sessions. You're also not guaranteed to have the same set of LUNs on both sessions, so you can't trust that the set of LUNs you get on one session is the same as the set on another session. Sorry. I wasn't clear. The present design allows the following - Hi Shyam, Your ASCII diagram got mangled by the emailing process. Would you mind sending a text document with it? I think I see what you're saying, but I'd like to confirm with your diagram before I comment further. Dave Dave- Attached diagram doc describes the use cases. Thanks -Shyam The attached patch design allows the following combinations 1) --LUN A | -Initiator IQN1Session 1--Target IQN A--LUN B | | --LUN A | | Pool A -Initiator IQN2Session 2--Target IQN A--LUN B | | -Initiator IQN3Session 3--Target IQN B--LUN C Target IQN A, B and C Or, --LUN A 2) | -Initiator IQN1Session 1--Target IQN A--LUN B | | --LUN C | | Pool A -Initiator IQN2Session 2--Target IQN B--LUN D | | -Initiator IQN3Session 3--Target IQN C--LUN E And also, the one that is possible today. One pool for each initiator IQN 3) --LUN A | | Pool A Initiator IQN1-Session 1--Target IQN A--LUN B | | --LUN C Today, the pool concept abstracts multiple LUNs behind a Target IQN into a common storage pool with a single session. The advantage of doing that with one pool is that managing the multiple LUNs with one pool becomes easy. By also abstracting multiple initiator iqns into a pool concept, the management of storage pools becomes easy for the same reason - LUN management. At the same time it allows flexibility to realize a one pool per initiator iqn scenario that exists today. Consider the following example. If we use a separate pool for each initiator IQNs. #virsh virsh pool create StorageArray_1_initiatoriqn1 virsh pool create StorageArray_1_initiatoriqn2 ... ... virsh pool create StorageArray_1_initiatoriqnN If all pools associated with StorageArray_1 had to be destroyed then the following would happen. virsh pool destroy
Re: [libvirt] 0.7.1 compile fails on opensuse 11.1
Jim Fehlig wrote: Pritesh Kothari wrote: it seems openSuSE 11.1 does not come with a pkgconfig for the device-mapper-devel package. I created a bug [1] for opensuse but was also told to mention it here so configure.in could be patched once the bug was fixed. Hi All, Just fixed this for ubuntu (should work now for suse as well) with some help from danpb and DV. The patch is attached below. ACK to this patch btw, it does solve the problem in SuSE distros where device-mapper-devel is missing pkgconfig file. But the problem is really a bug in the devel package, so will this workaround be committed to libvirt configure script? Hi Daniel, Any plans to apply this patch? I can keep it locally for environments with broken dev-mapper-devel package if need be. Thanks! Jim -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] Fix error message in qemudLoadDriverConfig()
On 10/22/2009 11:54 AM, Matthias Bolte wrote: * src/qemu/qemu_conf.c: change the error message to refer to 'cgroup_controllers' instead of 'cgroup_device_acl' --- src/qemu/qemu_conf.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index 158e9a3..a095cb7 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -243,7 +243,7 @@ int qemudLoadDriverConfig(struct qemud_driver *driver, for (i = 0, pp = p-list; pp; ++i, pp = pp-next) { int ctl; if (pp-type != VIR_CONF_STRING) { -VIR_ERROR(%s, _(cgroup_device_acl must be a list of strings)); +VIR_ERROR(%s, _(cgroup_controllers must be a list of strings)); virConfFree(conf); return -1; } ACK - Cole -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] Fix problems in the Xen inotify driver.
On 10/24/2009 01:30 PM, Matthias Bolte wrote: In xenInotifyXendDomainsDirLookup() the wrong UUID variable is used to search in the config info list. In xenInotifyEvent() the event is dispatched if it's NULL. Both were introduced in bc898df2c74fe3c8efedfbbd430737bac950e65e. --- src/xen/xen_inotify.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/xen/xen_inotify.c b/src/xen/xen_inotify.c index 9e0407f..aa3893a 100644 --- a/src/xen/xen_inotify.c +++ b/src/xen/xen_inotify.c @@ -142,7 +142,7 @@ xenInotifyXendDomainsDirLookup(virConnectPtr conn, const char *filename, search for, and create a domain from the stored list info */ for (i = 0 ; i priv-configInfoList-count ; i++) { -if (!memcmp(uuid, priv-configInfoList-doms[i]-uuid, VIR_UUID_BUFLEN)) { +if (!memcmp(rawuuid, priv-configInfoList-doms[i]-uuid, VIR_UUID_BUFLEN)) { *name = strdup(priv-configInfoList-doms[i]-name); if (!*name) { virXenInotifyError(NULL, VIR_ERR_INTERNAL_ERROR, @@ -332,7 +332,7 @@ reread: xenInotifyDomainEventFromFile(conn, fname, VIR_DOMAIN_EVENT_UNDEFINED, VIR_DOMAIN_EVENT_UNDEFINED_REMOVED); -if (!event) +if (event) xenUnifiedDomainEventDispatch(conn-privateData, event); else virXenInotifyError(NULL, VIR_ERR_INTERNAL_ERROR, ACK - Cole -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] Re: [virt-tools-list] Remote management over SSH fails to connect
On Mon, Oct 26, 2009 at 3:04 PM, Cole Robinson crobi...@redhat.com wrote: On 10/25/2009 10:25 AM, Jon Nordby wrote: I get the following errors (skipping system yields the same): [r...@jon-laptop ~]# virsh -c qemu+ssh://10.0.0.2/system list error: server closed connection error: failed to connect to the hypervisor However, SSH and libvirtd both work on their own: [r...@jon-laptop ~]# ssh 10.0.0.2 Last login: Sun Oct 25 14:06:07 2009 from 10.0.0.143 [r...@server0 ~]# virsh list Id Name State -- 21 family-server running The connection is allowed in hosts.allow libvirt 0.7.2 in both ends, kvm backend, Arch Linux What could be the source of this problem? And how can I find it? ccing libvirt-list This could be an issue of 'nc' incompatibility. Does the 'nc' command on the remote system support the -U option? If you run the virsh command with LIBVIRT_DEBUG=1 virsh ... you should see the ssh command being run. See if running the command by hand produces an error. - Cole Thanks, that was indeed the issue! For the archives: the openbsd netcat implementation provides the -U option, where as gnu netcat does not. And I had to restart the daemon after installing the correct version for things to start working. -- Regards Jon Nordby - www.jonnor.com -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] add bootp server=...
On Mon, Oct 26, 2009 at 08:53:58AM -0400, Cole Robinson wrote: On 10/26/2009 08:14 AM, Paolo Bonzini wrote: On 10/22/2009 07:55 PM, Cole Robinson wrote: ACK, looks good to me. - Cole Could you push it for me? Thanks in advance, I'd prefer if either DV or danpb pushed this, since it's an API addition. Unfortunately they are both offline today. ACK, looks good to me. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :| -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 19/21] Start of support for QEMU JSON based monitor protocol
On Mon, Oct 26, 2009 at 11:15:22AM +0100, Paolo Bonzini wrote: On 10/23/2009 03:05 PM, Daniel P. Berrange wrote: +if (mon-json) +ret = qemuMonitorJSONSystemPowerdown(mon); +else +ret = qemuMonitorTextSystemPowerdown(mon); Why not make a vtable? We're not expecting to grow any more different protocol implementations, so I don't think it is a worthwhile tradeoff to introduce an extra layer of indirection into the code. Regards, Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :| -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] RestrictedVersion Error trying to shutdown an ESX VM
2009/10/26 Shahar Klein shaharkl...@yahoo.com I could swear it worked before: virsh # list Id Name State -- 352 ubuntu904 running 368 rh53 running virsh # shutdown 352 error: Failed to shutdown domain 352 error: internal error HTTP response code 500. VI Fault: ServerFaultCode - fault.RestrictedVersion.summary with LIBVIRT_DEBUG=1: virsh # shutdown 352 10:34:50.665: debug : virDomainLookupByID:1746 : conn=0x626440, id=352 10:34:50.687: debug : virGetDomain:344 : New hash entry 0x7104d0 10:34:50.687: debug : virDomainShutdown:2331 : domain=0x7104d0 error: Failed to shutdown domain 352 10:34:50.722: debug : virDomainFree:1958 : domain=0x7104d0 10:34:50.722: debug : virUnrefDomain:421 : unref domain 0x7104d0 ubuntu904 1 10:34:50.722: debug : virReleaseDomain:375 : release domain 0x7104d0 ubuntu904 10:34:50.722: debug : virReleaseDomain:391 : unref connection 0x626440 2 error: internal error HTTP response code 500. VI Fault: ServerFaultCode - fault.RestrictedVersion.summary The VMware documentation says this about a RestrictedVersion fault: Thrown when the caller is not permitted to perform the specified operation due to product versioning restrictions. What version of ESX is this? Maybe your license has expired? You need to have the VMware tools installed inside the virtual machine in order to call shutdown successfully, but I assume that this is the case because you say it has worked before. Also missing VMware tools should result in another error message: ServerFaultCode - Operation failed since VMware tools are not running in this virtual machine. Matthias -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] Re: iSCSI Multi-IQN (Libvirt Support)
shyam_i...@dell.com wrote: shyam_i...@dell.com wrote: I like the functionality. To restate what I said when you first proposed it, though, each pool is currently based on one iSCSI session, so to preserve that paradigm, you should only allow zero or one initiator IQNs per pool. If the pool contains an initiator IQN, it will be used when creating the session. If it does not contain an initiator IQN, the system default initiator IQN will be used. If you require multiple initiator IQNs, you create multiple pools, one per initiator IQN each with the same target. I think that approach will result in a very small patch. Do you have a specific use case for which that approach would not work? Dave Yes. Let us say I want to consider the LUNs behind a Target IQN as pool A.(Target centric terminology) If each initiator iqn creates separate pools than there will be duplicity of the same set of LUNs. And this is a side effect not necessarily a deliberate one. I'm not sure I understood you. If a LUN is visible on multiple sessions, there's going to be duplication of LUNs regardless of whether you use one pool with multiple sessions or multiple pools with one session per pool, because you're still establishing those sessions. You're also not guaranteed to have the same set of LUNs on both sessions, so you can't trust that the set of LUNs you get on one session is the same as the set on another session. Sorry. I wasn't clear. The present design allows the following - Hi Shyam, Your ASCII diagram got mangled by the emailing process. Would you mind sending a text document with it? I think I see what you're saying, but I'd like to confirm with your diagram before I comment further. Dave Dave- Attached diagram doc describes the use cases. Thanks -Shyam Ok, you're proposing what I thought you were proposing. My objection to what you want to do is that I think this sort of complexity is better done in the client application than in libvirt. In other words, I think that *some code*, *somewhere* is going to have to loop through all the sessions and create and delete each one and enumerate the LUs on each session. I think we are only debating whether that loop should be in the client application or in libvirt. Why do you think we should put that complexity into libvirt? The way I see a client using the API is: 1) The client application enumerates the initiator IQNs it wants to use to establish sessions 2) The client application enumerates the target IQNs it wants to use to establish sessions 3) For each session: a) The client constructs the XML describing the session and b) calls create pool The way you see the client using the API is: 1) The client application enumerates the initiator IQNs it wants to use to establish sessions 2) The client application enumerates the target IQNs it wants to use to establish sessions 3) The client constructs the XML describing all the sessions and 4) calls create pool Is there a functional difference? Dave -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] doc nits
2009/10/25 Matthias Bolte matthias.bo...@googlemail.com: 2009/10/25 Dan Kenigsberg dan...@redhat.com (sorry, these ones annoy me when they are online) --- src/datatypes.c | 4 ++-- src/libvirt.c | 22 +++--- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/datatypes.c b/src/datatypes.c index 89ad309..0601a79 100644 --- a/src/datatypes.c +++ b/src/datatypes.c @@ -71,7 +71,7 @@ virNetworkFreeName(virNetworkPtr network, const char *name ATTRIBUTE_UNUSED) /** * virInterfaceFreeName: - * @interface: a interface object + * @interface: an interface object * * Destroy the interface object, this is just used by the interface hash callback. * @@ -674,7 +674,7 @@ _(Failed to change interface mac address from %s to %s due to differing lengths * virReleaseInterface: * @interface: the interface to release * - * Unconditionally release all memory associated with a interface. + * Unconditionally release all memory associated with an interface. * The conn.lock mutex must be held prior to calling this, and will * be released prior to this returning. The interface obj must not * be used once this method returns. diff --git a/src/libvirt.c b/src/libvirt.c index 9e87900..f7a0761 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -291,7 +291,7 @@ virInitialize(void) #ifdef WITH_DRIVER_MODULES /* We don't care if any of these fail, because the whole point * is to allow users to only install modules they want to use. - * If they try to use a open a connection for a module that + * If they try to use an open a connection for a module that IMHO that line should read: If they try to open a connection for a module that The same comment is in daemon/libvirtd.c line 813. * is not loaded they'll get a suitable error at that point */ virDriverLoadModule(test); @@ -2050,7 +2050,7 @@ error: * virDomainResume: * @domain: a domain object * - * Resume an suspended domain, the process is restarted from the state where + * Resume a suspended domain, the process is restarted from the state where * it was frozen by calling virSuspendDomain(). * This function may requires privileged access * @@ -3999,7 +3999,7 @@ error: * * The path parameter is the name of the network interface. * - * Domains may have more than network interface. To get stats for + * Domains may have more than one network interface. To get stats for * each you should make multiple calls to this function. * * Individual fields within the stats structure may be returned @@ -4680,7 +4680,7 @@ error: * @domain: pointer to domain object, or NULL for Domain0 * @info: pointer to an array of virVcpuInfo structures (OUT) * @maxinfo: number of structures in info array - * @cpumaps: pointer to an bit map of real CPUs for all vcpus of this + * @cpumaps: pointer to a bit map of real CPUs for all vcpus of this * domain (in 8-bit bytes) (OUT) * If cpumaps is NULL, then no cpumap information is returned by the API. * It's assumed there is maxinfo cpumap in cpumaps array. @@ -9202,7 +9202,7 @@ error: * @xml: XML describing the secret. * @flags: flags, use 0 for now * - * If XML specifies an UUID, locates the specified secret and replaces all + * If XML specifies a UUID, locates the specified secret and replaces all * attributes of the secret specified by UUID by attributes specified in xml * (any attributes not specified in xml are discarded). * @@ -9713,7 +9713,7 @@ virStreamRef(virStreamPtr stream) * with the call, but may instead be delayed until a * subsequent call. * - * A example using this with a hypothetical file upload + * An example using this with a hypothetical file upload * API looks like * * virStreamPtr st = virStreamNew(conn, 0); @@ -9805,7 +9805,7 @@ error: * with the call, but may instead be delayed until a * subsequent call. * - * A example using this with a hypothetical file download + * An example using this with a hypothetical file download * API looks like * * virStreamPtr st = virStreamNew(conn, 0); @@ -9896,7 +9896,7 @@ error: * requested data source. This is simply a convenient alternative * to virStreamSend, for apps that do blocking-I/o. * - * A example using this with a hypothetical file upload + * An example using this with a hypothetical file upload * API looks like * * int mysource(virStreamPtr st, char *buf, int nbytes, void *opaque) { @@ -9993,7 +9993,7 @@ cleanup: * requested data sink. This is simply a convenient alternative * to virStreamRecv, for apps that do blocking-I/o. * - * A example using this with a hypothetical file download + * An example using this with a hypothetical file download * API looks like * * int mysink(virStreamPtr st, const char *buf, int nbytes, void *opaque) { @@ -10174,7 +10174,7 @@ error: * virStreamEventRemoveCallback: * @stream: pointer to the
Re: [libvirt] [PATCH] Priority of vzctl create should be lower
Hi Chris, I think vzctl create command invokes processes which occupy CPU and Disk I/O. It seems clearly necessary for such commands to prevent from running prior to other processes. But I almost agree with you. We should have flexibility about it for users. As you said if it requires to encode policy into libvirt, we should avoid it still now. And I want to spend more time in writing some other patches :) - Yuji Nishida nish...@nict.go.jp On 2009/10/26, at 21:15, Chris Lalancette wrote: Yuji NISHIDA wrote: Hi all About OpenVZ, it uses vzctl command that produces tar/gzip commands. I think we should lower these commands for running other procedures prior to them. This is the patch to achieve it with nice/ionice commands. I'm not sure that this is such a good idea, as it is encoding policy into libvirt. There have been other requests for being able to set the priorities of certain domains, so it might make sense to have a more generic priority concept that could be set by the user. Then the user would specify how important a particular task is, and we wouldn't be putting any policy into libvirt itself. -- Chris Lalancette -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list