Re: [libvirt] [PATCH] PHYP: Checking for NULL values when building new guest
2010/8/24 Eduardo Otubo ot...@linux.vnet.ibm.com: memory and maxmem might be 0 when the user sets the to 0 in the domain XML. IMHO comparing 0 is cleaner here. I already submitted the patch v2 with this fix and I didn't understand exactly this comparison 0. Memory should be greater than zero, right? Hence, if memory 0, then ERROR. Right? If not, could you explain the reasons? Thanks, Sorry, that's my fault. def-memory and def-maxmem are unsigned so your original check using ! was perfectly fine. Matthias -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCHv2] PHYP: Checking for NULL values when building new guest
2010/8/23 Eduardo Otubo ot...@linux.vnet.ibm.com: I fixed the way I check for invalid values and changed the way I report errors (from VIR_ERROR0 to PHYP_ERROR). I'll change the VIR_WARNs in another different patch. Okay, that's fine. --- src/phyp/phyp_driver.c | 23 +++ 1 files changed, 23 insertions(+), 0 deletions(-) diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c index 25d..a74eedf 100644 --- a/src/phyp/phyp_driver.c +++ b/src/phyp/phyp_driver.c @@ -3701,6 +3701,29 @@ phypBuildLpar(virConnectPtr conn, virDomainDefPtr def) int exit_status = 0; virBuffer buf = VIR_BUFFER_INITIALIZER; + if (def-memory 0) { + PHYP_ERROR(VIR_ERR_XML_ERROR,%s, + _(Field \memory\ on the domain XML file is missing or has + invalid value.)); + goto err; + } + + if (def-maxmem 0) { + PHYP_ERROR(VIR_ERR_XML_ERROR,%s, + _(Field \currentMemory\ on the domain XML file is missing or + has invalid value.)); + goto err; + } Sorry for confusing you about comparing 0, now the check is wrong here and you report an error when the input is actually valid. Please change this back to if (!def-memory). + if (def-ndisks 0) { + if (!def-disks[0]-src) { + PHYP_ERROR(VIR_ERR_XML_ERROR,%s, + _(Field \src\ under \disk\ on the domain XML file is + missing.)); + goto err; + } + } Okay, no potential segfault here anymore. But a few lines below you use def-disks[0]-src in a virBufferVSprintf call, without checking if the first disk element is there. So you either need to make the first disk element mandatory by checking for def-ndisks being 0 and reporting an error in that case, or by altering the virBufferVSprintf call to only output the virtual_scsi_adapters=%s part when the domain XML contains a disk element. Matthias -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [RFC] Memory controller exploitation in libvirt
2010/8/24 Nikunj A. Dadhania nik...@linux.vnet.ibm.com: On Tue, 24 Aug 2010 11:02:49 +0200, Matthias Bolte matthias.bo...@googlemail.com wrote: snip Regarding future additions: CPUHardLimit CPUSoftLimit CPUShare CPUPercentage IO_BW_Softlimit IO_BW_Hardlimit IO_BW_percentage The CPU part of this is already possible via the virDomainSetSchedulerParameters API. But they aren't expressed in the domain XML config, maybe your suggesting to do this? Yes, thats correct for CPU. IO would need API as well as XML config changes. Does ESX also support Block IO bandwidth control? ESX 4.1 added StorageIOAllocation for VirtualDisks that allows to set a limit (upper bound) and a shares (priority) value for storage I/O per disk. Matthias -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH] Explicitly pass uml_dir argument to user-mode-linux
uml_dir overrides user-mode-linux's default of ~/.uml. This is needed for a couple of different reasons: libvirt expects this to default to virGetUserDirectory(geteuid()) + '/.uml'. However, user-mode-linux actually uses the HOME environment variable to determine where to look for the uml sockets, but if running libvirtd under sudo (which I routinely do during development), $HOME is pointing at my user's homedir, while my euid is 0, so libvirt looks in /root. Also (and this was my actual motivation for this patch), if HOME isn't set at all, user-mode-linux utterly fails. Looking at the code, it seems it's meant to emit a warning, but alas, it doesn't for some reason. If running libvirtd from upstart, HOME is not set, so any system using upstart will need this change. Signed-off-by: Soren Hansen so...@linux2go.dk --- src/uml/uml_conf.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/uml/uml_conf.c b/src/uml/uml_conf.c index 65b06c5..4906192 100644 --- a/src/uml/uml_conf.c +++ b/src/uml/uml_conf.c @@ -409,7 +409,7 @@ static char *umlNextArg(char *args) * for a given virtual machine. */ int umlBuildCommandLine(virConnectPtr conn, -struct uml_driver *driver ATTRIBUTE_UNUSED, +struct uml_driver *driver, virDomainObjPtr vm, fd_set *keepfd, const char ***retargv, @@ -499,7 +499,6 @@ int umlBuildCommandLine(virConnectPtr conn, ADD_ENV_COPY(LD_PRELOAD); ADD_ENV_COPY(LD_LIBRARY_PATH); ADD_ENV_COPY(PATH); -ADD_ENV_COPY(HOME); ADD_ENV_COPY(USER); ADD_ENV_COPY(LOGNAME); ADD_ENV_COPY(TMPDIR); @@ -508,6 +507,7 @@ int umlBuildCommandLine(virConnectPtr conn, //ADD_ARG_PAIR(con0, fd:0,fd:1); ADD_ARG_PAIR(mem, memory); ADD_ARG_PAIR(umid, vm-def-name); +ADD_ARG_PAIR(uml_dir, driver-monitorDir); if (vm-def-os.root) ADD_ARG_PAIR(root, vm-def-os.root); -- 1.7.0.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH] spec: Fix undefined with_libnl
When building libvirt RPM without macvtap, with_libnl would be undefined. --- libvirt.spec.in |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index cc3e8e2..e530b1a 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -64,6 +64,7 @@ %define with_nwfilter 0%{!?_without_nwfilter:0} %define with_libpcap 0%{!?_without_libpcap:0} %define with_macvtap 0%{!?_without_macvtap:0} +%define with_libnl 0%{!?_without_libnl:0} # Non-server/HV driver defaults which are always enabled %define with_python0%{!?_without_python:1} -- 1.7.2.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] KVM doesn't send an arp announce after live migrating a domain
On 08/25/2010 12:21 PM, Nils Cant wrote: On 08/25/2010 10:38 AM, Gleb Natapov wrote: qemu sends gratuitous ARP after migration. Check forward delay setting on your bridge interface. It should be set to zero. Aha! That fixed it. Turns out that debian bridge-utils sets the default to 15 for bridges. Manually setting it to 0 with 'brctl setfd br0 0' or setting the 'bridge_fd' parameter to 0 in /etc/network/interfaces solves the issue. I think libvirt is doing something about this, copying list for further info. -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain. -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] KVM doesn't send an arp announce after live migrating a domain
On Wed, Aug 25, 2010 at 01:40:19PM +0300, Avi Kivity wrote: On 08/25/2010 12:21 PM, Nils Cant wrote: On 08/25/2010 10:38 AM, Gleb Natapov wrote: qemu sends gratuitous ARP after migration. Check forward delay setting on your bridge interface. It should be set to zero. Aha! That fixed it. Turns out that debian bridge-utils sets the default to 15 for bridges. Manually setting it to 0 with 'brctl setfd br0 0' or setting the 'bridge_fd' parameter to 0 in /etc/network/interfaces solves the issue. I think libvirt is doing something about this, copying list for further info. libvirt doesn't set a policy for this. It provides an API for configuring host networking, but we don't override the kernel's forward delay policy, since we don't presume that all bridges are going to have VMs attached. In any case the API isn't available for Debian yet, since no one has ported netcf to Debian, so I assume the OP set bridging up manually. The '15' second default is actually a kernel level default IIRC. The two main host network configs recommended for use with libvirt+KVM (either NAT or bridging) are documented here: http://wiki.libvirt.org/page/Networking Regards, Daniel -- |: Red Hat, Engineering, London-o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.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] KVM doesn't send an arp announce after live migrating a domain
On 08/25/2010 01:52 PM, Daniel P. Berrange wrote: I think libvirt is doing something about this, copying list for further info. libvirt doesn't set a policy for this. It provides an API for configuring host networking, but we don't override the kernel's forward delay policy, since we don't presume that all bridges are going to have VMs attached. In any case the API isn't available for Debian yet, since no one has ported netcf to Debian, so I assume the OP set bridging up manually. The '15' second default is actually a kernel level default IIRC. The two main host network configs recommended for use with libvirt+KVM (either NAT or bridging) are documented here: http://wiki.libvirt.org/page/Networking From that page: # virsh net-define /usr/share/libvirt/networks/default.xml From my copy of that file: network namedefault/name bridge name=virbr0 / forward/ ip address=192.168.122.1 netmask=255.255.255.0 dhcp range start=192.168.122.2 end=192.168.122.254 / /dhcp /ip /network So it looks like the default config uses the kernel default? If libvirt uses an existing bridge I agree it shouldn't hack it, but if it creates its own can't it use a sensible default? -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain. -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] KVM doesn't send an arp announce after live migrating a domain
On Wed, Aug 25, 2010 at 02:05:45PM +0300, Avi Kivity wrote: On 08/25/2010 01:52 PM, Daniel P. Berrange wrote: I think libvirt is doing something about this, copying list for further info. libvirt doesn't set a policy for this. It provides an API for configuring host networking, but we don't override the kernel's forward delay policy, since we don't presume that all bridges are going to have VMs attached. In any case the API isn't available for Debian yet, since no one has ported netcf to Debian, so I assume the OP set bridging up manually. The '15' second default is actually a kernel level default IIRC. The two main host network configs recommended for use with libvirt+KVM (either NAT or bridging) are documented here: http://wiki.libvirt.org/page/Networking From that page: # virsh net-define /usr/share/libvirt/networks/default.xml From my copy of that file: network namedefault/name bridge name=virbr0 / forward/ ip address=192.168.122.1 netmask=255.255.255.0 dhcp range start=192.168.122.2 end=192.168.122.254 / /dhcp /ip /network So it looks like the default config uses the kernel default? If libvirt uses an existing bridge I agree it shouldn't hack it, but if it creates its own can't it use a sensible default? That is the NAT virtual network. That one *does* default to a forward delay of 0, but since it is NAT, it is fairly useless for migration in anycase. If you do 'virsh net-dumpxml default' you should see that delay='0' was added The OP was using bridging rather than NAT though, so this XML example doesn't apply. My comments about libvirt not overriding kenrel policy for forward delay were WRT full bridging mode, not the NAT mode[1] Regards, Daniel [1] Yes, the NAT mode uses a bridge as an implementation detail, but there's no physical NIC in that bridge - it is merely to connect the TAP devices together. Connection to the LAN is forwarded + NAT. -- |: Red Hat, Engineering, London-o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.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] KVM doesn't send an arp announce after live migrating a domain
On 08/25/2010 02:15 PM, Daniel P. Berrange wrote: So it looks like the default config uses the kernel default? If libvirt uses an existing bridge I agree it shouldn't hack it, but if it creates its own can't it use a sensible default? That is the NAT virtual network. That one *does* default to a forward delay of 0, but since it is NAT, it is fairly useless for migration in anycase. If you do 'virsh net-dumpxml default' you should see that delay='0' was added The OP was using bridging rather than NAT though, so this XML example doesn't apply. My comments about libvirt not overriding kenrel policy for forward delay were WRT full bridging mode, not the NAT mode[1] Yes, of course. Can't libvirt also create a non-NAT bridge? Looks like it would prevent a lot of manual work and opportunity for misconfiguration. -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain. -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] KVM doesn't send an arp announce after live migrating a domain
On Wed, Aug 25, 2010 at 02:30:01PM +0300, Avi Kivity wrote: On 08/25/2010 02:15 PM, Daniel P. Berrange wrote: So it looks like the default config uses the kernel default? If libvirt uses an existing bridge I agree it shouldn't hack it, but if it creates its own can't it use a sensible default? That is the NAT virtual network. That one *does* default to a forward delay of 0, but since it is NAT, it is fairly useless for migration in anycase. If you do 'virsh net-dumpxml default' you should see that delay='0' was added The OP was using bridging rather than NAT though, so this XML example doesn't apply. My comments about libvirt not overriding kenrel policy for forward delay were WRT full bridging mode, not the NAT mode[1] Yes, of course. Can't libvirt also create a non-NAT bridge? Looks like it would prevent a lot of manual work and opportunity for misconfiguration. Yes, it can on latest Fedora/RHEL6, using the netcf library. This is the new 'virsh iface-XXX' command set (and equivalent APIs). I've not updated the docs to cover this functionality yet though. It also does bonding, and vlans, etc Daniel -- |: Red Hat, Engineering, London-o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.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] KVM doesn't send an arp announce after live migrating a domain
On Wed, Aug 25, 2010 at 02:38:25PM +0300, Avi Kivity wrote: On 08/25/2010 02:36 PM, Daniel P. Berrange wrote: Can't libvirt also create a non-NAT bridge? Looks like it would prevent a lot of manual work and opportunity for misconfiguration. Yes, it can on latest Fedora/RHEL6, using the netcf library. This is the new 'virsh iface-XXX' command set (and equivalent APIs). I've not updated the docs to cover this functionality yet though. It also does bonding, and vlans, etc Great. Is virt-manager able to drive this? it would be great if you could drive everything from there. Yes, it does now, under the menu Edit - Host Details - Network Interfaces NetworkManager has also finally learnt to ignore ifcfg-XXX files which have a BRIDGE= setting in them, so it shouldn't totally trash your guest bridge networking if you leave NM running. Regards, Daniel -- |: Red Hat, Engineering, London-o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.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] KVM doesn't send an arp announce after live migrating a domain
On 08/25/2010 02:36 PM, Daniel P. Berrange wrote: Can't libvirt also create a non-NAT bridge? Looks like it would prevent a lot of manual work and opportunity for misconfiguration. Yes, it can on latest Fedora/RHEL6, using the netcf library. This is the new 'virsh iface-XXX' command set (and equivalent APIs). I've not updated the docs to cover this functionality yet though. It also does bonding, and vlans, etc Great. Is virt-manager able to drive this? it would be great if you could drive everything from there. -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain. -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] KVM doesn't send an arp announce after live migrating a domain
On 08/25/2010 02:42 PM, Daniel P. Berrange wrote: Is virt-manager able to drive this? it would be great if you could drive everything from there. Yes, it does now, under the menu Edit - Host Details - Network Interfaces NetworkManager has also finally learnt to ignore ifcfg-XXX files which have a BRIDGE= setting in them, so it shouldn't totally trash your guest bridge networking if you leave NM running. Cool. I guess what remains is to get people to unlearn all the previous hacks. (also would be nice to have libvirt talk to NetworkManager instead of /etc/sysconfig) -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain. -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH] Move libvirt-guests init script and config to tools
Since libvirt-guests init script and its configuration do not require libvirtd to be running/installed, it was a bad idea to put them into daemon directory. libvirt.spec even includes these files in libvirt-client subpackage, which may result in build failure for client-only builds when the whole daemon directory is just skipped. --- daemon/Makefile.am| 16 +-- daemon/libvirt-guests.init.in | 341 - daemon/libvirt-guests.sysconf | 24 --- tools/Makefile.am | 41 +- tools/libvirt-guests.init.in | 341 + tools/libvirt-guests.sysconf | 24 +++ 6 files changed, 409 insertions(+), 378 deletions(-) delete mode 100644 daemon/libvirt-guests.init.in delete mode 100644 daemon/libvirt-guests.sysconf create mode 100644 tools/libvirt-guests.init.in create mode 100644 tools/libvirt-guests.sysconf diff --git a/daemon/Makefile.am b/daemon/Makefile.am index dbf0ac3..53133d2 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -35,8 +35,6 @@ EXTRA_DIST = \ libvirtd.uml.logrotate.in \ test_libvirtd.aug \ THREADING.txt \ - libvirt-guests.init.in \ - libvirt-guests.sysconf \ libvirtd.pod.in \ $(AVAHI_SOURCES)\ $(DAEMON_SOURCES) @@ -258,27 +256,21 @@ install-logrotate: $(LOGROTATE_CONFS) $(INSTALL_DATA) libvirtd.uml.logrotate $(DESTDIR)$(sysconfdir)/logrotate.d/libvirtd.uml if LIBVIRT_INIT_SCRIPT_RED_HAT -install-init: libvirtd.init libvirt-guests.init +install-init: libvirtd.init mkdir -p $(DESTDIR)$(sysconfdir)/rc.d/init.d $(INSTALL_SCRIPT) libvirtd.init \ $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirtd - $(INSTALL_SCRIPT) libvirt-guests.init \ - $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirt-guests mkdir -p $(DESTDIR)$(sysconfdir)/sysconfig $(INSTALL_SCRIPT) $(srcdir)/libvirtd.sysconf \ $(DESTDIR)$(sysconfdir)/sysconfig/libvirtd - $(INSTALL_SCRIPT) $(srcdir)/libvirt-guests.sysconf \ - $(DESTDIR)$(sysconfdir)/sysconfig/libvirt-guests uninstall-init: rm -f $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirtd \ - $(DESTDIR)$(sysconfdir)/sysconfig/libvirtd \ - $(DESTDIR)$(sysconfdir)/rc.d/init.d/libvirt-guests \ - $(DESTDIR)$(sysconfdir)/sysconfig/libvirt-guests + $(DESTDIR)$(sysconfdir)/sysconfig/libvirtd -BUILT_SOURCES += libvirtd.init libvirt-guests.init +BUILT_SOURCES += libvirtd.init -%.init: %.init.in $(top_builddir)/config.status +libvirtd.init: libvirtd.init.in $(top_builddir)/config.status $(AM_V_GEN)sed \ -e s...@localstatedir\@!...@localstatedir@!g\ -e s...@sbindir\@!...@sbindir@!g\ diff --git a/daemon/libvirt-guests.init.in b/daemon/libvirt-guests.init.in deleted file mode 100644 index 993c12d..000 --- a/daemon/libvirt-guests.init.in +++ /dev/null @@ -1,341 +0,0 @@ -#!/bin/sh - -# the following is the LSB init header -# -### BEGIN INIT INFO -# Provides: libvirt-guests -# Required-Start: libvirtd -# Required-Stop: libvirtd -# Default-Start: 3 4 5 -# Short-Description: suspend/resume libvirt guests on shutdown/boot -# Description: This is a script for suspending active libvirt guests -# on shutdown and resuming them on next boot -# See http://libvirt.org -### END INIT INFO - -# the following is chkconfig init header -# -# libvirt-guests: suspend/resume libvirt guests on shutdown/boot -# -# chkconfig: 345 98 02 -# description: This is a script for suspending active libvirt guests \ -# on shutdown and resuming them on next boot \ -# See http://libvirt.org -# - -sysconfd...@sysconfdir@ -localstated...@localstatedir@ -libvir...@sbindir@/libvirtd - -# Source function library. -. $sysconfdir/rc.d/init.d/functions - -URIS=default -ON_BOOT=start -ON_SHUTDOWN=suspend -SHUTDOWN_TIMEOUT=0 - -test -f $sysconfdir/sysconfig/libvirt-guests . $sysconfdir/sysconfig/libvirt-guests - -LISTFILE=$localstatedir/lib/libvirt/libvirt-guests -VAR_SUBSYS_LIBVIRT_GUESTS=$localstatedir/lock/subsys/libvirt-guests - -RETVAL=0 - -retval() { -$@ -if [ $? -ne 0 ]; then -RETVAL=1 -return 1 -else -return 0 -fi -} - -run_virsh() { -uri=$1 -shift - -if [ x$uri = xdefault ]; then -conn= -else -conn=-c $uri -fi - -virsh $conn $@ /dev/null -} - -run_virsh_c() { -( export LC_ALL=C; run_virsh $@ ) -} - -list_guests() { -uri=$1 - -list=$(run_virsh_c $uri list) -if [ $? -ne 0 ]; then -RETVAL=1 -return 1 -fi - -uuids= -for
Re: [libvirt] KVM doesn't send an arp announce after live migrating a domain
On 08/25/2010 07:59 AM, Avi Kivity wrote: On 08/25/2010 02:42 PM, Daniel P. Berrange wrote: Is virt-manager able to drive this? it would be great if you could drive everything from there. Yes, it does now, under the menu Edit - Host Details - Network Interfaces NetworkManager has also finally learnt to ignore ifcfg-XXX files which have a BRIDGE= setting in them, so it shouldn't totally trash your guest bridge networking if you leave NM running. There are a couple of caveats remaining, though: 1) When a bridge is created and a physical interface is moved to it, there is a short delay ( 1 sec, but 0) when NM hasn't yet processed the inotify message from the kernel, and so doesn't yet know that it's supposed to stop managing that interface. The result is that if you attempt to do virsh iface-create br0.xml virsh iface-start br0 (where br0 is becoming the master for an interface, eg eth0 that previously was being used directly), the resulting ifup (part of iface-start) will fail. A delay of even 1 sec. eliminates this problem. This race condition will hopefully soon be remedied in NM. Having this functionality in virt-manager really has made it dead simple to create a bridge, especially if NM is disabled, in which case the host's ethernet switches from direct connnect to bridged with no interruption in open connections on the interface (ie, it's possible to create and bring up the bridge while connected via the interface you are bridging). 2) If the physical interface being bridged is the only interface managed by NM, once it is moved to the bridge (and thus no longer managed by NM), NM will believe that the system is offline, and any applications paying attention to that status will lose their connectivity. This isn't a problem if there is any other interface that's still managed by NM (the bridges themselves are not yet managed by NM - so far it just pretends they don't exist, as it does with vlans and bonds, as well as interfaces that are attached to a bridge). Cool. I guess what remains is to get people to unlearn all the previous hacks. Yes, I need to add a section to the docs Daniel pointed to that suggest using the virsh iface-* commands (or virt-manager's functionality) when available, and to only do it the handmade way if netcf isn't there (meaning that iface-* won't be there). (also would be nice to have libvirt talk to NetworkManager instead of /etc/sysconfig) To solve the variations of problem (2) above, NM needs to understand bridges, including configuring them, and there is some amount of consensus (including from the NM team :-) that a good way for NM to configure bridges (as well as vlans and bonds) is to use the netcf library, as libvirt does. The biggest hurdle is finding the people resources to get it done ;-) So, instead of libvirt--netcf--NM--sysconfig, the diagram would be libvirt/NM--netcf--sysconfig. -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] KVM doesn't send an arp announce after live migrating a domain
On 08/25/2010 06:52 AM, Daniel P. Berrange wrote: libvirt doesn't set a policy for this. It provides an API for configuring host networking, but we don't override the kernel's forward delay policy, since we don't presume that all bridges are going to have VMs attached. In any case the API isn't available for Debian yet, since no one has ported netcf to Debian, Patches welcome! (as are questions/suggestions/complaints/sarcastic taunts/etc) :-) https://fedorahosted.org/netcf/ If you look in the mailing list archives, you'll find a couple of messages from people porting netcf to other Linux distributions (although none has gotten to the point of a patch submitted for pushing). It would be really great to see netcf running on other platforms, as all the iface-* functionality in libvirt (and thus virt-manager) would magically start working on that platform). -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] Explicitly pass uml_dir argument to user-mode-linux
On 08/25/2010 05:03 AM, Soren Hansen wrote: uml_dir overrides user-mode-linux's default of ~/.uml. This is needed for a couple of different reasons: libvirt expects this to default to virGetUserDirectory(geteuid()) + '/.uml'. However, user-mode-linux actually uses the HOME environment variable to determine where to look for the uml sockets, but if running libvirtd under sudo (which I routinely do during development), $HOME is pointing at my user's homedir, while my euid is 0, so libvirt looks in /root. Also (and this was my actual motivation for this patch), if HOME isn't set at all, user-mode-linux utterly fails. Looking at the code, it seems it's meant to emit a warning, but alas, it doesn't for some reason. If running libvirtd from upstart, HOME is not set, so any system using upstart will need this change. Signed-off-by: Soren Hansen so...@linux2go.dk --- src/uml/uml_conf.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/uml/uml_conf.c b/src/uml/uml_conf.c index 65b06c5..4906192 100644 --- a/src/uml/uml_conf.c +++ b/src/uml/uml_conf.c @@ -409,7 +409,7 @@ static char *umlNextArg(char *args) * for a given virtual machine. */ int umlBuildCommandLine(virConnectPtr conn, -struct uml_driver *driver ATTRIBUTE_UNUSED, +struct uml_driver *driver, virDomainObjPtr vm, fd_set *keepfd, const char ***retargv, @@ -499,7 +499,6 @@ int umlBuildCommandLine(virConnectPtr conn, ADD_ENV_COPY(LD_PRELOAD); ADD_ENV_COPY(LD_LIBRARY_PATH); ADD_ENV_COPY(PATH); -ADD_ENV_COPY(HOME); ADD_ENV_COPY(USER); ADD_ENV_COPY(LOGNAME); ADD_ENV_COPY(TMPDIR); @@ -508,6 +507,7 @@ int umlBuildCommandLine(virConnectPtr conn, //ADD_ARG_PAIR(con0, fd:0,fd:1); ADD_ARG_PAIR(mem, memory); ADD_ARG_PAIR(umid, vm-def-name); +ADD_ARG_PAIR(uml_dir, driver-monitorDir); if (vm-def-os.root) ADD_ARG_PAIR(root, vm-def-os.root); I think this should also solve this long standing fedora/selinux bug: https://bugzilla.redhat.com/show_bug.cgi?id=499536 - Cole -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] Explicitly pass uml_dir argument to user-mode-linux
On Wed, Aug 25, 2010 at 10:07:45AM -0400, Cole Robinson wrote: On 08/25/2010 05:03 AM, Soren Hansen wrote: uml_dir overrides user-mode-linux's default of ~/.uml. This is needed for a couple of different reasons: libvirt expects this to default to virGetUserDirectory(geteuid()) + '/.uml'. However, user-mode-linux actually uses the HOME environment variable to determine where to look for the uml sockets, but if running libvirtd under sudo (which I routinely do during development), $HOME is pointing at my user's homedir, while my euid is 0, so libvirt looks in /root. Also (and this was my actual motivation for this patch), if HOME isn't set at all, user-mode-linux utterly fails. Looking at the code, it seems it's meant to emit a warning, but alas, it doesn't for some reason. If running libvirtd from upstart, HOME is not set, so any system using upstart will need this change. Signed-off-by: Soren Hansen so...@linux2go.dk --- src/uml/uml_conf.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/uml/uml_conf.c b/src/uml/uml_conf.c index 65b06c5..4906192 100644 --- a/src/uml/uml_conf.c +++ b/src/uml/uml_conf.c @@ -409,7 +409,7 @@ static char *umlNextArg(char *args) * for a given virtual machine. */ int umlBuildCommandLine(virConnectPtr conn, -struct uml_driver *driver ATTRIBUTE_UNUSED, +struct uml_driver *driver, virDomainObjPtr vm, fd_set *keepfd, const char ***retargv, @@ -499,7 +499,6 @@ int umlBuildCommandLine(virConnectPtr conn, ADD_ENV_COPY(LD_PRELOAD); ADD_ENV_COPY(LD_LIBRARY_PATH); ADD_ENV_COPY(PATH); -ADD_ENV_COPY(HOME); ADD_ENV_COPY(USER); ADD_ENV_COPY(LOGNAME); ADD_ENV_COPY(TMPDIR); @@ -508,6 +507,7 @@ int umlBuildCommandLine(virConnectPtr conn, //ADD_ARG_PAIR(con0, fd:0,fd:1); ADD_ARG_PAIR(mem, memory); ADD_ARG_PAIR(umid, vm-def-name); +ADD_ARG_PAIR(uml_dir, driver-monitorDir); if (vm-def-os.root) ADD_ARG_PAIR(root, vm-def-os.root); I think this should also solve this long standing fedora/selinux bug: Almost. We still need to change 'driver-monitorDir' so that it gets initialized to '$LOCAL_STATE_DIR/lib/libvirt/uml' like we do with QEMU (or $HOME/.libvirt/uml/lib for session mode) Regards, Daniel -- |: Red Hat, Engineering, London-o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.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] spec: Fix undefined with_libnl
On 08/25/2010 04:30 AM, Jiri Denemark wrote: When building libvirt RPM without macvtap, with_libnl would be undefined. --- libvirt.spec.in |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index cc3e8e2..e530b1a 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -64,6 +64,7 @@ %define with_nwfilter 0%{!?_without_nwfilter:0} %define with_libpcap 0%{!?_without_libpcap:0} %define with_macvtap 0%{!?_without_macvtap:0} +%define with_libnl 0%{!?_without_libnl:0} ACK. -- Eric Blake ebl...@redhat.com+1-801-349-2682 Libvirt virtualization library http://libvirt.org -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] Move libvirt-guests init script and config to tools
On 08/25/2010 06:33 AM, Jiri Denemark wrote: Since libvirt-guests init script and its configuration do not require libvirtd to be running/installed, it was a bad idea to put them into daemon directory. libvirt.spec even includes these files in libvirt-client subpackage, which may result in build failure for client-only builds when the whole daemon directory is just skipped. --- daemon/Makefile.am| 16 +-- daemon/libvirt-guests.init.in | 341 - daemon/libvirt-guests.sysconf | 24 --- tools/Makefile.am | 41 +- tools/libvirt-guests.init.in | 341 + tools/libvirt-guests.sysconf | 24 +++ 6 files changed, 409 insertions(+), 378 deletions(-) delete mode 100644 daemon/libvirt-guests.init.in delete mode 100644 daemon/libvirt-guests.sysconf create mode 100644 tools/libvirt-guests.init.in create mode 100644 tools/libvirt-guests.sysconf Using -M when generating the git diff would have been helpful (it would have compressed the file renames down to a couple of lines, leaving only the Makefile.am changes needing explicit review). In fact, since we don't have to cater to non-git patch programs when reviewing libvirt patches, you may want to run 'git config diff.renames true' to auto-set the -M option for future diffs. At any rate, ACK. -- Eric Blake ebl...@redhat.com+1-801-349-2682 Libvirt virtualization library http://libvirt.org -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] Explicitly pass uml_dir argument to user-mode-linux
On 25-08-2010 16:07, Cole Robinson wrote: On 08/25/2010 05:03 AM, Soren Hansen wrote: uml_dir overrides user-mode-linux's default of ~/.uml. This is needed for a couple of different reasons: I think this should also solve this long standing fedora/selinux bug: https://bugzilla.redhat.com/show_bug.cgi?id=499536 Well, halfway. The other half should be easy, though. Gimme a few minutes. -- Soren Hansen Ubuntu Developer http://www.ubuntu.com/ -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH] Use global directory as UML's monitorDir for privileged connections
For privileged UML connections (uml:///system), we shouldn't use root's home dir, but rather somewhre in /var/run/libvirt/uml. https://bugzilla.redhat.com/show_bug.cgi?id=499536 Signed-off-by: Soren Hansen so...@linux2go.dk --- src/uml/uml_driver.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c index 8b129b7..c8b9997 100644 --- a/src/uml/uml_driver.c +++ b/src/uml/uml_driver.c @@ -373,6 +373,10 @@ umlStartup(int privileged) { if ((base = strdup (SYSCONF_DIR /libvirt)) == NULL) goto out_of_memory; + +if (virAsprintf(uml_driver-monitorDir, +%s/run/libvirt/uml, LOCAL_STATE_DIR) == -1) +goto out_of_memory; } else { if (virAsprintf(uml_driver-logDir, @@ -381,11 +385,11 @@ umlStartup(int privileged) { if (virAsprintf(base, %s/.libvirt, userdir) == -1) goto out_of_memory; -} -if (virAsprintf(uml_driver-monitorDir, -%s/.uml, userdir) == -1) -goto out_of_memory; +if (virAsprintf(uml_driver-monitorDir, +%s/.uml, userdir) == -1) +goto out_of_memory; +} /* Configuration paths are either ~/.libvirt/uml/... (session) or * /etc/libvirt/uml/... (system). -- 1.7.0.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] Explicitly pass uml_dir argument to user-mode-linux
On 25-08-2010 16:18, Daniel P. Berrange wrote: Almost. We still need to change 'driver-monitorDir' so that it gets initialized to '$LOCAL_STATE_DIR/lib/libvirt/uml' like we do with QEMU (or $HOME/.libvirt/uml/lib for session mode) I think leaving it as $HOME/.uml is preferable for uml:///session. It integrates well with the existing, well-known uml-utilities (e.g. uml_mconsole domain name Just Works[tm]). -- Soren Hansen Ubuntu Developer http://www.ubuntu.com/ -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] Use global directory as UML's monitorDir for privileged connections
On Wed, Aug 25, 2010 at 05:52:23PM +0200, Soren Hansen wrote: For privileged UML connections (uml:///system), we shouldn't use root's home dir, but rather somewhre in /var/run/libvirt/uml. https://bugzilla.redhat.com/show_bug.cgi?id=499536 Signed-off-by: Soren Hansen so...@linux2go.dk --- src/uml/uml_driver.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c index 8b129b7..c8b9997 100644 --- a/src/uml/uml_driver.c +++ b/src/uml/uml_driver.c @@ -373,6 +373,10 @@ umlStartup(int privileged) { if ((base = strdup (SYSCONF_DIR /libvirt)) == NULL) goto out_of_memory; + +if (virAsprintf(uml_driver-monitorDir, +%s/run/libvirt/uml, LOCAL_STATE_DIR) == -1) +goto out_of_memory; Can we make this '%s/lib/libvirt/uml' } else { if (virAsprintf(uml_driver-logDir, @@ -381,11 +385,11 @@ umlStartup(int privileged) { if (virAsprintf(base, %s/.libvirt, userdir) == -1) goto out_of_memory; -} -if (virAsprintf(uml_driver-monitorDir, -%s/.uml, userdir) == -1) -goto out_of_memory; +if (virAsprintf(uml_driver-monitorDir, +%s/.uml, userdir) == -1) +goto out_of_memory; +} And '%s/.libvirt/uml/lib' So that we match the QEMU driver layout. We aim to keep a strict separate for 'lib' to be the place where the guest can write/create files (control sockets), and 'run' to be the place where libvirtd can write/create files (eg pid files, xml state). Daniel -- |: Red Hat, Engineering, London-o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.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] Explicitly pass uml_dir argument to user-mode-linux
On Wed, Aug 25, 2010 at 05:56:22PM +0200, Soren Hansen wrote: On 25-08-2010 16:18, Daniel P. Berrange wrote: Almost. We still need to change 'driver-monitorDir' so that it gets initialized to '$LOCAL_STATE_DIR/lib/libvirt/uml' like we do with QEMU (or $HOME/.libvirt/uml/lib for session mode) I think leaving it as $HOME/.uml is preferable for uml:///session. It integrates well with the existing, well-known uml-utilities (e.g. uml_mconsole domain name Just Works[tm]). Oh, i guess so then. Daniel -- |: Red Hat, Engineering, London-o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.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
[libvirt] [PATCHv3] PHYP: Checking for NULL values when building new guest
When creating a new gust, the function phypBuildLpar() was not checking for NULL values, making the driver to have a segmentation fault. --- src/phyp/phyp_driver.c | 23 +++ 1 files changed, 23 insertions(+), 0 deletions(-) diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c index 25d..fcbb15e 100644 --- a/src/phyp/phyp_driver.c +++ b/src/phyp/phyp_driver.c @@ -3701,6 +3701,29 @@ phypBuildLpar(virConnectPtr conn, virDomainDefPtr def) int exit_status = 0; virBuffer buf = VIR_BUFFER_INITIALIZER; +if (!def-memory) { +PHYP_ERROR(VIR_ERR_XML_ERROR,%s, +_(Field \memory\ on the domain XML file is missing or has +invalid value.)); +goto err; +} + +if (!def-maxmem) { +PHYP_ERROR(VIR_ERR_XML_ERROR,%s, +_(Field \currentMemory\ on the domain XML file is missing or + has invalid value.)); +goto err; +} + +if (def-ndisks 0) { +if (!def-disks[0]-src) { +PHYP_ERROR(VIR_ERR_XML_ERROR,%s, +_(Field \src\ under \disk\ on the domain XML file is +missing.)); +goto err; +} +} + virBufferAddLit(buf, mksyscfg); if (system_type == HMC) virBufferVSprintf(buf, -m %s, managed_system); -- 1.7.0.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] Use global directory as UML's monitorDir for privileged connections
On 25-08-2010 18:07, Daniel P. Berrange wrote: --- a/src/uml/uml_driver.c +++ b/src/uml/uml_driver.c @@ -373,6 +373,10 @@ umlStartup(int privileged) { if ((base = strdup (SYSCONF_DIR /libvirt)) == NULL) goto out_of_memory; + +if (virAsprintf(uml_driver-monitorDir, +%s/run/libvirt/uml, LOCAL_STATE_DIR) == -1) +goto out_of_memory; Can we make this '%s/lib/libvirt/uml' You want transient stuff like UNIX sockets in /var/lib? That seems odd to me. The FHS even explicitly says: System programs that maintain transient UNIX-domain sockets must place them in this directory. where this directory is /var/run. } else { if (virAsprintf(uml_driver-logDir, @@ -381,11 +385,11 @@ umlStartup(int privileged) { if (virAsprintf(base, %s/.libvirt, userdir) == -1) goto out_of_memory; -} -if (virAsprintf(uml_driver-monitorDir, -%s/.uml, userdir) == -1) -goto out_of_memory; +if (virAsprintf(uml_driver-monitorDir, +%s/.uml, userdir) == -1) +goto out_of_memory; +} And '%s/.libvirt/uml/lib' I understand your desire to be consistent, but I really think integrating well with existing management tools for the hypervisor (in this case uml-utilities) is more important. -- Soren Hansen Ubuntu Developer http://www.ubuntu.com/ -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] PHYP: Bad comparison when checking for existing domain name
On 08/17/2010 04:04 PM, Eduardo Otubo wrote: When creating a new domain from an XML, the check for an existing domain name should compare the return of the function to a a valid LPAR ID (!= -1) and not to error (== -1). --- src/phyp/phyp_driver.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c index 25d..8eeba73 100644 --- a/src/phyp/phyp_driver.c +++ b/src/phyp/phyp_driver.c @@ -3759,7 +3759,7 @@ phypDomainCreateAndStart(virConnectPtr conn, goto err; /* checking if this name already exists on this system */ -if (phypGetLparID(session, managed_system, def-name, conn) == -1) { +if (phypGetLparID(session, managed_system, def-name, conn) != -1) { VIR_WARN0(LPAR name already exists.); goto err; } Any comments on this? I would be glad! Thanks, -- 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] [PATCH] spec: Fix undefined with_libnl
When building libvirt RPM without macvtap, with_libnl would be undefined. --- libvirt.spec.in |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index cc3e8e2..e530b1a 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -64,6 +64,7 @@ %define with_nwfilter 0%{!?_without_nwfilter:0} %define with_libpcap 0%{!?_without_libpcap:0} %define with_macvtap 0%{!?_without_macvtap:0} +%define with_libnl 0%{!?_without_libnl:0} ACK. Thanks, pushed. Jirka -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] Move libvirt-guests init script and config to tools
daemon/Makefile.am| 16 +-- daemon/libvirt-guests.init.in | 341 - daemon/libvirt-guests.sysconf | 24 --- tools/Makefile.am | 41 +- tools/libvirt-guests.init.in | 341 + tools/libvirt-guests.sysconf | 24 +++ 6 files changed, 409 insertions(+), 378 deletions(-) delete mode 100644 daemon/libvirt-guests.init.in delete mode 100644 daemon/libvirt-guests.sysconf create mode 100644 tools/libvirt-guests.init.in create mode 100644 tools/libvirt-guests.sysconf Using -M when generating the git diff would have been helpful (it would have compressed the file renames down to a couple of lines, leaving only the Makefile.am changes needing explicit review). In fact, since we don't have to cater to non-git patch programs when reviewing libvirt patches, you may want to run 'git config diff.renames true' to auto-set the -M option for future diffs. Sorry about that and thanks for the tip. I already my configuration accordingly. At any rate, ACK. And pushed the patch. Jirka -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] How to override TLS client cert and key locations used for migration?
Hi guys, Does anyone know if it's possible to override the default locations used for the TLS client certificate and it's private key, as used in migration? We have overrides in libvirtd.conf for the server cert and its private key, but I'm not seeing anything for the corresponding client pieces. The remote driver appears hard coded to use the default locations only: src/remote/remote_driver.c src/remote/remote_driver.h Any ideas? Regards and best wishes, Justin Clift -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list