[libvirt] [PATCH] bandwidth: Adjust documentation
by John Ferlan
Recent autotest/virt-test testing on f20 discovered an anomaly in how
the bandwidth options are documented and used. This was discovered due
to a bug fix in the /sbin/tc utility found in iproute-3.11.0.1 (on f20)
in which overflow was actually caught and returned as an error. The fix
was first introduced in iproute-3.10 (search on iproute2 commit 'a303853e').
The autotest/virt-test test for virsh domiftune was attempting to send
the largest unsigned integer value (4294967295) for maximum value
testing. The libvirt xml implementation was designed to manage values
in kibibytes (eg, 1024 blocks of bytes), thus when this value was
passed to /sbin/tc, it (now) properly rejected the 4294967295kbps value.
Investigation of the problem discovered that formatdomain.html.in and
formatnetwork.html.in described the elements and property types slightly
differently, although they use the same code - virNetDevBandwidthParseRate()
(shared by portgroups, domains, and networks xml parsers). Rather than
have the descriptions in two places, this patch will combine and reword
the description under formatnetwork.html.in and have formatdomain.html.in
link to that description.
This documentation faux pas was continued into the virsh man page where
the bandwidth description for both 'attach-interface' and 'domiftune'
did not indicate the scope of each value, thus leading to the test using
largest unsigned integer value, which ultimately will be wrong.
Additionally, modified the virnetdevbandwidth.h to use kibibytes instead
of kbytes (to be more clear).
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
docs/formatdomain.html.in | 35 +++----------------
docs/formatnetwork.html.in | 81 ++++++++++++++++++++++++++++++++-----------
src/util/virnetdevbandwidth.h | 8 ++---
tools/virsh.pod | 10 ++++--
4 files changed, 77 insertions(+), 57 deletions(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 4660983..ea1a97b 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -3750,37 +3750,10 @@ qemu-kvm -net nic,model=? /dev/null
<p>
This part of interface XML provides setting quality of service. Incoming
- and outgoing traffic can be shaped independently. The
- <code>bandwidth</code> element can have at most one <code>inbound</code>
- and at most one <code>outbound</code> child elements. Leaving any of these
- children element out result in no QoS applied on that traffic direction.
- So, when you want to shape only domain's incoming traffic, use
- <code>inbound</code> only, and vice versa. Each of these elements have one
- mandatory attribute <code>average</code> (or <code>floor</code> as
- described below). <code>average</code> specifies average bit rate on
- the interface being shaped. Then there are two optional attributes:
- <code>peak</code>, which specifies maximum rate at which interface can send
- data, and <code>burst</code>, amount of bytes that can be burst at
- <code>peak</code> speed. Accepted values for attributes are integer
- numbers. The units for <code>average</code> and <code>peak</code> attributes
- are kilobytes per second, and for the <code>burst</code> just kilobytes.
- Note the limitation of implementation: the <code>peak</code> attribute in
- <code>outbound</code> element is ignored (as linux ingress filters don't
- know it yet). <span class="since">Since 0.9.4</span> The <code>inbound</code> can
- optionally have <code>floor</code> attribute. This is there for
- guaranteeing minimal throughput for shaped interfaces. This, however,
- requires that all traffic goes through one point where QoS decisions can
- take place. That's why this attribute works only for virtual networks for
- now (that is <code><interface type='network'/></code> with a
- forward type of route, nat, or no forward at all). Moreover, the
- virtual network the interface is connected to is required to have at least
- inbound QoS set (<code>average</code> at least). Moreover, with
- <code>floor</code> attribute users don't need to specify
- <code>average</code>. However, <code>peak</code> and <code>burst</code>
- attributes still require <code>average</code>. Currently, linux kernel
- doesn't allow ingress qdiscs to have any classes therefore
- <code>floor</code> can be applied only on <code>inbound</code> and not
- <code>outbound</code>. <span class="since">Since 1.0.1</span>
+ and outgoing traffic can be shaped independently.
+ The <code>bandwidth</code> element and its child elements are described
+ in the <a href="formatnetwork.html#elementQoS">QoS</a> section of
+ the Network XML.
</p>
<h5><a name="elementVlanTag">Setting VLAN tag (on supported network types only)</a></h5>
diff --git a/docs/formatnetwork.html.in b/docs/formatnetwork.html.in
index 1ca1bec..de71ebf 100644
--- a/docs/formatnetwork.html.in
+++ b/docs/formatnetwork.html.in
@@ -412,40 +412,81 @@
<p>
The <code><bandwidth></code> element allows setting
- quality of service for a particular network.
- <span class="since">Since 0.9.4</span> The limits specified
+ quality of service for a particular network
+ (<span class="since">since 0.9.4</span>). For a <code>domain</code>
+ object, the limits specified are applied to the domain traffic.
+ For a <code>network</code> object, the limits specified
are applied to the aggregate of all traffic to/from all guest
interfaces attached to that network, <b>not</b> to each guest
- interface individually. Setting <code>bandwidth</code> for a
+ interface individually. Setting <code>bandwidth</code> for a
network is supported only for networks with
a <code><forward></code> mode
of <code>route</code>, <code>nat</code>, or no mode at all
- (i.e. an "isolated" network). <code>bandwidth</code> setting
+ (i.e. an "isolated" network). Setting <code>bandwidth</code>
is <b>not</b> supported for forward modes
of <code>bridge</code>, <code>passthrough</code>, <code>private</code>,
or <code>hostdev</code>, and attempts to do this will lead to
- a failure to define the network (or to create a transient
- network).
+ a failure to define the network (or to create a transient network).
</p>
<p>
Incoming and outgoing traffic can be shaped independently. The
- <code>bandwidth</code> element can have at most
- one <code>inbound</code> and at most one <code>outbound</code>
+ <code>bandwidth</code> element can have at most one
+ <code>inbound</code> and at most one <code>outbound</code>
child element. Leaving either of these children elements out
results in no QoS applied for that traffic direction. So,
- when you want to shape only a network's incoming traffic, use
+ when you want to shape only incoming traffic, use
<code>inbound</code> only, and vice versa. Each of these
- elements have one mandatory attribute - <code>average</code>,
- which specifies the desired average bit rate for the interface
- being shaped (in kibibytes/second). There are also two
- optional attributes: <code>peak</code>, which specifies the
- maximum rate at which the bridge can send data (again in
- kibibytes/second), and <code>burst</code> - the amount of
- bytes that can be transmitted in a single burst at
- <code>peak</code> speed (in kibibytes). Accepted values for
- attributes are integer numbers. The allotted bandwidth is
- shared equally between domains connected to the network.
+ elements have one mandatory attribute - <code>average</code> (or
+ <code>floor</code> as described below). The attributes are as follows,
+ where accepted values for each attribute is an integer number.
</p>
+ <dl>
+ <dt><code>average</code></dt>
+ <dd>
+ Specifies the desired average bit rate for the interface
+ being shaped (in kibibytes/second).
+ </dd>
+ <dt><code>peak</code></dt>
+ <dd>
+ Optional attribute which specifies the maximum rate at
+ which the bridge can send data (in kibibytes/second).
+ Note the limitation of implementation: this attribute in the
+ <code>outbound</code> element is ignored (as Linux ingress
+ filters don't know it yet).
+ </dd>
+ <dt><code>burst</code></dt>
+ <dd>
+ Optional attribute which specifies the amount of kibibytes that
+ can be transmitted in a single burst at <code>peak</code> speed.
+ </dd>
+ <dt><code>floor</code></dt>
+ <dd>
+ Optional attribute available only for the <code>inbound</code>
+ element. This attribute guarantees minimal throughput for
+ shaped interfaces. This, however, requires that all traffic
+ goes through one point where QoS decisions can take place, hence
+ why this attribute works only for virtual networks for now
+ (that is <code><interface type='network'/></code> with a
+ forward type of route, nat, or no forward at all). Moreover, the
+ virtual network the interface is connected to is required to have
+ at least inbound QoS set (<code>average</code> at least). If
+ using the <code>floor</code> attribute users don't need to specify
+ <code>average</code>. However, <code>peak</code> and
+ <code>burst</code> attributes still require <code>average</code>.
+ Currently, the Linux kernel doesn't allow ingress qdiscs to have
+ any classes therefore <code>floor</code> can be applied only
+ on <code>inbound</code> and not <code>outbound</code>.
+ </dd>
+ </dl>
+
+ <p>
+ Note that a kibibyte is a block of 1024 bytes. Attributes
+ <code>average</code>, <code>peak</code>, and <code>burst</code>
+ are available <span class="since">since 0.9.4</span>, while
+ the <code>floor</code> attribute is only available
+ <span class="since">since 1.0.1</span>.
+ </p>
+
<p>
A <code><portgroup></code> element can also include
a <code><bandwidth></code> element. In that case, the
@@ -561,7 +602,7 @@
network), and each portgroup has a name, as well as various
subelements associated with it. The currently supported
subelements are <code><bandwidth></code>
- (documented <a href="formatdomain.html#elementQoS">here</a>)
+ (described <a href="formatnetwork.html#elementQoS">here</a>)
and <code><virtualport></code>
(documented <a href="formatdomain.html#elementsNICSDirect">here</a>).
If a domain interface definition specifies a portgroup (by
diff --git a/src/util/virnetdevbandwidth.h b/src/util/virnetdevbandwidth.h
index 4606a07..2a22820 100644
--- a/src/util/virnetdevbandwidth.h
+++ b/src/util/virnetdevbandwidth.h
@@ -29,10 +29,10 @@
typedef struct _virNetDevBandwidthRate virNetDevBandwidthRate;
typedef virNetDevBandwidthRate *virNetDevBandwidthRatePtr;
struct _virNetDevBandwidthRate {
- unsigned long long average; /* kbytes/s */
- unsigned long long peak; /* kbytes/s */
- unsigned long long floor; /* kbytes/s */
- unsigned long long burst; /* kbytes */
+ unsigned long long average; /* kibibytes/s */
+ unsigned long long peak; /* kibibytes/s */
+ unsigned long long floor; /* kibibytes/s */
+ unsigned long long burst; /* kibibytes */
};
typedef struct _virNetDevBandwidth virNetDevBandwidth;
diff --git a/tools/virsh.pod b/tools/virsh.pod
index f221475..2cf58a6 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -680,7 +680,11 @@ or the MAC address.
If no I<--inbound> or I<--outbound> is specified, this command will
query and show the bandwidth settings. Otherwise, it will set the
inbound or outbound bandwidth. I<average,peak,burst> is the same as
-in command I<attach-interface>.
+in command I<attach-interface>. Values for I<average>, I<peak>, and
+I<burst> are expressed in kibibytes (blocks of 1024 bytes) as described
+in the Network XML documentation at
+L<http://libvirt.org/formatnetwork.html#elementQoS>.
+
If I<--live> is specified, affect a running guest.
If I<--config> is specified, affect the next boot of a persistent guest.
@@ -2019,7 +2023,9 @@ of the network interface. I<script> allows to specify a path to a script
handling a bridge instead of the default one. I<model> allows to specify the
model type. I<inbound> and I<outbound> control the bandwidth of the interface.
I<peak> and I<burst> are optional, so "average,peak", "average,,burst" and
-"average" are also legal.
+"average" are also legal. Values for I<average>, I<peak>, and I<burst> are
+expressed in kibibytes (blocks of 1024 bytes) as described in the Network
+XML documentation at L<http://libvirt.org/formatnetwork.html#elementQoS>.
If I<--live> is specified, affect a running domain.
If I<--config> is specified, affect the next startup of a persistent domain.
--
1.8.4.2
11 years, 3 months
[libvirt] [PATCHv2] spec: add missing dep of libvirt-daemon-config-network
by Eric Blake
From: Thierry Parmentelat <thierry.parmentelat(a)inria.fr>
When building modules, libvirt-daemon-config-network requires
libvirt-daemon-driver-network to ensure the 'default' network
is setup properly
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
v2: make dep dependent on whether subpackage is created
libvirt.spec.in | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index 4d804e6..d3e6048 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -720,6 +720,9 @@ Summary: Default configuration files for the libvirtd daemon
Group: Development/Libraries
Requires: libvirt-daemon = %{version}-%{release}
+ %if %{with_driver_modules}
+Requires: libvirt-daemon-driver-network = %{version}-%{release}
+ %endif
%description daemon-config-network
Default configuration files for setting up NAT based networking
--
1.8.5.3
11 years, 3 months
[libvirt] libvirt default network
by Thierry Parmentelat
Hi
This is in echo to a message originally sent on libvirt-users, but having not received any answer yet so we figured we would try this list instead
So, we use libvirt on various flavours of fedora; with fedora18 we were using libvirt-1.0.4, that we rebuilt using a slightly modified version of mainstream specfile
Under fedora20 we’ve first tried using the libvirt version that comes with vanilla fedora - 1.1.3 - but are seeing glitches that apparently are fixed in 1.2.1, so we’re giving this a shot
The problem we have is, right after installation of our libvirt rpm, the ‘default’ network is not known to the system:
[root@vnode07 ~]# virsh -c lxc:// net-dumpxml default
error: failed to get network 'default'
error: Network not found: no network with matching name ‘default'
While the ‘source’ file for this default network did ship with the rpm
[root@vnode07 ~]# rpm -qf /usr/share/libvirt/networks/default.xml
libvirt-daemon-driver-network-1.2.1-0.x86_64
------------
What we used to have with 1.0.4 and 1.1.3 at that same point (right after yum install) is
[root@vnode05 ~]# virsh -c lxc:// net-dumpxml default
<network connections='1510’>
..
</network>
—
So, I’m confident we can tweak our specfile to get this to work by adding something like net-define / net-autostart / net-start somewhere near the post install script of the daemon package or something
However we would appreciate some insight as to how this would happen in the first place; is this an intentional change on your end ?
or did we screw that up somehow ? if so, I could not find out precisely how this network definition is supposed to take place when the package gets installed, any hint / insight on that would be much appreciated
Thanks in advance
11 years, 3 months
Re: [libvirt] [libvirt-users] Help? Running into problems with migrateToURI2() and virDomainDefCheckABIStability()
by Cole Robinson
On 02/12/2014 01:03 PM, Chris Friesen wrote:
> On 02/11/2014 04:45 PM, Cole Robinson wrote:
>> On 02/10/2014 06:46 PM, Chris Friesen wrote:
>>> Hi,
>>>
>>> We've run into a problem with libvirt 1.1.2 and are looking for some comments
>>> on whether this is a bug or design intent.
>>>
>>> We're trying to use migrateToURI() but we're using a few things (numatune,
>>> vcpu mask, etc.) that may need adjustment during the migration. We found that
>>> migrateToURI2() mostly works if we use XML created by copying the domain XML
>>> from the running instance and modifying the appropriate sections.
>>>
>>> The problem that we're seeing is that the serial console checking in
>>> libvirt/src/conf/domain_conf.c::virDomainDefCheckABIStability() is failing
>>> even though we haven't touched the serial console XML:
>
>> I think we will have to see the XML your passing before and after edit to
>> figure out what's going wrong. Also, showing all the arguments you are
>> invoking the migration APIs with.
>
>
> Okay, this is going to be a long message. :)
>
> We're calling it as:
>
> dom.migrateToURI2(duri, muri, xml_str, logical_sum, None, CONF.live_migration_bandwidth)
>
> Here are the supplied arguments:
> duri = u'qemu+tcp://compute-0/system'
> muri = u'tcp://compute-0'
> flaglist = ['VIR_MIGRATE_UNDEFINE_SOURCE', 'VIR_MIGRATE_PEER2PEER', 'VIR_MIGRATE_LIVE']
> logical_sum = 19, (logical OR of flaglist)
> CONF.live_migration_bandwidth = 0
>
> Grabbing original XML prior to migration:
>
> dom_xml = etree.fromstring(dom.XMLDesc(0))
> xml_str = etree.tostring(dom_xml)
>
> xml_str (BEFORE) =
> <domain type="qemu" id="2">
> <name>instance-00000006</name>
> <uuid>2e13869b-edc0-40dc-92e3-1f2ffde60cce</uuid>
> <dpdk>
> <process type="secondary"/>
> <file prefix="vs"/>
> <cpu list="0"/>
> <memory channels="4"/>
> </dpdk>
> <memory unit="KiB">262144</memory>
> <currentMemory unit="KiB">262144</currentMemory>
> <memoryBacking>
> <hugepages/>
> </memoryBacking>
> <vcpu placement="static" cpuset="1-2">2</vcpu>
> <cputune>
> <vcpupin vcpu="0" cpuset="1"/>
> <vcpupin vcpu="1" cpuset="2"/>
> <emulatorpin cpuset="1-2"/>
> </cputune>
> <numatune>
> <memory mode="preferred" nodeset="0"/>
> </numatune>
> <sysinfo type="smbios">
> <system>
> <entry name="manufacturer">OpenStack Foundation</entry>
> <entry name="product">OpenStack Nova</entry>
> <entry name="version">2013.2.2</entry>
> <entry name="serial">771a1b10-d2f7-4ebb-b21e-4040560732f5</entry>
> <entry name="uuid">2e13869b-edc0-40dc-92e3-1f2ffde60cce</entry>
> </system>
> </sysinfo>
> <os>
> <type arch="x86_64" machine="pc-i440fx-1.4">hvm</type>
> <boot dev="hd"/>
> <smbios mode="sysinfo"/>
> </os>
> <features>
> <acpi/>
> <apic/>
> </features>
> <clock offset="utc"/>
> <on_poweroff>destroy</on_poweroff>
> <on_reboot>restart</on_reboot>
> <on_crash>destroy</on_crash>
> <devices>
> <emulator>/usr/bin/qemu-system-x86_64</emulator>
> <disk type="file" device="disk">
> <driver name="qemu" type="qcow2" cache="none"/>
> <source file="/etc/nova/instances/2e13869b-edc0-40dc-92e3-1f2ffde60cce/disk"/>
> <target dev="vda" bus="virtio"/>
> <alias name="virtio-disk0"/>
> <address type="pci" domain="0x0000" bus="0x00" slot="0x05" function="0x0"/>
> </disk>
> <controller type="usb" index="0">
> <alias name="usb0"/>
> <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x2"/>
> </controller>
> <controller type="pci" index="0" model="pci-root">
> <alias name="pci.0"/>
> </controller>
> <interface type="vswitch">
> <mac address="fa:16:3e:fb:34:6b"/>
> <source network="4db95d31-64f1-4f10-9138-5fe68c0d77ac"/>
> <target dev="7bc76b0e-b12a-4153-8ce8-d3d145c51e6f"/>
> <model type="e1000"/>
> <alias name="net0"/>
> <address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x0"/>
> </interface>
> <interface type="vswitch">
> <mac address="fa:16:3e:d5:b9:50"/>
> <source network="8512742c-af3e-4787-b2d8-b0b9ab160297"/>
> <target dev="33ab1061-7fa4-4250-99a4-dd7eb4029aa1"/>
> <model type="e1000"/>
> <alias name="net1"/>
> <address type="pci" domain="0x0000" bus="0x00" slot="0x04" function="0x0"/>
> </interface>
> <serial type="file">
> <source path="/etc/nova/instances/2e13869b-edc0-40dc-92e3-1f2ffde60cce/console.log"/>
> <target port="0"/>
> <alias name="serial0"/>
> </serial>
> <serial type="pty">
> <source path="/dev/pts/1"/>
> <target port="1"/>
> <alias name="serial1"/>
> </serial>
> <console type="file">
> <source path="/etc/nova/instances/2e13869b-edc0-40dc-92e3-1f2ffde60cce/console.log"/>
> <target type="serial" port="0"/>
> <alias name="serial0"/>
> </console>
> <input type="tablet" bus="usb">
> <alias name="input0"/>
> </input>
> <input type="mouse" bus="ps2"/>
> <graphics type="vnc" port="5900" autoport="yes" listen="0.0.0.0" keymap="en-us">
> <listen type="address" address="0.0.0.0"/>
> </graphics>
> <video>
> <model type="cirrus" vram="9216" heads="1"/>
> <alias name="video0"/>
> <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x0"/>
> </video>
> <memballoon model="virtio">
> <alias name="balloon0"/>
> <address type="pci" domain="0x0000" bus="0x00" slot="0x06" function="0x0"/>
> </memballoon>
> </devices>
> <seclabel type="none"/>
> </domain>
>
>
>
> This is the modified XML, specifically updating vcpu, cputune, numatune.
> In this case they actually have the same values as above but there are
> whitespace differences:
>
>
> xml_str (MODIFIED) =
> <domain type="qemu" id="2">
> <name>instance-00000006</name>
> <uuid>2e13869b-edc0-40dc-92e3-1f2ffde60cce</uuid>
> <dpdk>
> <process type="secondary"/>
> <file prefix="vs"/>
> <cpu list="0"/>
> <memory channels="4"/>
> </dpdk>
> <memory unit="KiB">262144</memory>
> <currentMemory unit="KiB">262144</currentMemory>
> <memoryBacking>
> <hugepages/>
> </memoryBacking>
> <vcpu placement="static" cpuset="1,2">2</vcpu>
> <cputune>
> <vcpupin vcpu="0" cpuset="1"/><vcpupin vcpu="1" cpuset="2"/><emulatorpin cpuset="1,2"/></cputune>
> <numatune>
> <memory mode="preferred" nodeset="0"/></numatune>
> <sysinfo type="smbios">
> <system>
> <entry name="manufacturer">OpenStack Foundation</entry>
> <entry name="product">OpenStack Nova</entry>
> <entry name="version">2013.2.2</entry>
> <entry name="serial">771a1b10-d2f7-4ebb-b21e-4040560732f5</entry>
> <entry name="uuid">2e13869b-edc0-40dc-92e3-1f2ffde60cce</entry>
> </system>
> </sysinfo>
> <os>
> <type arch="x86_64" machine="pc-i440fx-1.4">hvm</type>
> <boot dev="hd"/>
> <smbios mode="sysinfo"/>
> </os>
> <features>
> <acpi/>
> <apic/>
> </features>
> <clock offset="utc"/>
> <on_poweroff>destroy</on_poweroff>
> <on_reboot>restart</on_reboot>
> <on_crash>destroy</on_crash>
> <devices>
> <emulator>/usr/bin/qemu-system-x86_64</emulator>
> <disk type="file" device="disk">
> <driver name="qemu" type="qcow2" cache="none"/>
> <source file="/etc/nova/instances/2e13869b-edc0-40dc-92e3-1f2ffde60cce/disk"/>
> <target dev="vda" bus="virtio"/>
> <alias name="virtio-disk0"/>
> <address type="pci" domain="0x0000" bus="0x00" slot="0x05" function="0x0"/>
> </disk>
> <controller type="usb" index="0">
> <alias name="usb0"/>
> <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x2"/>
> </controller>
> <controller type="pci" index="0" model="pci-root">
> <alias name="pci.0"/>
> </controller>
> <interface type="vswitch">
> <mac address="fa:16:3e:fb:34:6b"/>
> <source network="4db95d31-64f1-4f10-9138-5fe68c0d77ac"/>
> <target dev="7bc76b0e-b12a-4153-8ce8-d3d145c51e6f"/>
> <model type="e1000"/>
> <alias name="net0"/>
> <address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x0"/>
> </interface>
> <interface type="vswitch">
> <mac address="fa:16:3e:d5:b9:50"/>
> <source network="8512742c-af3e-4787-b2d8-b0b9ab160297"/>
> <target dev="33ab1061-7fa4-4250-99a4-dd7eb4029aa1"/>
> <model type="e1000"/>
> <alias name="net1"/>
> <address type="pci" domain="0x0000" bus="0x00" slot="0x04" function="0x0"/>
> </interface>
> <serial type="file">
> <source path="/etc/nova/instances/2e13869b-edc0-40dc-92e3-1f2ffde60cce/console.log"/>
> <target port="0"/>
> <alias name="serial0"/>
> </serial>
> <serial type="pty">
> <source path="/dev/pts/1"/>
> <target port="1"/>
> <alias name="serial1"/>
> </serial>
> <console type="file">
> <source path="/etc/nova/instances/2e13869b-edc0-40dc-92e3-1f2ffde60cce/console.log"/>
> <target type="serial" port="0"/>
> <alias name="serial0"/>
> </console>
> <input type="tablet" bus="usb">
> <alias name="input0"/>
> </input>
> <input type="mouse" bus="ps2"/>
> <graphics type="vnc" port="5900" autoport="yes" listen="0.0.0.0" keymap="en-us">
> <listen type="address" address="0.0.0.0"/>
> </graphics>
> <video>
> <model type="cirrus" vram="9216" heads="1"/>
> <alias name="video0"/>
> <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x0"/>
> </video>
> <memballoon model="virtio">
> <alias name="balloon0"/>
> <address type="pci" domain="0x0000" bus="0x00" slot="0x06" function="0x0"/>
> </memballoon>
> </devices>
> <seclabel type="none"/>
> </domain>
>
>
>
> Calling migrateToURI2 then gives the following error :
> 2014-02-12 03:37:17.738 1251 ERROR nova.virt.libvirt.driver [-] [instance: 2e13869b-edc0-40dc-92e3-1f2ffde60cce] Live Migration failure: unsupported configuration: Target domain console count 1 does not match source 0
>
>
> If we remove the this section :
> <serial type="pty">
> <source path="/dev/pts/1"/>
> <target port="1"/>
> <alias name="serial1"/>
> </serial>
>
> Then we get the following error :
> 2014-02-12 04:19:12.689 1278 ERROR nova.virt.libvirt.driver [-] [instance: 90335c32-a7ae-4c99-8e5a-cd177f6b3c22] Live Migration failure: unsupported configuration: Target domain serial port count 1 does not match source 2
>
> If we remove just the following line:
> <source path="/dev/pts/1"/>
>
> so the modified portion looks like this,
> <serial type="file">
> <source path="/etc/nova/instances/00b99f94-436e-406b-8459-83e77758f154/console.log"/>
> <target port="0"/>
> <alias name="serial0"/>
> </serial>
> <serial type="pty">
> <target port="1"/>
> <alias name="serial1"/>
> </serial>
> <console type="file">
> <source path="/etc/nova/instances/00b99f94-436e-406b-8459-83e77758f154/console.log"/>
> <target type="serial" port="0"/>
> <alias name="serial0"/>
> </console>
> <input type="tablet" bus="usb">
>
> Then we get this error :
>
> 2014-02-12 04:29:06.402 5175 ERROR nova.virt.libvirt.driver [-] [instance: 00b99f94-436e-406b-8459-83e77758f154] Live Migration failure: unsupported configuration: Target domain console count 1 does not match source 0
>
> If we modify it with empty <serial type='pty'> element like this:
>
> <serial type="file">
> <source path="/etc/nova/instances/b1103349-8c9f-4315-9144-03fc22f09be1/console.log"/>
> <target port="0"/>
> <alias name="serial0"/>
> </serial>
> <serial type="pty">
> </serial>
> <console type="file">
> <source path="/etc/nova/instances/b1103349-8c9f-4315-9144-03fc22f09be1/console.log"/>
> <target type="serial" port="0"/>
> <alias name="serial0"/>
> </console>
>
> Then we get this error:
>
> 2014-02-12 04:36:45.686 5358 ERROR nova.virt.libvirt.driver [-] [instance: b1103349-8c9f-4315-9144-03fc22f09be1] Live Migration failure: unsupported configuration: Target domain console count 1 does not match source 0
>
> If we modify it with empty <serial type='pty'> element and also remove
> <console type='file'> section completely like this :
>
> <serial type="file">
> <source path="/etc/nova/instances/8cccb4ad-2abc-4513-b8fd-bfb811301677/console.log"/>
> <target port="0"/>
> <alias name="serial0"/>
> </serial>
> <serial type="pty">
> </serial>
>
> Then this successfully migrates!
>
> However, it then fails on subsequent migration back to the original host. Prior to migrating
> back the domain XML serial/console section looks like:
>
> <serial type="file">
> <source path="/etc/nova/instances/8cccb4ad-2abc-4513-b8fd-bfb811301677/console.log"/>
> <target port="0"/>
> <alias name="serial0"/>
> </serial>
> <serial type="pty">
> <source path="/dev/pts/1"/>
> <target port="1"/>
> <alias name="serial1"/>
> </serial>
> <console type="file">
> <source path="/etc/nova/instances/8cccb4ad-2abc-4513-b8fd-bfb811301677/console.log"/>
> <target type="serial" port="0"/>
> <alias name="serial0"/>
> </console>
>
> After modifying empty <serial type='pty'> element and removing the <console type='file'> section
> it looks like this :
>
> <serial type="file">
> <source path="/etc/nova/instances/8cccb4ad-2abc-4513-b8fd-bfb811301677/console.log"/>
> <target port="0"/>
> <alias name="serial0"/>
> </serial>
> <serial type="pty">
> </serial>
>
> But this give the following error when migrating back:
>
> 2014-02-12 06:00:19.831 7125 ERROR nova.virt.libvirt.driver [-] [instance: 8cccb4ad-2abc-4513-b8fd-bfb811301677] Live Migration failure: unsupported configuration: Target domain console count 0 does not match source 1
>
Thanks for the detailed info. Can you put that into an upstream libvirt bug
report? http://libvirt.org/bugs.html
Does this sound familiar to any other libvirt devs?
- Cole
11 years, 3 months
[libvirt] [PATCHv2 0/6] server-side domain event filtering
by Eric Blake
v1 was here: https://www.redhat.com/archives/libvir-list/2014-January/msg00689.html
Since then, I've rebased it on top of this patch which still
needs review: https://www.redhat.com/archives/libvir-list/2014-January/msg01406.html
as well as added patch 6 so that we don't have to repeat the
exercise of adding a new RPC down the road.
Eric Blake (6):
event: dynamically manage server-side RPC domain events
event: server RPC protocol tweaks for domain lifecycle events
event: prepare client to track domain callbackID
event: client RPC protocol tweaks for domain lifecycle events
event: convert remaining domain events to new style
event: pass reason for PM events
daemon/libvirtd.h | 3 +-
daemon/remote.c | 665 ++++++++++++++++++++++++++-------
src/conf/domain_event.c | 184 ++++++++--
src/conf/domain_event.h | 28 +-
src/conf/network_event.c | 6 +-
src/conf/object_event.c | 35 +-
src/conf/object_event_private.h | 6 +-
src/libvirt_internal.h | 7 +-
src/remote/remote_driver.c | 796 ++++++++++++++++++++++++++++++++--------
src/remote/remote_protocol.x | 195 +++++++++-
src/remote_protocol-structs | 95 +++++
11 files changed, 1679 insertions(+), 341 deletions(-)
--
1.8.5.3
11 years, 3 months
[libvirt] [PATCH] Fixed build with clang.
by Cédric Bosdonnat
Two unused global variables, and DBUS_TYPE_INVALID used as a const
char*.
---
src/phyp/phyp_driver.c | 1 -
src/storage/storage_backend_scsi.c | 24 ------------------------
src/util/virdbus.c | 2 +-
3 files changed, 1 insertion(+), 26 deletions(-)
diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c
index 20b5bd4..9adb6b0 100644
--- a/src/phyp/phyp_driver.c
+++ b/src/phyp/phyp_driver.c
@@ -66,7 +66,6 @@
* */
static unsigned const int HMC = 0;
-static unsigned const int IVM = 127;
static unsigned const int PHYP_IFACENAME_SIZE = 24;
static unsigned const int PHYP_MAC_SIZE = 12;
diff --git a/src/storage/storage_backend_scsi.c b/src/storage/storage_backend_scsi.c
index b38e530..44f17c9 100644
--- a/src/storage/storage_backend_scsi.c
+++ b/src/storage/storage_backend_scsi.c
@@ -107,30 +107,6 @@ struct diskType {
unsigned long long magic;
};
-static struct diskType const disk_types[] = {
- { VIR_STORAGE_POOL_DISK_LVM2, 0x218, 8, 0x31303020324D564CULL },
- { VIR_STORAGE_POOL_DISK_GPT, 0x200, 8, 0x5452415020494645ULL },
- { VIR_STORAGE_POOL_DISK_DVH, 0x0, 4, 0x41A9E50BULL },
- { VIR_STORAGE_POOL_DISK_MAC, 0x0, 2, 0x5245ULL },
- { VIR_STORAGE_POOL_DISK_BSD, 0x40, 4, 0x82564557ULL },
- { VIR_STORAGE_POOL_DISK_SUN, 0x1fc, 2, 0xBEDAULL },
- /*
- * NOTE: pc98 is funky; the actual signature is 0x55AA (just like dos), so
- * we can't use that. At the moment I'm relying on the "dummy" IPL
- * bootloader data that comes from parted. Luckily, the chances of running
- * into a pc98 machine running libvirt are approximately nil.
- */
- /*{ 0x1fe, 2, 0xAA55UL },*/
- { VIR_STORAGE_POOL_DISK_PC98, 0x0, 8, 0x314C5049000000CBULL },
- /*
- * NOTE: the order is important here; some other disk types (like GPT and
- * and PC98) also have 0x55AA at this offset. For that reason, the DOS
- * one must be the last one.
- */
- { VIR_STORAGE_POOL_DISK_DOS, 0x1fe, 2, 0xAA55ULL },
- { -1, 0x0, 0, 0x0ULL },
-};
-
static int
virStorageBackendSCSIUpdateVolTargetInfo(virStorageVolTargetPtr target,
unsigned long long *allocation,
diff --git a/src/util/virdbus.c b/src/util/virdbus.c
index a0cbbfe..a6232b7 100644
--- a/src/util/virdbus.c
+++ b/src/util/virdbus.c
@@ -1281,7 +1281,7 @@ int virDBusIsServiceEnabled(const char *name)
"/org/freedesktop/DBus",
"org.freedesktop.DBus",
"ListActivatableNames",
- DBUS_TYPE_INVALID) < 0)
+ NULL) < 0)
return ret;
if (!dbus_message_iter_init(reply, &iter) ||
--
1.8.5.2
11 years, 3 months
[libvirt] [PATCH] storage: handle NULL return from virGetStorageVol
by Michael Chapman
virGetStorageVol can return NULL on out-of-memory. If it does, cleanly
abort the volume clone operation.
Signed-off-by: Michael Chapman <mike(a)very.puzzling.org>
---
src/storage/storage_driver.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c
index c83aa8a..2f7b2e5 100644
--- a/src/storage/storage_driver.c
+++ b/src/storage/storage_driver.c
@@ -1828,6 +1828,10 @@ storageVolCreateXMLFrom(virStoragePoolPtr obj,
pool->volumes.objs[pool->volumes.count++] = newvol;
volobj = virGetStorageVol(obj->conn, pool->def->name, newvol->name,
newvol->key, NULL, NULL);
+ if (!volobj) {
+ pool->volumes.count--;
+ goto cleanup;
+ }
/* Drop the pool lock during volume allocation */
pool->asyncjobs++;
--
1.8.3.1
11 years, 3 months
[libvirt] [PATCH 0/2] Partially revert separation of volume creating and building
by Ján Tomko
The storage driver expects 'createVol' to fill out the volume key.
For disk and logical backends, we generate the key only after the volume
has been built. Revert the separation commits for these backends.
Ján Tomko (2):
Revert "storage: lvm: Separate creating of the volume from building"
Revert "storage: disk: Separate creating of the volume from building"
src/storage/storage_backend_disk.c | 44 ++++++++-----------------
src/storage/storage_backend_logical.c | 60 ++++++++++++++---------------------
2 files changed, 37 insertions(+), 67 deletions(-)
--
1.8.3.2
11 years, 3 months
[libvirt] [PATCH] Fix leaks in vircapstest
by Ján Tomko
Coverity complains about cell_cpus being leaked on error
and valgrind shows 'caps' is leaked on success.
Introduced in eb64e87.
---
tests/vircapstest.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/tests/vircapstest.c b/tests/vircapstest.c
index a40771d..4264e9e 100644
--- a/tests/vircapstest.c
+++ b/tests/vircapstest.c
@@ -40,7 +40,7 @@ static virCapsPtr
buildNUMATopology(int seq)
{
virCapsPtr caps;
- virCapsHostNUMACellCPUPtr cell_cpus;
+ virCapsHostNUMACellCPUPtr cell_cpus = NULL;
int core_id, cell_id;
int id;
@@ -75,6 +75,8 @@ buildNUMATopology(int seq)
return caps;
error:
+ virCapabilitiesClearHostNUMACellCPUTopology(cell_cpus, MAX_CPUS_IN_CELL);
+ VIR_FREE(cell_cpus);
virObjectUnref(caps);
return NULL;
@@ -87,7 +89,7 @@ test_virCapabilitiesGetCpusForNodemask(const void *data ATTRIBUTE_UNUSED)
const char *nodestr = "3,4,5,6";
virBitmapPtr nodemask = NULL;
virBitmapPtr cpumap = NULL;
- virCapsPtr caps;
+ virCapsPtr caps = NULL;
int mask_size = 8;
int ret = -1;
@@ -107,6 +109,7 @@ test_virCapabilitiesGetCpusForNodemask(const void *data ATTRIBUTE_UNUSED)
ret = 0;
error:
+ virObjectUnref(caps);
virBitmapFree(nodemask);
virBitmapFree(cpumap);
return ret;
--
1.8.3.2
11 years, 3 months
[libvirt] [PATCH] AppArmor: Fix the place where the template should be installed
by Cédric Bosdonnat
The security driver expects /etc/apparmor.d/libvirt/TEMPLATE but we
installed it to /etc/apparmor.d/libvirtd/TEMPLATE. Move the template to
the expected place since that code was here long before.
---
examples/apparmor/Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/examples/apparmor/Makefile.am b/examples/apparmor/Makefile.am
index 6e69440..2630fef 100644
--- a/examples/apparmor/Makefile.am
+++ b/examples/apparmor/Makefile.am
@@ -32,7 +32,7 @@ abstractions_DATA = \
libvirt-qemu \
$(NULL)
-templatesdir = $(apparmordir)/libvirtd
+templatesdir = $(apparmordir)/libvirt
templates_DATA = \
TEMPLATE \
$(NULL)
--
1.8.5.2
11 years, 3 months