[libvirt] [PATCH] Add vircgroupdata dir to tests/Makefile.am
by Nehal J Wani
The folder vircgroupdata was introduced in commit 2dbfa716 as part of
the test suite for virCgroupDetectMounts
---
tests/Makefile.am | 1 +
1 file changed, 1 insertion(+)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 9277c13..27cee63 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -128,6 +128,7 @@ EXTRA_DIST = \
storagevolxml2xmlout \
sysinfodata \
test-lib.sh \
+ vircgroupdata \
vircaps2xmldata \
vboxsnapshotxmldata \
virsh-uriprecedence \
--
2.1.0
9 years, 8 months
[libvirt] [PATCH v3 4/4] migration: Expose 'cancelling' status to user
by zhanghailiang
'cancelling' status is introduced by commit 51cf4c1a, which is mainly avoid
possible starting a new migration process while the previous one still exist.
But we don't expose this status to user, instead by return a 'active' state.
Here, we expose it to the user (such as libvirt), 'cancelling' status only
occurs for a short window before the migration aborts, so for users,
if they cancell a migration process, it will observe 'cancelling' status
occasionally.
Signed-off-by: zhanghailiang <zhang.zhanghailiang(a)huawei.com>
Cc: libvir-list(a)redhat.com
---
migration/migration.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/migration/migration.c b/migration/migration.c
index 035e005..a57928d 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -179,13 +179,11 @@ MigrationInfo *qmp_query_migrate(Error **errp)
break;
case MIGRATION_STATUS_SETUP:
info->has_status = true;
- info->status = MIGRATION_STATUS_SETUP;
info->has_total_time = false;
break;
case MIGRATION_STATUS_ACTIVE:
case MIGRATION_STATUS_CANCELLING:
info->has_status = true;
- info->status = MIGRATION_STATUS_ACTIVE;
info->has_total_time = true;
info->total_time = qemu_clock_get_ms(QEMU_CLOCK_REALTIME)
- s->total_time;
@@ -221,7 +219,6 @@ MigrationInfo *qmp_query_migrate(Error **errp)
get_xbzrle_cache_stats(info);
info->has_status = true;
- info->status = MIGRATION_STATUS_COMPLETED;
info->has_total_time = true;
info->total_time = s->total_time;
info->has_downtime = true;
@@ -243,13 +240,12 @@ MigrationInfo *qmp_query_migrate(Error **errp)
break;
case MIGRATION_STATUS_FAILED:
info->has_status = true;
- info->status = MIGRATION_STATUS_FAILED;
break;
case MIGRATION_STATUS_CANCELLED:
info->has_status = true;
- info->status = MIGRATION_STATUS_CANCELLED;
break;
}
+ info->status = s->state;
return info;
}
--
1.7.12.4
9 years, 8 months
[libvirt] [PATCH] util: more verbose error when failing to create macvtap device
by Laine Stump
Investigation of a problem with creating passthrough macvtap devices
(https://bugzilla.redhat.com/show_bug.cgi?id=1185501) has shown that
this slightly more verbose failure message is useful. In particular,
the mac address can be used to determine the domain. You could also
figure this out by looking at preceding messages in a debug log, but
this gets it in a single place.
---
src/util/virnetdevmacvlan.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/util/virnetdevmacvlan.c b/src/util/virnetdevmacvlan.c
index dd66955..5fd2097 100644
--- a/src/util/virnetdevmacvlan.c
+++ b/src/util/virnetdevmacvlan.c
@@ -107,6 +107,7 @@ virNetDevMacVLanCreate(const char *ifname,
unsigned int recvbuflen;
struct nl_msg *nl_msg;
struct nlattr *linkinfo, *info_data;
+ char macstr[VIR_MAC_STRING_BUFLEN];
if (virNetDevGetIndex(srcdev, &ifindex) < 0)
return -1;
@@ -177,8 +178,9 @@ virNetDevMacVLanCreate(const char *ifname,
default:
virReportSystemError(-err->error,
- _("error creating %s type of interface attach to %s"),
- type, srcdev);
+ _("error creating %s interface %s@%s (%s)"),
+ type, ifname, srcdev,
+ virMacAddrFormat(macaddress, macstr));
goto cleanup;
}
break;
--
2.1.0
9 years, 8 months
[libvirt] [PATCH v4 0/7] bridge network support enhancement and other network fixes
by Maxim Nestratov
v2-v4 change:
Addressed Michal Privoznik's comments
Maxim Nestratov (7):
parallels: introduce and use string constants for network types and
names
parallels: fix parallelsLoadNetworks
parallels: better bridge network interface support
parallels: set correct network adapter device state
parallels: make E1000 network adapter model default
parallels: switch off offline management feature
parallels: don't prevent domain define if VIR_DOMAIN_NET_TYPE_BRIDGE
9 years, 8 months
[libvirt] [PATCH] util: vhost user: support for bootindex
by zhang bo
Problem Description:
When we set boot order for a vhost-user network interface, we found the boot index
doesn't work.
Cause of the Problem:
In the function qemuBuildVhostuserCommandLine(), it forcely set the arg bootindex of
function qemuBuildNicDevStr() to 0. Thus, the bootindex parameter got missing.
Solution:
Trans the arg bootindex down.
Signed-off-by: Gao Haifeng <gaohaifeng.gao(a)huawei.com>
Signed-off-by: Zhang Bo <oscar.zhangbo(a)huawei.com>
---
src/qemu/qemu_command.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 5303de5..2f37812 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -7767,7 +7767,8 @@ static int
qemuBuildVhostuserCommandLine(virCommandPtr cmd,
virDomainDefPtr def,
virDomainNetDefPtr net,
- virQEMUCapsPtr qemuCaps)
+ virQEMUCapsPtr qemuCaps,
+ int bootindex)
{
virBuffer chardev_buf = VIR_BUFFER_INITIALIZER;
virBuffer netdev_buf = VIR_BUFFER_INITIALIZER;
@@ -7814,7 +7815,7 @@ qemuBuildVhostuserCommandLine(virCommandPtr cmd,
virCommandAddArg(cmd, "-netdev");
virCommandAddArgBuffer(cmd, &netdev_buf);
- if (!(nic = qemuBuildNicDevStr(def, net, -1, 0, 0, qemuCaps))) {
+ if (!(nic = qemuBuildNicDevStr(def, net, -1, bootindex, 0, qemuCaps))) {
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("Error generating NIC -device string"));
goto error;
@@ -7859,8 +7860,12 @@ qemuBuildInterfaceCommandLine(virCommandPtr cmd,
virNetDevBandwidthPtr actualBandwidth;
size_t i;
+
+ if (!bootindex)
+ bootindex = net->info.bootIndex;
+
if (actualType == VIR_DOMAIN_NET_TYPE_VHOSTUSER)
- return qemuBuildVhostuserCommandLine(cmd, def, net, qemuCaps);
+ return qemuBuildVhostuserCommandLine(cmd, def, net, qemuCaps, bootindex);
if (actualType == VIR_DOMAIN_NET_TYPE_HOSTDEV) {
/* NET_TYPE_HOSTDEV devices are really hostdev devices, so
@@ -7869,9 +7874,6 @@ qemuBuildInterfaceCommandLine(virCommandPtr cmd,
return 0;
}
- if (!bootindex)
- bootindex = net->info.bootIndex;
-
/* Currently nothing besides TAP devices supports multiqueue. */
if (net->driver.virtio.queues > 0 &&
!(actualType == VIR_DOMAIN_NET_TYPE_NETWORK ||
--
1.7.12.4
9 years, 8 months
[libvirt] Domain XML isn't dumping full backing chain
by Deepak Shetty
Hi,
I am using libvirt version 1.2.9.2 on F21 and i am unable to get the
complete backing chain info in the virsh dumpxml output. Details below :
*My backing chain per qemu-img :*
[stack@devstack-f21 test]$ qemu-img info --backing-chain snap4.qcow2
image: snap4.qcow2
file format: qcow2
virtual size: 1.0G (1073741824 bytes)
disk size: 196K
cluster_size: 65536
backing file: ./snap3.qcow2
Format specific information:
compat: 1.1
lazy refcounts: false
image: ./snap3.qcow2
file format: qcow2
virtual size: 1.0G (1073741824 bytes)
disk size: 196K
cluster_size: 65536
backing file: ./snap2.qcow2 (actual path: ././snap2.qcow2)
Format specific information:
compat: 1.1
lazy refcounts: false
image: ././snap2.qcow2
file format: qcow2
virtual size: 1.0G (1073741824 bytes)
disk size: 196K
cluster_size: 65536
backing file: ./snap1.qcow2 (actual path: ./././snap1.qcow2)
Format specific information:
compat: 1.1
lazy refcounts: false
image: ./././snap1.qcow2
file format: qcow2
virtual size: 1.0G (1073741824 bytes)
disk size: 196K
cluster_size: 65536
backing file: ./base.qcow2 (actual path: ././././base.qcow2)
Format specific information:
compat: 1.1
lazy refcounts: false
image: ././././base.qcow2
file format: qcow2
virtual size: 1.0G (1073741824 bytes)
disk size: 196K
cluster_size: 65536
Format specific information:
compat: 1.1
lazy refcounts: false
I created 4 snapshots using commands (similar to the below, just dumping
the last one here ):
[stack@devstack-f21 test]$ virsh snapshot-create-as test-domain
on-test-snap4 --disk-only --reuse-external --diskspec
hda,snapshot=external,file=/home/stack/test/snap4.qcow2
Domain snapshot on-test-snap4 created
[stack@devstack-f21 test]$ virsh domblklist test-domain
Target Source
------------------------------------------------
hda /home/stack/test/snap4.qcow2
virsh dumpxml test-domain|more
....
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2' cache='none'/>
<source file='/home/stack/test/snap4.qcow2'/>
<backingStore type='file' index='1'>
<format type='raw'/>
<source file='/home/stack/test/./snap3.qcow2'/>
<backingStore/>
</backingStore>
<target dev='hda' bus='ide'/>
<alias name='ide0-0-0'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
.....
I think thats happening beccause the backingStore format is coming as 'raw'
What am i missing ?
thanx,
deepak
9 years, 8 months
[libvirt] [PATCH] maint: Distribute tests/vircgroupdata
by Jiri Denemark
My commit 2dbfa71 added test data for vircgrouptest but forgot to
distribute the new directory.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
Pushed as a build-breaker.
tests/Makefile.am | 1 +
1 file changed, 1 insertion(+)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 9277c13..bd2ea16 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -131,6 +131,7 @@ EXTRA_DIST = \
vircaps2xmldata \
vboxsnapshotxmldata \
virsh-uriprecedence \
+ vircgroupdata \
virfiledata \
virpcitestdata \
virscsidata \
--
2.3.3
9 years, 8 months
[libvirt] [PATCH] doc: Fix doc for backingStore
by Deepak Shetty
I spent quite some time figuring that backingStore info
isn't included in the dom xml, unless guest is up and
running. Hopefully putting that in the doc should help.
This patch adds that info to the doc.
Signed-off-by: Deepak C Shetty <deepakcs(a)redhat.com>
---
docs/formatdomain.html.in | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index ab51982..dfd4f3a 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -2113,7 +2113,9 @@
and only used for output to describe the detected backing chains.
<span class="since">Since 1.2.4</span>. An empty
<code>backingStore</code> element means the sibling source is
- self-contained and is not based on any backing store. The following
+ self-contained and is not based on any backing store. Note that
+ <code>backingStore</code> info is included in the output only when
+ the guest is up and running, otherwise its not included. The
following
attributes and sub-elements are supported in
<code>backingStore</code>:
<dl>
--
1.9.3
9 years, 8 months
[libvirt] [PATCH v2 0/7] bridge network support enhancement and other network fixes
by Maxim Nestratov
From: Maxim Nestratov <mnestratov(a)parallels.com>
v2 change:
- rebased on recent network rework
Maxim Nestratov (7):
parallels: introduce and use string constants for network types and
names
parallels: fix parallelsLoadNetworks
parallels: better bridge network interface support
parallels: set network adapter device status to connected
parallels: make E1000 network adapter type default
parallels: switch off offline management feature
parallels: don't prevent domain define if VIR_DOMAIN_NET_TYPE_BRIDGE
9 years, 8 months
[libvirt] [PATCH] qemu: Fix two issues in qemuDomainSetVcpus error handling
by John Ferlan
Issue #1 - A call to virBitmapNew did not check if the allocation
failed which could lead to a NULL dereference
Issue #2 - When deleting the pin entries from the config file, the
code loops from the number of elements down to the "new" vcpu count;
however, the pin id values are numbered 0..n-1 not 1..n, so the "first"
pin attempt would never work. Luckily the check was for whether the
incoming 'n' (vcpu id) matched the entry in the array from 0..arraysize
rather than a dereference of the 'n' entry
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
NOTE: These were found on inspection while working/debugging the a IOThreads
series which borrows from the SetVcpus code. I can separate the two if
desired, but I think the second issue is mostly an optimization.
src/qemu/qemu_driver.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index ed6764d..6d9217b 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -4752,7 +4752,11 @@ static int qemuDomainHotplugVcpus(virQEMUDriverPtr driver,
if (VIR_ALLOC(vcpupin) < 0)
goto cleanup;
- vcpupin->cpumask = virBitmapNew(VIR_DOMAIN_CPUMASK_LEN);
+ if (!(vcpupin->cpumask =
+ virBitmapNew(VIR_DOMAIN_CPUMASK_LEN))) {
+ VIR_FREE(vcpupin);
+ goto cleanup;
+ }
virBitmapCopy(vcpupin->cpumask, vm->def->cpumask);
vcpupin->id = i;
if (VIR_APPEND_ELEMENT_COPY(vm->def->cputune.vcpupin,
@@ -4987,7 +4991,7 @@ qemuDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
/* remove vcpupin entries for vcpus that were unplugged */
if (nvcpus < persistentDef->vcpus) {
- for (i = persistentDef->vcpus; i >= nvcpus; i--)
+ for (i = persistentDef->vcpus - 1; i >= nvcpus; i--)
virDomainPinDel(&persistentDef->cputune.vcpupin,
&persistentDef->cputune.nvcpupin,
i);
--
2.1.0
9 years, 8 months