Re: FW: [libvirt] error: unable to connect to'/usr/local/var/run/libvirt/libvirt-sock': Connection refused
1. Make sure you are using /usr/local/sbin/libvirtd built by you in your /etc/init.d/libvirt-bin or just you can just run "/usr/local/sbin/libvirtd -d"; 2. "ls -l /usr/local/lib/libvirt.so.0" to check if it is linked to libvirt.so.0.7; 在 2009-10-19一的 20:30 +0900,Ryota Ozaki写道: > On Mon, Oct 19, 2009 at 7:52 PM, Liu, Zhentao > wrote: > > Hi, ozaki > > > > Another erro of mine is that: > > > > -- > > r...@forest:/var/run/libvirt# /etc/init.d/libvirt-bin start > > * Starting libvirt management daemon > > libvirtd > > /usr/sbin/libvirtd: /usr/local/lib/libvirt.so.0: version > > `LIBVIRT_PRIVATE_0.6.1' not found (required by /usr/sbin/libvirtd) > > --- > > > > I think maybe I have mixed installed version 0.6.1 and 0.7.0. But I have no > > idea how can I fix it? > > Hmm, complicated ;-) but the above error should be avoided by replacing > /usr/sbin/libvirtd with /usr/local/sbin/libvirtd in /etc/init.d/libvirt-bin. > > ozaki-r > > > > > > Regards > > > > Zhentao > > -- > Libvir-list mailing list > Libvir-list@redhat.com > https://www.redhat.com/mailman/listinfo/libvir-list -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] create() and destroy() support for Power Hypervisor
2009/10/6 Eduardo Otubo : > Hello all, > > This patch includes a lot of changes: > > * I changed all references of uuid_db to uuid_table. Bigger name, but this > semantic has a better understanding. > > * Now we have a little control of UUID generated for each partition. It's > based on a table that matches UUID with LPAR's IDs, I keep it in a file that > is stored in the managed system (HMC or IVM). Even having isolated functions > to manipulate this file I still need to implement a way to lock it and make > the operation atomic to avoid corruptions. > > * The XML file used in the create() function still must be improved. I used > the tag to make a work around to handle storage pools. Now I ask for > some help, how do I use the tag if there is no reference to it at the > virDomainDef structure? > > I've been told that libvirt possibly would make a mini-release this week to > push some major fixes on Fedora 12. Is there a little possibility to push > these new phyp features too? This would be very important for the phyp > project, since this functions are not just to manage partitions but > manipulate them. > > Any comments are always welcome. > []'s Here you go! > @@ -129,17 +136,25 @@ phypOpen(virConnectPtr conn, > connection_data->session = session; > connection_data->auth = auth; > > -uuid_db->nlpars = 0; > -uuid_db->lpars = NULL; > +uuid_table->nlpars = 0; > +uuid_table->lpars = NULL; > + > +phyp_driver->uuid_table = uuid_table; > +if ((phyp_driver->caps = phypCapsInit()) == NULL) You're missing a virReportOOMError here, or report an error in phypCapsInit() if returning NULL from it. You've also forgotten to free the caps in phypClose() via virCapabilitiesFree() and phyp_driver via VIR_FREE. > +goto failure; > > -conn->privateData = uuid_db; > +conn->privateData = phyp_driver; > conn->networkPrivateData = connection_data; > -init_uuid_db(conn); > +if (phypUUIDTable_Init(conn) == -1) > +goto failure; > + > +if ((phyp_driver->vios_id = phypGetVIOSPartitionID(conn)) == -1) > +goto failure; > > return VIR_DRV_OPEN_SUCCESS; > >failure: > -VIR_FREE(uuid_db); > +VIR_FREE(uuid_table); You're potentially leaking uuid_table->lpars here. > VIR_FREE(connection_data); > VIR_FREE(string); > +int > phypDiskType(virConnectPtr conn, char *backing_device) > { > +phyp_driverPtr phyp_driver = conn->privateData; > ConnectionData *connection_data = conn->networkPrivateData; > LIBSSH2_SESSION *session = connection_data->session; > char *cmd; > int exit_status = 0; > +char *char_ptr; > +char *managed_system = conn->uri->path; > +int vios_id = phyp_driver->vios_id; > + > +/* need to shift one byte in order to remove the first "/" of URI > component */ > +if (managed_system[0] == '/') > +managed_system++; > + > +/* here we are handling only the first component of the path, > + * so skipping the second: > + * */ > +char_ptr = strchr(managed_system, '/'); > + > +if (char_ptr) > +*char_ptr = '\0'; May be prepare the managed_system name once in the phypOpen() function and store it in the phyp_driver struct, because you're using it in multiple functions. > @@ -1189,9 +1254,12 @@ phypDomainDumpXML(virDomainPtr dom, int flags) > > ret = virDomainDefFormat(dom->conn, def, flags); > > - err: > VIR_FREE(def); > return ret; > + > + err: > +VIR_FREE(def); Don't use VIR_FREE() with virDomainDefPtr. Use virDomainDefFree(def) instead. > +static virDomainPtr > +phypDomainCreateAndStart(virConnectPtr conn, > + const char *xml, > + unsigned int flags ATTRIBUTE_UNUSED) > +{ > + > +ConnectionData *connection_data = conn->networkPrivateData; > +LIBSSH2_SESSION *session = connection_data->session; > +virDomainDefPtr def = NULL; > +virDomainPtr dom = NULL; > +phyp_driverPtr phyp_driver = conn->privateData; > +uuid_tablePtr uuid_table = phyp_driver->uuid_table; > +lparPtr *lpars = uuid_table->lpars; > +unsigned int i = 0; > +char *managed_system = conn->uri->path; > +char *char_ptr = NULL; > + > +/* need to shift one byte in order to remove the first "/" of URI > component */ > +if (managed_system[0] == '/') > +managed_system++; > + > +/* here we are handling only the first component of the path, > + * so skipping the second: > + * */ > +char_ptr = strchr(managed_system, '/'); > + > +if (char_ptr) > +*char_ptr = '\0'; > + > + > +if (VIR_ALLOC(def) < 0) > +virReportOOMError(conn); Don't allocate def here because you're assigning the result of virDomainDefParseString() to it and are leaking the initial allocation. > +if (VIR_ALLOC(dom) < 0) > +virReportOOMError(conn); Don't allocate dom here but use virGetDomain() later. > +if (!(def = virDomainDefParseString(conn, p
[libvirt] Using libvirt to obtain mac address of virtual domain
Greetings, I am new to libvirt and am looking for the most efficient way to programmatically obtain the mac address from a virtual domain. Libvirt is providing access to xen and kvm in my case. A nudge in the right direction would be appreciated! Best Regards, Devin Carlen -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 1/3] node device: Fix locking issue in virNodeDeviceDestroy
Cole Robinson wrote: Certain error paths won't unlock the node device object. Signed-off-by: Cole Robinson --- src/node_device/node_device_driver.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c index 14b3098..21a4c8d 100644 --- a/src/node_device/node_device_driver.c +++ b/src/node_device/node_device_driver.c @@ -720,6 +720,8 @@ nodeDeviceDestroy(virNodeDevicePtr dev) } out: +if (obj) +virNodeDeviceObjUnlock(obj); VIR_FREE(parent_name); VIR_FREE(wwnn); VIR_FREE(wwpn); ACK to this patch. I think this way to do the unlock in the error case is correct. (I don't agree with Matthias' comment. As the code stands now, either way will work, but this way protects against problems in code that is added in the future.) -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH] Allow NULL mac address in virGetInterface.
There are places where an interface will not have a mac address, and netcf returns this as a NULL pointer rather than a pointer to an empty string. Rather than checking for this all over the place in libvirt, just save it in the virInterface object as an empty string. --- src/datatypes.c |7 ++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/src/datatypes.c b/src/datatypes.c index 89ad309..ecefc59 100644 --- a/src/datatypes.c +++ b/src/datatypes.c @@ -588,10 +588,15 @@ virInterfacePtr virGetInterface(virConnectPtr conn, const char *name, const char *mac) { virInterfacePtr ret = NULL; -if ((!VIR_IS_CONNECT(conn)) || (name == NULL) || (mac == NULL)) { +if ((!VIR_IS_CONNECT(conn)) || (name == NULL)) { virLibConnError(NULL, VIR_ERR_INVALID_ARG, __FUNCTION__); return(NULL); } + +/* a NULL mac from caller is okay. Treat it as blank */ +if (mac == NULL) + mac = ""; + virMutexLock(&conn->lock); ret = (virInterfacePtr) virHashLookup(conn->interfaces, name); -- 1.6.5.15.gc274d -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH] Fix virsh.c compilation warning
A call to vshError() containing 'doexit' parameter sneaked in after I removed said parameter. Regards, Jim commit edea3dfdd861d5eee4712da43781908f0fa2a6d5 Author: Jim Fehlig Date: Mon Oct 19 13:53:40 2009 -0600 Remove extra arg in call to vshError() diff --git a/tools/virsh.c b/tools/virsh.c index 47122d5..6b93405 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -2518,7 +2518,7 @@ cmdMigrate (vshControl *ctl, const vshCmd *cmd) * a libvirt URI, or a hypervisor specific URI. */ if (migrateuri != NULL) { -vshError(ctl, FALSE, "%s", _("migrate: Unexpected migrateuri for peer2peer/direct migration")); +vshError(ctl, "%s", _("migrate: Unexpected migrateuri for peer2peer/direct migration")); goto done; } -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] create() and destroy() support for Power Hypervisor
Mark McLoughlin wrote: On Tue, 2009-10-06 at 05:12 -0300, Eduardo Otubo wrote: I've been told that libvirt possibly would make a mini-release this week to push some major fixes on Fedora 12. F12 is frozen and there has been significant changes since 0.7.1; we don't have any immediate plans to push a new release to F12 Cheers, Mark. Hello friends, Any chance to get this patch comited? I haven't seen any comments besides Marks's. In time, I am also preparing another patch to handle the virtual CPUs. Hope I can post it until the end of this week. Thanks again, -- Eduardo Otubo Software Engineer Linux Technology Center IBM Systems & Technology Group Mobile: +55 19 8135 0885 eot...@linux.vnet.ibm.com -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] Re: [virt-tools-list] libvirt 0.7.2 linker issues
Laurent Léonard wrote: > Le lundi 19 octobre 2009 à 15:21, Cole Robinson a écrit : > >> On 10/19/2009 08:54 AM, Laurent Léonard wrote: >> >>> Hi, >>> >>> I'm trying to package libvirt 0.7.2 for Debian and get some linker issues >>> : >>> >>> make[3]: Entering directory >>> `/home/user/debian/libvirt/libvirt-0.7.2/tools' CC virsh-console.o >>> CC virsh-virsh.o >>> CCLD virsh >>> ../src/.libs/libvirt.so: undefined reference to `security_getenforce' >>> ../src/.libs/libvirt.so: undefined reference to `freecon' >>> ../src/.libs/libvirt.so: undefined reference to `setexeccon' >>> ../src/.libs/libvirt.so: undefined reference to >>> `selinux_virtual_domain_context_path' >>> ../src/.libs/libvirt.so: undefined reference to `context_str' >>> ../src/.libs/libvirt.so: undefined reference to `context_range_set' >>> ../src/.libs/libvirt.so: undefined reference to `is_selinux_enabled' >>> ../src/.libs/libvirt.so: undefined reference to `setfilecon' >>> ../src/.libs/libvirt.so: undefined reference to `context_new' >>> ../src/.libs/libvirt.so: undefined reference to `getfilecon' >>> ../src/.libs/libvirt.so: undefined reference to `getpidcon' >>> ../src/.libs/libvirt.so: undefined reference to `context_free' >>> ../src/.libs/libvirt.so: undefined reference to `context_range_get' >>> ../src/.libs/libvirt.so: undefined reference to `matchpathcon' >>> ../src/.libs/libvirt.so: undefined reference to >>> `selinux_virtual_image_context_path' >>> ../src/.libs/libvirt.so: undefined reference to `security_check_context' >>> collect2: ld returned 1 exit status >>> make[3]: *** [virsh] Error 1 >>> make[3]: Leaving directory >>> `/home/user/debian/libvirt/libvirt-0.7.2/tools' make[2]: *** [all] Error >>> 2 >>> make[2]: Leaving directory >>> `/home/user/debian/libvirt/libvirt-0.7.2/tools' make[1]: *** >>> [all-recursive] Error 1 >>> make[1]: Leaving directory `/home/user/debian/libvirt/libvirt-0.7.2' >>> make: *** [all] Error 2 >>> >>> Any idea what's wrong ? >>> >>> Thank you, >>> >> Libvirt questions should go to libvirt-l...@redhat.com (cc'd now). >> > > Oops, sorry for that. > > >> You should pass --with-selinux=no to configure, since those are all >> libselinux functions. Do you have libselinux installed? If not, there's >> probably an error in configure.in selinux autodetection. >> > > libselinux (headers and binaries) are correctly installed and I have no > problem to build libvirt 0.7.1. Something wrong with the following > refactoring > (2009-09-20) ? > > * src/Makefile.am: Add -Isrc/conf to the individual build targets > which need to use XML config APIs. Remove LIBXML_CFLAGS, > LIBSSH2_CFLAGS > and SELINUX_CFLAGS from global INCLUDES and only have them in build > targets which actually need them. Create a libvirt_conf.la > convenience library for all config parsers > I'm seeing the same issue. Attached patch fixes it for me. Regards, Jim commit 1e0ec790a0f1f8b8d54c862db42050a51f62ba61 Author: Jim Fehlig Date: Mon Oct 19 11:45:19 2009 -0600 Add selinux CFLAGS and linker flags to security driver diff --git a/src/Makefile.am b/src/Makefile.am index d0ef7d1..8e27ea7 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -657,6 +657,8 @@ libvirt_driver_security_la_CFLAGS = \ libvirt_driver_security_la_LDFLAGS = if WITH_SECDRIVER_SELINUX libvirt_driver_security_la_SOURCES += $(SECURITY_DRIVER_SELINUX_SOURCES) +libvirt_driver_security_la_CFLAGS += $(SELINUX_CFLAGS) +libvirt_driver_security_la_LDFLAGS += $(SELINUX_LIBS) endif if WITH_SECDRIVER_APPARMOR libvirt_driver_security_la_SOURCES += $(SECURITY_DRIVER_APPARMOR_SOURCES) -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] Re: [virt-tools-list] libvirt 0.7.2 linker issues
Le lundi 19 octobre 2009 à 15:21, Cole Robinson a écrit : > On 10/19/2009 08:54 AM, Laurent Léonard wrote: > > Hi, > > > > I'm trying to package libvirt 0.7.2 for Debian and get some linker issues > > : > > > > make[3]: Entering directory > > `/home/user/debian/libvirt/libvirt-0.7.2/tools' CC virsh-console.o > > CC virsh-virsh.o > > CCLD virsh > > ../src/.libs/libvirt.so: undefined reference to `security_getenforce' > > ../src/.libs/libvirt.so: undefined reference to `freecon' > > ../src/.libs/libvirt.so: undefined reference to `setexeccon' > > ../src/.libs/libvirt.so: undefined reference to > > `selinux_virtual_domain_context_path' > > ../src/.libs/libvirt.so: undefined reference to `context_str' > > ../src/.libs/libvirt.so: undefined reference to `context_range_set' > > ../src/.libs/libvirt.so: undefined reference to `is_selinux_enabled' > > ../src/.libs/libvirt.so: undefined reference to `setfilecon' > > ../src/.libs/libvirt.so: undefined reference to `context_new' > > ../src/.libs/libvirt.so: undefined reference to `getfilecon' > > ../src/.libs/libvirt.so: undefined reference to `getpidcon' > > ../src/.libs/libvirt.so: undefined reference to `context_free' > > ../src/.libs/libvirt.so: undefined reference to `context_range_get' > > ../src/.libs/libvirt.so: undefined reference to `matchpathcon' > > ../src/.libs/libvirt.so: undefined reference to > > `selinux_virtual_image_context_path' > > ../src/.libs/libvirt.so: undefined reference to `security_check_context' > > collect2: ld returned 1 exit status > > make[3]: *** [virsh] Error 1 > > make[3]: Leaving directory > > `/home/user/debian/libvirt/libvirt-0.7.2/tools' make[2]: *** [all] Error > > 2 > > make[2]: Leaving directory > > `/home/user/debian/libvirt/libvirt-0.7.2/tools' make[1]: *** > > [all-recursive] Error 1 > > make[1]: Leaving directory `/home/user/debian/libvirt/libvirt-0.7.2' > > make: *** [all] Error 2 > > > > Any idea what's wrong ? > > > > Thank you, > > Libvirt questions should go to libvirt-l...@redhat.com (cc'd now). Oops, sorry for that. > > You should pass --with-selinux=no to configure, since those are all > libselinux functions. Do you have libselinux installed? If not, there's > probably an error in configure.in selinux autodetection. libselinux (headers and binaries) are correctly installed and I have no problem to build libvirt 0.7.1. Something wrong with the following refactoring (2009-09-20) ? * src/Makefile.am: Add -Isrc/conf to the individual build targets which need to use XML config APIs. Remove LIBXML_CFLAGS, LIBSSH2_CFLAGS and SELINUX_CFLAGS from global INCLUDES and only have them in build targets which actually need them. Create a libvirt_conf.la convenience library for all config parsers Thank you, -- Laurent Léonard signature.asc Description: This is a digitally signed message part. -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] Re: [PATCH] also allow use of XZ for Qemu image compression
Daniel Veillard wrote: > xz package dependancy is IMHO a small price to pay: Size: 443012 > to garantee reliability Do you know lzip (http://www.nongnu.org/lzip/lzip.html)? Lzip package size is only 55156 bytes, it is stable (xz is beta), some people consider it better designed than xz (http://lpar.ath0.com/2009/09/25/documentation-as-an-indicator-of-code-quality/) and may very well be the LZMA file format that succeeds. Best regards, Antonio. -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 2/4] Add a type for SPICE protocol
On Mon, Oct 19, 2009 at 06:10:08PM +0200, Dan Kenigsberg wrote: > On Mon, Oct 19, 2009 at 04:52:10PM +0100, Daniel P. Berrange wrote: > > On Mon, Oct 19, 2009 at 05:47:47PM +0200, Dan Kenigsberg wrote: > > > Thanks for the patches (and sorry for the late response). > > > > > > The patches are fine, though I am still missing a means to control which > > > of spice channels are to be encrypted. Also missing is a way to set > > > key/cert files and cipher suite per domain. (I aksed spice folks to > > > avoid this problem by using reasonable defaults). More of a problem is > > > the need to set/reset spice "ticket" (one time password), or at least > > > disable it completely on the command line (with ,disable-ticketing). > > > > For VNC, we leave key/cert file configuration to be done per-host > > in /etc/libvirt/qemu.conf. I was anticipating the same for SPICE, > > with a spice_tls_x509_cert_dir parameter, to match the existing > > vnc_tls_x509_cert_dir parameter. We could easily add cipher suite > > parameters to the config too if there's a compelling need to use a > > non-default setting. > > > > IIRC, there's an open RFE for the 'ticket' stuff already. > > you are correct. > > > > > > On Tue, Sep 29, 2009 at 04:43:51PM +0100, Daniel P. Berrange wrote: > > > > This supports the -qxl argument in RHEL-5's fork of KVM > > > > which has SPICE support. QXL is a graphics card, but > > > > inexplicably doesn't use the standard -vga syntax for > > > > generic configuration. Also -qxl is rather useless unless > > > > you also supply -spice (coming in next patch) > > > > > > > + > > > > +if (virAsprintf(&optstr, "%u,ram=%u", > > > > +def->videos[0]->heads, > > > > +(def->videos[0]->vram /1024)) < 0) > > > > +goto no_memory; > > > > > > this hides spice's own default, and sends ",ram=0" if xml lacks vram > > > attribute. I think it would be better to drop ",ram" completely if > > > vram==0. > > > > hmm, I missed something somewhere then, because our XML parser should > > always set a default vram value if it is omitted, so you should never > > get a ram=0 flag. > > What I am saying is that hiding spice's default with adding > > diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c > index 27fcdf1..67b9e2a 100644 > --- a/src/conf/domain_conf.c > +++ b/src/conf/domain_conf.c > @@ -1798,6 +1798,9 @@ virDomainVideoDefaultRAM(virDomainDefPtr def, > /* Original Xen PVFB hardcoded to 4 MB */ > return 4 * 1024; > > +case VIR_DOMAIN_VIDEO_TYPE_QXL: > +return 64 * 1024; > + > default: > return 0; > } > > seems suboptimal to me. There is no good solution here - we wanted to be able to expose to apps what amount of video RAM is being used, since this RAM is counted ontop of normal guest RAM & thus important to know about when figuring out if you are overcommitting a host or not. Ultimately QEMU needs to be able to tell us what its defaults are so we can avoid this problem. 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 2/4] Add a type for SPICE protocol
On Mon, Oct 19, 2009 at 04:52:10PM +0100, Daniel P. Berrange wrote: > On Mon, Oct 19, 2009 at 05:47:47PM +0200, Dan Kenigsberg wrote: > > Thanks for the patches (and sorry for the late response). > > > > The patches are fine, though I am still missing a means to control which > > of spice channels are to be encrypted. Also missing is a way to set > > key/cert files and cipher suite per domain. (I aksed spice folks to > > avoid this problem by using reasonable defaults). More of a problem is > > the need to set/reset spice "ticket" (one time password), or at least > > disable it completely on the command line (with ,disable-ticketing). > > For VNC, we leave key/cert file configuration to be done per-host > in /etc/libvirt/qemu.conf. I was anticipating the same for SPICE, > with a spice_tls_x509_cert_dir parameter, to match the existing > vnc_tls_x509_cert_dir parameter. We could easily add cipher suite > parameters to the config too if there's a compelling need to use a > non-default setting. > > IIRC, there's an open RFE for the 'ticket' stuff already. you are correct. > > > On Tue, Sep 29, 2009 at 04:43:51PM +0100, Daniel P. Berrange wrote: > > > This supports the -qxl argument in RHEL-5's fork of KVM > > > which has SPICE support. QXL is a graphics card, but > > > inexplicably doesn't use the standard -vga syntax for > > > generic configuration. Also -qxl is rather useless unless > > > you also supply -spice (coming in next patch) > > > > > + > > > +if (virAsprintf(&optstr, "%u,ram=%u", > > > +def->videos[0]->heads, > > > +(def->videos[0]->vram /1024)) < 0) > > > +goto no_memory; > > > > this hides spice's own default, and sends ",ram=0" if xml lacks vram > > attribute. I think it would be better to drop ",ram" completely if > > vram==0. > > hmm, I missed something somewhere then, because our XML parser should > always set a default vram value if it is omitted, so you should never > get a ram=0 flag. What I am saying is that hiding spice's default with adding diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 27fcdf1..67b9e2a 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -1798,6 +1798,9 @@ virDomainVideoDefaultRAM(virDomainDefPtr def, /* Original Xen PVFB hardcoded to 4 MB */ return 4 * 1024; +case VIR_DOMAIN_VIDEO_TYPE_QXL: +return 64 * 1024; + default: return 0; } seems suboptimal to me. -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 2/4] Add a type for SPICE protocol
On Mon, Oct 19, 2009 at 05:47:47PM +0200, Dan Kenigsberg wrote: > Thanks for the patches (and sorry for the late response). > > The patches are fine, though I am still missing a means to control which > of spice channels are to be encrypted. Also missing is a way to set > key/cert files and cipher suite per domain. (I aksed spice folks to > avoid this problem by using reasonable defaults). More of a problem is > the need to set/reset spice "ticket" (one time password), or at least > disable it completely on the command line (with ,disable-ticketing). For VNC, we leave key/cert file configuration to be done per-host in /etc/libvirt/qemu.conf. I was anticipating the same for SPICE, with a spice_tls_x509_cert_dir parameter, to match the existing vnc_tls_x509_cert_dir parameter. We could easily add cipher suite parameters to the config too if there's a compelling need to use a non-default setting. IIRC, there's an open RFE for the 'ticket' stuff already. > On Tue, Sep 29, 2009 at 04:43:51PM +0100, Daniel P. Berrange wrote: > > This supports the -qxl argument in RHEL-5's fork of KVM > > which has SPICE support. QXL is a graphics card, but > > inexplicably doesn't use the standard -vga syntax for > > generic configuration. Also -qxl is rather useless unless > > you also supply -spice (coming in next patch) > > > + > > +if (virAsprintf(&optstr, "%u,ram=%u", > > +def->videos[0]->heads, > > +(def->videos[0]->vram /1024)) < 0) > > +goto no_memory; > > this hides spice's own default, and sends ",ram=0" if xml lacks vram > attribute. I think it would be better to drop ",ram" completely if > vram==0. hmm, I missed something somewhere then, because our XML parser should always set a default vram value if it is omitted, so you should never get a ram=0 flag. 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 2/4] Add a type for SPICE protocol
Thanks for the patches (and sorry for the late response). The patches are fine, though I am still missing a means to control which of spice channels are to be encrypted. Also missing is a way to set key/cert files and cipher suite per domain. (I aksed spice folks to avoid this problem by using reasonable defaults). More of a problem is the need to set/reset spice "ticket" (one time password), or at least disable it completely on the command line (with ,disable-ticketing). On Tue, Sep 29, 2009 at 04:43:51PM +0100, Daniel P. Berrange wrote: > This supports the -qxl argument in RHEL-5's fork of KVM > which has SPICE support. QXL is a graphics card, but > inexplicably doesn't use the standard -vga syntax for > generic configuration. Also -qxl is rather useless unless > you also supply -spice (coming in next patch) > + > +if (virAsprintf(&optstr, "%u,ram=%u", > +def->videos[0]->heads, > +(def->videos[0]->vram /1024)) < 0) > +goto no_memory; this hides spice's own default, and sends ",ram=0" if xml lacks vram attribute. I think it would be better to drop ",ram" completely if vram==0. Regards, Dan. -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 3/3] test: Support virNodeDeviceCreate and virNodeDeviceDestroy
On 10/17/2009 09:10 AM, Matthias Bolte wrote: > 2009/10/16 Cole Robinson : >> >> Signed-off-by: Cole Robinson >> --- >> Â src/test/test_driver.c | Â 129 >> +++- >> Â 1 files changed, 127 insertions(+), 2 deletions(-) >> >> diff --git a/src/test/test_driver.c b/src/test/test_driver.c >> index 0541a73..888bc9c 100644 >> --- a/src/test/test_driver.c >> +++ b/src/test/test_driver.c >> @@ -4376,6 +4376,131 @@ cleanup: >> Â Â return ret; >> Â } >> >> +static virNodeDevicePtr >> +testNodeDeviceCreateXML(virConnectPtr conn, >> + Â Â Â Â Â Â Â Â Â Â Â Â const char *xmlDesc, >> + Â Â Â Â Â Â Â Â Â Â Â Â unsigned int flags ATTRIBUTE_UNUSED) >> +{ >> + Â Â testConnPtr driver = conn->privateData; >> + Â Â virNodeDeviceDefPtr def = NULL; >> + Â Â virNodeDeviceObjPtr obj = NULL; >> + Â Â char *wwnn = NULL, *wwpn = NULL; >> + Â Â int parent_host = -1; >> + Â Â virNodeDevicePtr dev = NULL; >> + Â Â virNodeDevCapsDefPtr caps; >> + >> + Â Â testDriverLock(driver); >> + >> + Â Â def = virNodeDeviceDefParseString(conn, xmlDesc, CREATE_DEVICE); >> + Â Â if (def == NULL) { >> + Â Â Â Â goto cleanup; >> + Â Â } >> + >> + Â Â /* We run these next two simply for validation */ >> + Â Â if (virNodeDeviceGetWWNs(conn, def, &wwnn, &wwpn) == -1) { >> + Â Â Â Â goto cleanup; >> + Â Â } >> + >> + Â Â if (virNodeDeviceGetParentHost(conn, >> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â &driver->devs, >> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â def->name, >> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â def->parent, >> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â &parent_host) == -1) { >> + Â Â Â Â goto cleanup; >> + Â Â } >> + >> + Â Â /* 'name' is supposed to be filled in by the node device backend, >> which >> + Â Â * we don't have. Use WWPN instead. */ >> + Â Â VIR_FREE(def->name); >> + Â Â if (!(def->name = strdup(wwpn))) { >> + Â Â Â Â virReportOOMError(dev->conn); > > dev is NULL here, call virReportOOMError(conn) instead. Whoops, yeah that's bad. Good catch! Thanks, Cole > >> + Â Â Â Â goto cleanup; >> + Â Â } >> + >> + Â Â /* Fill in a random 'host' value, since this would also come from >> + Â Â * the backend */ >> + Â Â caps = def->caps; >> + Â Â while (caps) { >> + Â Â Â Â if (caps->type != VIR_NODE_DEV_CAP_SCSI_HOST) >> + Â Â Â Â Â Â continue; >> + >> + Â Â Â Â caps->data.scsi_host.host = virRandom(1024); >> + Â Â Â Â caps = caps->next; >> + Â Â } >> + >> + >> + Â Â if (!(obj = virNodeDeviceAssignDef(conn, &driver->devs, def))) { >> + Â Â Â Â goto cleanup; >> + Â Â } >> + Â Â virNodeDeviceObjUnlock(obj); >> + >> + Â Â dev = virGetNodeDevice(conn, def->name); >> + Â Â def = NULL; >> +cleanup: >> + Â Â testDriverUnlock(driver); >> + Â Â if (def) >> + Â Â Â Â virNodeDeviceDefFree(def); >> + Â Â VIR_FREE(wwnn); >> + Â Â VIR_FREE(wwpn); >> + Â Â return dev; >> +} >> + > > ACK > > Matthias -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] tests: Centralize VIR_TEST_DEBUG lookup, and document it
On 10/17/2009 08:03 AM, Matthias Bolte wrote: > 2009/10/16 Cole Robinson : >> Provide a simple interface for other tests to lookup the testDebug variable. >> Also remove a redundant error message in interface tests. >> >> If anyone feels inclined to change this env variable to match the existing >> LIBVIRT_* format, it should now be easier to do so. >> >> Signed-off-by: Cole Robinson >> --- >>  HACKING            |  10 ++ >>  tests/interfacexml2xmltest.c |   2 -- >>  tests/statstest.c       |   4 ++-- >>  tests/testutils.c       |  38 >> ++ >>  tests/testutils.h       |   4 ++-- >>  tests/testutilsqemu.c     |   2 +- >>  6 files changed, 41 insertions(+), 19 deletions(-) >> >> diff --git a/HACKING b/HACKING >> index bcff8c6..fba7778 100644 >> --- a/HACKING >> +++ b/HACKING >> @@ -37,6 +37,16 @@ and run the tests: >> >>  The latter test checks for memory leaks. >> >> +If you encounter any failing tests, the VIR_TEST_DEBUG environment variable >> +may help: >> + >> +  VIR_TEST_DEBUG=1 make check   (or) >> +  VIR_TEST_DEBUG=2 make check > > Maybe explain what VIR_TEST_DEBUG actually does and what's the > difference between 1 and 2. > Yes, this wording can be improved, I will fix it and repost. >> + >> +Also, individual tests can be run from inside the 'tests/' directory, like: >> + >> +  ./qemuxml2xmltest >> + >>  (6) Update tests and/or documentation, particularly if you are adding >>  a new feature or changing the output of a program. > >> --- a/tests/testutils.c >> +++ b/tests/testutils.c >> @@ -45,7 +45,7 @@ >>   int) ((T)->tv_sec - (U)->tv_sec)) * 100.0 +     \ >>    ((int) ((T)->tv_usec - (U)->tv_usec))) / 1000.0) >> >> -unsigned int testDebug = 0; >> +unsigned int testDebug = -1; > > testDebug isn't referenced via extern anymore, declare it static like > testOOM and testCounter. > Will do. >>  static unsigned int testOOM = 0; >>  static unsigned int testCounter = 0; > > ACK. > Thanks for the review! - Cole -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 2/3] node device: Break out get_wwns and get_parent_node helpers
On 10/17/2009 08:58 AM, Matthias Bolte wrote: >> >> diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c >> index f09f814..77f7be3 100644 >> --- a/src/conf/node_device_conf.c >> +++ b/src/conf/node_device_conf.c >> @@ -1215,6 +1215,95 @@ virNodeDeviceDefParseFile(virConnectPtr conn, >> Â Â return virNodeDeviceDefParse(conn, NULL, filename, create); >> Â } >> >> +/* >> + * Return fc_host dev's WWNN and WWPN >> + */ >> +int >> +virNodeDeviceGetWWNs(virConnectPtr conn, >> + Â Â Â Â Â Â Â Â Â Â virNodeDeviceDefPtr def, >> + Â Â Â Â Â Â Â Â Â Â char **wwnn, >> + Â Â Â Â Â Â Â Â Â Â char **wwpn) >> +{ >> + Â Â virNodeDevCapsDefPtr cap = NULL; >> + Â Â int ret = 0; >> + >> + Â Â cap = def->caps; >> + Â Â while (cap != NULL) { >> + Â Â Â Â if (cap->type == VIR_NODE_DEV_CAP_SCSI_HOST && >> + Â Â Â Â Â Â cap->data.scsi_host.flags & >> VIR_NODE_DEV_CAP_FLAG_HBA_FC_HOST) { >> + Â Â Â Â Â Â *wwnn = strdup(cap->data.scsi_host.wwnn); >> + Â Â Â Â Â Â *wwpn = strdup(cap->data.scsi_host.wwpn); >> + Â Â Â Â Â Â break; >> + Â Â Â Â } >> + >> + Â Â Â Â cap = cap->next; >> + Â Â } >> + >> + Â Â if (cap == NULL) { >> + Â Â Â Â virNodeDeviceReportError(conn, VIR_ERR_NO_SUPPORT, >> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â "%s", _("Device is not a >> fibre channel HBA")); >> + Â Â Â Â ret = -1; >> + Â Â } >> + >> + Â Â if (*wwnn == NULL || *wwpn == NULL) { > > I know you have just moved this function to another file, but here > seems to be a logical error that may result in a false-positive OOM > error. > > If the while loop is left without finding the wanted device (cap == > NULL), then *wwnn and *wwpn have not been set inside this function and > point to their initial value (probably NULL). Because they have not > been set inside this function (in the cap == NULL case), they should > not be tested for NULL to detect an OOM condition. > > To fix this > > if (*wwnn == NULL || *wwpn == NULL) { > > could be changed to > > else if (*wwnn == NULL || *wwpn == NULL) { > > so the OOM check is only done if the wanted device has been found (cap != > NULL). > >> + Â Â Â Â /* Free the other one, if allocated... */ >> + Â Â Â Â VIR_FREE(wwnn); >> + Â Â Â Â VIR_FREE(wwpn); >> + Â Â Â Â ret = -1; >> + Â Â Â Â virReportOOMError(conn); >> + Â Â } >> + >> + Â Â return ret; >> +} >> + > > The OOM detection should be fixed by an additional patch, so ACK to this one. > Good catch. I agree a follow up patch is the way to go. Thanks, Cole -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] libvirt: use existing network bridge
On 10/19/2009 03:18 AM, Daniel Berteaud wrote: > Le lundi 19 octobre 2009 à 09:14 +0200, Chris Lalancette a écrit : >> Sascha Frey wrote: >>> Hi, >>> >>> I met a problem setting up virt-manager and libvirt: >>> >>> I want to use an existing customized network bridge with libvirt >>> (I need special iptables rules and a custom DHCP setup). >>> >>> So I created a network definition file like this: >>> >>> NAT >>> >>> >>> >>> Unfortunately, I'm unable to activate this network, because libvirt >>> tries to create the bridge `br-nat' and fails, because it already >>> exists: >>> >>> # virsh net-start NAT >>> error: Failed to start network NAT >>> error: cannot create bridge 'br-nat': File exists >>> >>> >>> I just want libvirt to attach the guest's tap devices to this existing >>> bridge. I don't want libvirt to manage the network. >>> >>> Is there any chance to realize this set-up? >>> It should work with virt-manager using the graphical wizard. >> >> Yes, just don't define a new network. To use existing bridges, you just >> need to >> edit your guest XML files to use something like: >> >> >> >> >> >> >> Note that configured bridges should also show up in virt-manager, I believe. > > Existing bridge shows up in virt-manager when run on the local machine. > If you use a remote connection (at least qemu+ssh), you don't see it, > you need to manually edit the guest XML. > > (btw, is this a known "problem" or a bug ?) > For a while, libvirt didn't support a way to enumerate bridge devices on a remote machine. That support now exists, but virt-manager needs to be updated to use it (nontrivial). Known issue. - Cole -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] LXC implement missing macaddr assignment feature
Hi, Currently MAC address configuration of container veth is just ignored. This patch implements the missing feature. * src/lxc/veth.c, src/lxc/veth.h: add setMacAddr * src/lxc/lxc_driver.c: set macaddr of container veth if specified ozaki-r >From 38f09526bdd125c717beb13769aa2904e751 Mon Sep 17 00:00:00 2001 From: Ryota Ozaki Date: Mon, 19 Oct 2009 22:13:18 +0900 Subject: [PATCH] LXC implement missing macaddr assignment feature Currently MAC address configuration of container veth is just ignored. This patch implements the missing feature. * src/lxc/veth.c, src/lxc/veth.h: add setMacAddr * src/lxc/lxc_driver.c: set macaddr of container veth if specified --- src/lxc/lxc_driver.c | 11 +++ src/lxc/veth.c | 31 +++ src/lxc/veth.h |1 + 3 files changed, 43 insertions(+), 0 deletions(-) diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index 783dfcc..ef97364 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -786,6 +786,17 @@ static int lxcSetupInterfaces(virConnectPtr conn, goto error_exit; } +if (def->nets[i]->mac) { +char macaddr[VIR_MAC_STRING_BUFLEN]; +virFormatMacAddr(def->nets[i]->mac, macaddr); +if (0 != (rc = setMacAddr(containerVeth, macaddr))) { +virReportSystemError(conn, rc, + _("failed to set %s to %s"), + macaddr, containerVeth); +goto error_exit; +} +} + if (0 != (rc = brAddInterface(brctl, bridge, parentVeth))) { virReportSystemError(conn, rc, _("failed to add %s device to %s"), diff --git a/src/lxc/veth.c b/src/lxc/veth.c index 71d7de6..b15df8d 100644 --- a/src/lxc/veth.c +++ b/src/lxc/veth.c @@ -216,3 +216,34 @@ error_out: VIR_FREE(pid); return rc; } + +/** + * setMacAddr + * @iface: name of device + * @macaddr: MAC address to be assigned + * + * Changes the MAC address of the given device with the + * given address using this command: + * ip link set @iface address @macaddr + * + * Returns 0 on success or -1 in case of error + */ +int setMacAddr(const char* iface, const char* macaddr) +{ +int rc = -1; +const char *argv[] = { +"ip", "link", "set", iface, "address", macaddr, NULL +}; +int cmdResult; + +if (NULL == iface) { +goto error_out; +} + +rc = virRun(NULL, argv, &cmdResult); +if (0 == rc) +rc = cmdResult; + +error_out: +return rc; +} diff --git a/src/lxc/veth.h b/src/lxc/veth.h index 429eb3d..8f2f514 100644 --- a/src/lxc/veth.h +++ b/src/lxc/veth.h @@ -20,5 +20,6 @@ int vethCreate(char* veth1, int veth1MaxLen, char* veth2, int vethDelete(const char* veth); int vethInterfaceUpOrDown(const char* veth, int upOrDown); int moveInterfaceToNetNs(const char *iface, int pidInNs); +int setMacAddr(const char* iface, const char* macaddr); #endif /* VETH_H */ -- 1.6.2.5 0001-LXC-implement-missing-macaddr-assignment-feature.patch Description: Binary data -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] Re: [virt-tools-list] libvirt 0.7.2 linker issues
On 10/19/2009 08:54 AM, Laurent Léonard wrote: > Hi, > > I'm trying to package libvirt 0.7.2 for Debian and get some linker issues : > > make[3]: Entering directory `/home/user/debian/libvirt/libvirt-0.7.2/tools' > > > CC virsh-console.o > > > CC virsh-virsh.o > > > CCLD virsh > > > ../src/.libs/libvirt.so: undefined reference to `security_getenforce' > > > ../src/.libs/libvirt.so: undefined reference to `freecon' > > > ../src/.libs/libvirt.so: undefined reference to `setexeccon' > > > ../src/.libs/libvirt.so: undefined reference to > `selinux_virtual_domain_context_path' > > ../src/.libs/libvirt.so: undefined reference to `context_str' > ../src/.libs/libvirt.so: undefined reference to `context_range_set' > ../src/.libs/libvirt.so: undefined reference to `is_selinux_enabled' > ../src/.libs/libvirt.so: undefined reference to `setfilecon' > ../src/.libs/libvirt.so: undefined reference to `context_new' > ../src/.libs/libvirt.so: undefined reference to `getfilecon' > ../src/.libs/libvirt.so: undefined reference to `getpidcon' > ../src/.libs/libvirt.so: undefined reference to `context_free' > ../src/.libs/libvirt.so: undefined reference to `context_range_get' > ../src/.libs/libvirt.so: undefined reference to `matchpathcon' > ../src/.libs/libvirt.so: undefined reference to > `selinux_virtual_image_context_path' > ../src/.libs/libvirt.so: undefined reference to `security_check_context' > collect2: ld returned 1 exit status > make[3]: *** [virsh] Error 1 > make[3]: Leaving directory `/home/user/debian/libvirt/libvirt-0.7.2/tools' > make[2]: *** [all] Error 2 > make[2]: Leaving directory `/home/user/debian/libvirt/libvirt-0.7.2/tools' > make[1]: *** [all-recursive] Error 1 > make[1]: Leaving directory `/home/user/debian/libvirt/libvirt-0.7.2' > make: *** [all] Error 2 > > Any idea what's wrong ? > > Thank you, Libvirt questions should go to libvirt-l...@redhat.com (cc'd now). You should pass --with-selinux=no to configure, since those are all libselinux functions. Do you have libselinux installed? If not, there's probably an error in configure.in selinux autodetection. - Cole -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] fix virDomainMigrateToURI doc
On Mon, Oct 19, 2009 at 11:56:01AM +0200, Dan Kenigsberg wrote: > --- > src/libvirt.c |2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/src/libvirt.c b/src/libvirt.c > index 92a1eaa..d2a0d7a 100644 > --- a/src/libvirt.c > +++ b/src/libvirt.c > @@ -3279,7 +3279,7 @@ error: > * @bandwidth: (optional) specify migration bandwidth limit in Mbps > * > * Migrate the domain object from its current host to the destination > - * host given by dconn (a connection to the destination host). > + * host given by duri. > * > * Flags may be one of more of the following: > * VIR_MIGRATE_LIVE Do not pause the VM during migration Yup, I also removed 2 other sentences in that description also referencing dconn non-existent parameter. thanks ! Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ dan...@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/ -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] Better error reporting for failed migration.
Daniel P. Berrange wrote: >> +if (STREQ(hostname, "localhost")) { >> +VIR_FREE(hostname); >> +qemudReportError(dconn, NULL, NULL, VIR_ERR_INVALID_ARG, "%s", >> + _("Could not resolve destination hostname; " >> + "either fix destination to resolve hostname, >> " >> + "or use the optional URI migration >> parameter")); >> +goto cleanup; >> +} >> + > > I think I'd be inclined to actually resolve the hostname, and then > check it agaist 127.0.0.1 and ::1. You can get quite a few variations > which ultimtely might point to localhost. I did some testing here. Basically I wrote a small program that just calls getaddrinfo() like virHostname() does, iterates over all of the addresses returned, and prints various information. On my F-11 box, due to a possibly glibc bug, it only returns IPv4 addresses, and the fields look like: flags 0x82, family 2, socktype 1, protocol 6, addrlen 16, addr 0x1521b80, canonname intel2.xmen.org flags 0x82, family 2, socktype 2, protocol 17, addrlen 16, addr 0x1521bd0, canonname (null) flags 0x82, family 2, socktype 3, protocol 0, addrlen 16, addr 0x1521c20, canonname (null) On my F-12 box, which is the one that originally showed the problems, it shows both IPv6 and IPv4 addresses, and the output looks like: flags 0x82, family 10, socktype 1, protocol 6, addrlen 28, addr 0x19ad220, canonname localhost flags 0x82, family 10, socktype 2, protocol 17, addrlen 28, addr 0x19ad280, canonname (null) flags 0x82, family 10, socktype 3, protocol 0, addrlen 28, addr 0x19ad2e0, canonname (null) flags 0x82, family 2, socktype 1, protocol 6, addrlen 16, addr 0x19ad110, canonname (null) flags 0x82, family 2, socktype 2, protocol 17, addrlen 16, addr 0x19ad180, canonname (null) flags 0x82, family 2, socktype 3, protocol 0, addrlen 16, addr 0x19ad1d0, canonname (null) So it seems like the canonname resolves to "localhost" in both the IPv4 (family 2) and IPv6 (family 10) cases. I guess we could pass the result of virGetHostname() back into getaddrinfo() and look at the results, but I don't know that it would be significantly different from what we already get. Do you still think it is worthwhile? -- Chris Lalancette -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] tests: Initialize virRandom in for test suite.
On Fri, Oct 16, 2009 at 11:59:20AM -0400, Cole Robinson wrote: > Otherwise any virRandom calls will result in a segfault. > > Signed-off-by: Cole Robinson > --- > tests/testutils.c |3 ++- > 1 files changed, 2 insertions(+), 1 deletions(-) > > diff --git a/tests/testutils.c b/tests/testutils.c > index 536441a..e6f5e61 100644 > --- a/tests/testutils.c > +++ b/tests/testutils.c > @@ -340,7 +340,8 @@ int virtTestMain(int argc, > #endif > > if (virThreadInitialize() < 0 || > -virErrorInitialize() < 0) > +virErrorInitialize() < 0 || > +virRandomInitialize(time(NULL) ^ getpid())) > return 1; > > if ((debugStr = getenv("VIR_TEST_DEBUG")) != NULL) { Sounds fine to me, ACK, Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ dan...@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/ -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] LXC fix virCgroupGetValueStr on handling a string terminated with '\n'
On Sat, Oct 17, 2009 at 09:30:12AM +0900, Ryota Ozaki wrote: > Ooop! The patch lost the last modification...so please use the new one, sorry. > > On Fri, Oct 16, 2009 at 9:45 PM, Daniel P. Berrange > wrote: > > On Fri, Oct 16, 2009 at 05:05:27PM +0900, Ryota Ozaki wrote: > > >> BTW, by the defect I first got the following error and it made me confused. > >> > >> # virsh -c lxc:/// dominfo 4930 > >> Id: 4930 > >> Name: lxc > >> UUID: 084369a0-956a-3010-fc37-ddeb4d627e69 > >> OS Type: exe > >> Autostart: disable > >> error: this function is not supported by the hypervisor: > >> virNodeGetSecurityModel > >> > >> The really error happens in lxcDomainGetInfo, so I guess something is wrong > >> with internal error propagation. Anyone know this unexpected behavior? > > > > This looks rather odd - I can't think of anything which could cause this > > to happen - virsh is supposed to be filtering out that error message > > OK, I've looked into a bit deep and found the following sequence happens. > > In cmdDominfo (virsh.c), if virDomainGetInfo fails, 'ret' is set with FALSE. > Even so, further virNodeGetSecurityModel is called too. And if it also fails > then VIR_ERR_NO_SUPPORT is set. Normally, VIR_ERR_NO_SUPPORT does not lead > cmdDominfo failed, however, 'ret' is previously set with FALSE, then virsh > fails. Okidoc, I applied the last patch. Thanks ! I wonder if we also need to fix the logic in virsh.c:cmdDominfo() , maybe by making: if (last_error->code != VIR_ERR_NO_SUPPORT) { into if ((last_error->code != VIR_ERR_NO_SUPPORT) && (ret != FALSE)) { or by resetting last_error as well as setting ret to false when virDomainGetInfo() fails. Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ dan...@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/ -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: FW: [libvirt] error: unable to connect to'/usr/local/var/run/libvirt/libvirt-sock': Connection refused
On Mon, Oct 19, 2009 at 7:52 PM, Liu, Zhentao wrote: > Hi, ozaki > > Another erro of mine is that: > > -- > r...@forest:/var/run/libvirt# /etc/init.d/libvirt-bin start > * Starting libvirt management daemon > libvirtd > /usr/sbin/libvirtd: /usr/local/lib/libvirt.so.0: version > `LIBVIRT_PRIVATE_0.6.1' not found (required by /usr/sbin/libvirtd) > --- > > I think maybe I have mixed installed version 0.6.1 and 0.7.0. But I have no > idea how can I fix it? Hmm, complicated ;-) but the above error should be avoided by replacing /usr/sbin/libvirtd with /usr/local/sbin/libvirtd in /etc/init.d/libvirt-bin. ozaki-r > > Regards > > Zhentao -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] error: unable to connect to '/usr/local/var/run/libvirt/libvirt-sock': Connection refused
On Mon, Oct 19, 2009 at 7:31 PM, Liu, Zhentao wrote: > Hi, ozaki > > Thank you for your reply. As you said, libvirtd is not running. I have > tested, there was error: > > --- > > r...@forest:/var/run/libvirt# libvirtd start The argument is wrong. see libvirtd --help > libvir: Network Config error : cannot create bridge 'virbr0': File exists The virbr0 is probably create by old libvirtd on its startup. The most easy way to avoid the problem is just removing it (brctl delbr virbr0), although it may remain some runtime files of libvirtd somewhere under /var/. > 12:34:30.525: warning : qemudStartup:521 : Unable to create cgroup for > driver: No such device or address > 12:34:30.598: warning : lxcStartup:1460 : Unable to create cgroup for > driver: No such device or address You can ignore them unless you certainly want to use cgroup. ozaki-r > -- > > How can I fix it? > > Regards > > Zhentao -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
FW: [libvirt] error: unable to connect to'/usr/local/var/run/libvirt/libvirt-sock': Connection refused
Hi, ozaki Another erro of mine is that: -- r...@forest:/var/run/libvirt# /etc/init.d/libvirt-bin start * Starting libvirt management daemon libvirtd /usr/sbin/libvirtd: /usr/local/lib/libvirt.so.0: version `LIBVIRT_PRIVATE_0.6.1' not found (required by /usr/sbin/libvirtd) --- I think maybe I have mixed installed version 0.6.1 and 0.7.0. But I have no idea how can I fix it? Regards Zhentao -Original Message- From: libvir-list-boun...@redhat.com on behalf of Liu, Zhentao Sent: Mon 10/19/2009 12:31 PM To: Ryota Ozaki Cc: libvir-list@redhat.com Subject: RE: [libvirt] error: unable to connect to'/usr/local/var/run/libvirt/libvirt-sock': Connection refused https://mailsrv.fokus.fraunhofer.de/exchange/zli/Inbox/?Cmd=contents&Page=1 Hi, ozaki Thank you for your reply. As you said, libvirtd is not running. I have tested, there was error: --- r...@forest:/var/run/libvirt# libvirtd start libvir: Network Config error : cannot create bridge 'virbr0': File exists 12:34:30.525: warning : qemudStartup:521 : Unable to create cgroup for driver: No such device or address 12:34:30.598: warning : lxcStartup:1460 : Unable to create cgroup for driver: No such device or address -- How can I fix it? Regards Zhentao -Original Message- From: Ryota Ozaki [mailto:ozaki.ry...@gmail.com] Sent: Mon 10/19/2009 12:20 PM To: Liu, Zhentao Cc: libvir-list@redhat.com; Ryota OZAKI Subject: Re: [libvirt] error: unable to connect to '/usr/local/var/run/libvirt/libvirt-sock': Connection refused Hi Liu, On Mon, Oct 19, 2009 at 6:58 PM, Liu, Zhentao wrote: > Hello, > > I updated libvirt-bin to version 0.7.0. I still got a error: > > --- > > r...@forest:/tmp/libvirt-0.7.0# virsh -c qemu:///system list > error: unable to connect to '/usr/local/var/run/libvirt/libvirt-sock': > Connection refused > error: failed to connect to the hypervisor > --- > > Any helps? I guess libvirtd is not running, or running but waiting on '/var/run/libvirt/libvirt-sock' where your virsh is try to look up '/usr/local/var/run/libvirt/libvirt-sock'. In the second case, you can confirm my guess by doing 'lsof |grep libvirt-sock'. ozaki-r > > Regards > > Zhentao > > -- > Libvir-list mailing list > Libvir-list@redhat.com > https://www.redhat.com/mailman/listinfo/libvir-list > > -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
RE: [libvirt] error: unable to connect to '/usr/local/var/run/libvirt/libvirt-sock': Connection refused
Hi, ozaki Thank you for your reply. As you said, libvirtd is not running. I have tested, there was error: --- r...@forest:/var/run/libvirt# libvirtd start libvir: Network Config error : cannot create bridge 'virbr0': File exists 12:34:30.525: warning : qemudStartup:521 : Unable to create cgroup for driver: No such device or address 12:34:30.598: warning : lxcStartup:1460 : Unable to create cgroup for driver: No such device or address -- How can I fix it? Regards Zhentao -Original Message- From: Ryota Ozaki [mailto:ozaki.ry...@gmail.com] Sent: Mon 10/19/2009 12:20 PM To: Liu, Zhentao Cc: libvir-list@redhat.com; Ryota OZAKI Subject: Re: [libvirt] error: unable to connect to '/usr/local/var/run/libvirt/libvirt-sock': Connection refused Hi Liu, On Mon, Oct 19, 2009 at 6:58 PM, Liu, Zhentao wrote: > Hello, > > I updated libvirt-bin to version 0.7.0. I still got a error: > > --- > > r...@forest:/tmp/libvirt-0.7.0# virsh -c qemu:///system list > error: unable to connect to '/usr/local/var/run/libvirt/libvirt-sock': > Connection refused > error: failed to connect to the hypervisor > --- > > Any helps? I guess libvirtd is not running, or running but waiting on '/var/run/libvirt/libvirt-sock' where your virsh is try to look up '/usr/local/var/run/libvirt/libvirt-sock'. In the second case, you can confirm my guess by doing 'lsof |grep libvirt-sock'. ozaki-r > > Regards > > Zhentao > > -- > Libvir-list mailing list > Libvir-list@redhat.com > https://www.redhat.com/mailman/listinfo/libvir-list > > -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] error: unable to connect to '/usr/local/var/run/libvirt/libvirt-sock': Connection refused
Hi Liu, On Mon, Oct 19, 2009 at 6:58 PM, Liu, Zhentao wrote: > Hello, > > I updated libvirt-bin to version 0.7.0. I still got a error: > > --- > > r...@forest:/tmp/libvirt-0.7.0# virsh -c qemu:///system list > error: unable to connect to '/usr/local/var/run/libvirt/libvirt-sock': > Connection refused > error: failed to connect to the hypervisor > --- > > Any helps? I guess libvirtd is not running, or running but waiting on '/var/run/libvirt/libvirt-sock' where your virsh is try to look up '/usr/local/var/run/libvirt/libvirt-sock'. In the second case, you can confirm my guess by doing 'lsof |grep libvirt-sock'. ozaki-r > > Regards > > Zhentao > > -- > Libvir-list mailing list > Libvir-list@redhat.com > https://www.redhat.com/mailman/listinfo/libvir-list > > -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] error: unable to connect to '/usr/local/var/run/libvirt/libvirt-sock': Connection refused
Hello, I updated libvirt-bin to version 0.7.0. I still got a error: --- r...@forest:/tmp/libvirt-0.7.0# virsh -c qemu:///system list error: unable to connect to '/usr/local/var/run/libvirt/libvirt-sock': Connection refused error: failed to connect to the hypervisor --- Any helps? Regards Zhentao -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH] fix virDomainMigrateToURI doc
--- src/libvirt.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/libvirt.c b/src/libvirt.c index 92a1eaa..d2a0d7a 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -3279,7 +3279,7 @@ error: * @bandwidth: (optional) specify migration bandwidth limit in Mbps * * Migrate the domain object from its current host to the destination - * host given by dconn (a connection to the destination host). + * host given by duri. * * Flags may be one of more of the following: * VIR_MIGRATE_LIVE Do not pause the VM during migration -- 1.6.2.5 -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] error: failed to connect to the hypervisor
Hello, I have reinstalled libvirt-bin on ubuntu 9.04. Then I got a error: r...@forest:/usr/local/etc/logrotate.d# virsh -c qemu:///system list error: failed to connect to the hypervisor --- ps: I have installed kvm on ubuntu. Any ideas? Regards Zhentao -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] libvirt and Linux KVM migrate_set_speed
On Mon, Oct 19, 2009 at 03:41:30AM +, Monchiero, Matteo wrote: > Does Libvirt has an interface for KVM's migrate_set_speed? See last argument of virDomainMigrate http://libvirt.org/html/libvirt-libvirt.html#virDomainMigrate Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ dan...@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/ -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] libvirt: use existing network bridge
Le lundi 19 octobre 2009 à 09:14 +0200, Chris Lalancette a écrit : > Sascha Frey wrote: > > Hi, > > > > I met a problem setting up virt-manager and libvirt: > > > > I want to use an existing customized network bridge with libvirt > > (I need special iptables rules and a custom DHCP setup). > > > > So I created a network definition file like this: > > > > NAT > > > > > > > > Unfortunately, I'm unable to activate this network, because libvirt > > tries to create the bridge `br-nat' and fails, because it already > > exists: > > > > # virsh net-start NAT > > error: Failed to start network NAT > > error: cannot create bridge 'br-nat': File exists > > > > > > I just want libvirt to attach the guest's tap devices to this existing > > bridge. I don't want libvirt to manage the network. > > > > Is there any chance to realize this set-up? > > It should work with virt-manager using the graphical wizard. > > Yes, just don't define a new network. To use existing bridges, you just need > to > edit your guest XML files to use something like: > > > > > > > Note that configured bridges should also show up in virt-manager, I believe. Existing bridge shows up in virt-manager when run on the local machine. If you use a remote connection (at least qemu+ssh), you don't see it, you need to manually edit the guest XML. (btw, is this a known "problem" or a bug ?) Regards, Daniel > -- Daniel Berteaud FIREWALL-SERVICES SARL. Société de Services en Logiciels Libres Technopôle Montesquieu 33650 MARTILLAC Tel : 05 56 64 15 32 Fax : 05 56 64 15 32 Mail: dan...@firewall-services.com Web : http://www.firewall-services.com -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] libvirt: use existing network bridge
Sascha Frey wrote: > Hi, > > I met a problem setting up virt-manager and libvirt: > > I want to use an existing customized network bridge with libvirt > (I need special iptables rules and a custom DHCP setup). > > So I created a network definition file like this: > > NAT > > > > Unfortunately, I'm unable to activate this network, because libvirt > tries to create the bridge `br-nat' and fails, because it already > exists: > > # virsh net-start NAT > error: Failed to start network NAT > error: cannot create bridge 'br-nat': File exists > > > I just want libvirt to attach the guest's tap devices to this existing > bridge. I don't want libvirt to manage the network. > > Is there any chance to realize this set-up? > It should work with virt-manager using the graphical wizard. Yes, just don't define a new network. To use existing bridges, you just need to edit your guest XML files to use something like: Note that configured bridges should also show up in virt-manager, I believe. -- Chris Lalancette -- Libvir-list mailing list Libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list