[libvirt] [PATCH] util: Add win32 version of virFileUnlink
by Martin Kletzander
Commit 35847860f65f Added the virFileUnlink function, but failed to add
a version for mingw build, causing the following error:
Cannot export virFileUnlink: symbol not defined
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
src/util/virfile.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/src/util/virfile.c b/src/util/virfile.c
index 408d2d912f13..75819d9c8bd7 100644
--- a/src/util/virfile.c
+++ b/src/util/virfile.c
@@ -2637,6 +2637,20 @@ virDirCreate(const char *path ATTRIBUTE_UNUSED,
return -ENOSYS;
}
+
+int
+virFileUnlink(const char *path,
+ uid_t uid ATTRIBUTE_UNUSED,
+ gid_t gid ATTRIBUTE_UNUSED)
+{
+ if (unlink(path) < 0) {
+ virReportSystemError(errno, _("Unable to unlink path '%s'"),
+ path);
+ return -1;
+ }
+
+ return 0;
+}
#endif /* WIN32 */
/**
--
2.5.1
9 years, 2 months
[libvirt] [PATCH] docs: Remove last use of double semicolon in Makefile
by Martin Kletzander
Double semicolons have special meaning in makefiles, but they would have
to be combined with other rules witch such separators in order to be
used as intended. Since there are no other rules like that, let's
clean it up.
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
docs/Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/Makefile.am b/docs/Makefile.am
index daf37b6b95de..bfae35e0ddba 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -204,7 +204,7 @@ todo:
rm -f todo.html.in
$(MAKE) todo.html
-hvsupport.html:: $(srcdir)/hvsupport.html.in
+hvsupport.html: $(srcdir)/hvsupport.html.in
$(srcdir)/hvsupport.html.in: $(srcdir)/hvsupport.pl $(api_DATA) \
$(top_srcdir)/src/libvirt_public.syms \
--
2.5.1
9 years, 2 months
[libvirt] [PATCH] conf: fix crash when parse a disordered numa settings
by Luyao Huang
https://bugzilla.redhat.com/show_bug.cgi?id=1260846
Introduced by 8fedbbdb, if we parse the disordered numa
cell, will get segfault. This is because we allow parse
the numa cell not in order and we alloc them before the
parse loop, the cpumask maybe NULL when parse each numa
cell.
Signed-off-by: Luyao Huang <lhuang(a)redhat.com>
---
src/conf/numa_conf.c | 10 +++++---
.../qemuxml2argv-cpu-numa-disordered.xml | 26 +++++++++++++++++++
.../qemuxml2xmlout-cpu-numa-disordered.xml | 29 ++++++++++++++++++++++
tests/qemuxml2xmltest.c | 1 +
4 files changed, 63 insertions(+), 3 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-cpu-numa-disordered.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-cpu-numa-disordered.xml
diff --git a/src/conf/numa_conf.c b/src/conf/numa_conf.c
index 5c123b9..b5963ac 100644
--- a/src/conf/numa_conf.c
+++ b/src/conf/numa_conf.c
@@ -759,11 +759,15 @@ virDomainNumaDefCPUParseXML(virDomainNumaPtr def,
}
VIR_FREE(tmp);
- for (j = 0; j < i; j++) {
+ for (j = 0; j < n; j++) {
+ if (j == cur_cell || !def->mem_nodes[j].cpumask)
+ continue;
+
if (virBitmapOverlaps(def->mem_nodes[j].cpumask,
- def->mem_nodes[i].cpumask)) {
+ def->mem_nodes[cur_cell].cpumask)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("NUMA cells %zu and %zu have overlapping vCPU ids"), i, j);
+ _("NUMA cells %u and %zu have overlapping vCPU ids"),
+ cur_cell, j);
goto cleanup;
}
}
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa-disordered.xml b/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa-disordered.xml
new file mode 100644
index 0000000..ad31607
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-cpu-numa-disordered.xml
@@ -0,0 +1,26 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>328650</memory>
+ <currentMemory unit='KiB'>328650</currentMemory>
+ <vcpu placement='static'>16</vcpu>
+ <os>
+ <type arch='x86_64' machine='pc'>hvm</type>
+ <boot dev='network'/>
+ </os>
+ <cpu>
+ <topology sockets='2' cores='4' threads='2'/>
+ <numa>
+ <cell id='0' cpus='0-5' memory='109550' unit='KiB'/>
+ <cell id='2' cpus='6-10' memory='109550' unit='KiB'/>
+ <cell id='1' cpus='11-15' memory='109550' unit='KiB'/>
+ </numa>
+ </cpu>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu</emulator>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-cpu-numa-disordered.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-cpu-numa-disordered.xml
new file mode 100644
index 0000000..0a76f12
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-cpu-numa-disordered.xml
@@ -0,0 +1,29 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>328650</memory>
+ <currentMemory unit='KiB'>328650</currentMemory>
+ <vcpu placement='static'>16</vcpu>
+ <os>
+ <type arch='x86_64' machine='pc'>hvm</type>
+ <boot dev='network'/>
+ </os>
+ <cpu>
+ <topology sockets='2' cores='4' threads='2'/>
+ <numa>
+ <cell id='0' cpus='0-5' memory='109550' unit='KiB'/>
+ <cell id='1' cpus='11-15' memory='109550' unit='KiB'/>
+ <cell id='2' cpus='6-10' memory='109550' unit='KiB'/>
+ </numa>
+ </cpu>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu</emulator>
+ <controller type='usb' index='0'/>
+ <controller type='pci' index='0' model='pci-root'/>
+ <memballoon model='virtio'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index d41954e..5a20ebc 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -608,6 +608,7 @@ mymain(void)
DO_TEST_DIFFERENT("cpu-numa1");
DO_TEST_DIFFERENT("cpu-numa2");
DO_TEST_DIFFERENT("cpu-numa-no-memory-element");
+ DO_TEST_DIFFERENT("cpu-numa-disordered");
DO_TEST("cpu-numa-disjoint");
DO_TEST("cpu-numa-memshared");
--
1.8.3.1
9 years, 2 months
[libvirt] [PATCH] admin: Resolve leaked reference to private data
by Erik Skultety
Running valgrind on a very simplistic program consisting only from
opening and closing admin connection (virAdmConnect{Open,Close}) shows a
leak in remoteAdminPrivNew, because the last reference to privateData is
not decremented, thus the object won't be disposed. This patch unrefs
the privateData object once we closed the active connection to daemon,
making further use of this connection useless.
==24577== at 0x4A089C7: calloc (in /usr/lib64/valgrind/vgpreload_***linux.so)
==24577== by 0x4E8835F: virAllocVar (viralloc.c:560)
==24577== by 0x4EDFA5C: virObjectNew (virobject.c:193)
==24577== by 0x4EDFBD4: virObjectLockableNew (virobject.c:219)
==24577== by 0x4C14DAF: remoteAdminPrivNew (libvirt-admin.c:152)
==24577== by 0x4C1537E: virAdmConnectOpen (libvirt-admin.c:308)
==24577== by 0x400BAD: main (listservers.c:39)
==24577== LEAK SUMMARY:
==24577== definitely lost: 80 bytes in 1 blocks
==24577== indirectly lost: 840 bytes in 6 blocks
==24577== possibly lost: 0 bytes in 0 blocks
==24577== still reachable: 12,179 bytes in 199 blocks
==24577== suppressed: 0 bytes in 0 blocks
---
src/libvirt-admin.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/libvirt-admin.c b/src/libvirt-admin.c
index b3fd0b3..5a4fc48 100644
--- a/src/libvirt-admin.c
+++ b/src/libvirt-admin.c
@@ -132,6 +132,7 @@ remoteAdminPrivFree(void *opaque)
virAdmConnectPtr conn = opaque;
remoteAdminConnectClose(conn);
+ virObjectUnref(conn->privateData);
}
static remoteAdminPrivPtr
--
2.4.3
9 years, 2 months
[libvirt] [PATCH 0/3] vmx: Add handling for CDROM devices with SCSI passthru and other minor fixes
by Matthias Bolte
This patch series addresses this bug report:
https://bugzilla.redhat.com/show_bug.cgi?id=1172544
It's mean as a replacement for this patch:
https://www.redhat.com/archives/libvir-list/2015-August/msg00970.html
Matthias Bolte (3):
vmx: Some whitespace cleanup
vmx: The virVMXParseDisk deviceType can be NULL, add some missing
checks
vmx: Add handling for CDROM devices with SCSI passthru
src/vmx/vmx.c | 81 ++++++++++++++-------
tests/vmx2xmldata/vmx2xml-cdrom-scsi-passthru.vmx | 6 ++
tests/vmx2xmldata/vmx2xml-cdrom-scsi-passthru.xml | 24 +++++++
tests/vmx2xmldata/vmx2xml-esx-in-the-wild-7.vmx | 85 +++++++++++++++++++++++
tests/vmx2xmldata/vmx2xml-esx-in-the-wild-7.xml | 35 ++++++++++
tests/vmx2xmltest.c | 2 +
tests/xml2vmxdata/xml2vmx-cdrom-scsi-passthru.vmx | 14 ++++
tests/xml2vmxdata/xml2vmx-cdrom-scsi-passthru.xml | 14 ++++
tests/xml2vmxdata/xml2vmx-esx-in-the-wild-7.vmx | 25 +++++++
tests/xml2vmxdata/xml2vmx-esx-in-the-wild-7.xml | 35 ++++++++++
tests/xml2vmxtest.c | 2 +
11 files changed, 296 insertions(+), 27 deletions(-)
create mode 100644 tests/vmx2xmldata/vmx2xml-cdrom-scsi-passthru.vmx
create mode 100644 tests/vmx2xmldata/vmx2xml-cdrom-scsi-passthru.xml
create mode 100644 tests/vmx2xmldata/vmx2xml-esx-in-the-wild-7.vmx
create mode 100644 tests/vmx2xmldata/vmx2xml-esx-in-the-wild-7.xml
create mode 100644 tests/xml2vmxdata/xml2vmx-cdrom-scsi-passthru.vmx
create mode 100644 tests/xml2vmxdata/xml2vmx-cdrom-scsi-passthru.xml
create mode 100644 tests/xml2vmxdata/xml2vmx-esx-in-the-wild-7.vmx
create mode 100644 tests/xml2vmxdata/xml2vmx-esx-in-the-wild-7.xml
--
1.9.1
9 years, 2 months
[libvirt] [PATCH] virsh: Teach attach-interface to --print-xml
by Michal Privoznik
We have the same argument to many other commands that produce an
XML based on what user typed. But unfortunately attach-interface
was missing it. Maybe nobody hasn't needed it yet. Well, I did
just now.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
tools/virsh-domain.c | 20 ++++++++++++++++----
tools/virsh.pod | 4 ++++
2 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index b029b65..516a51e 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -862,6 +862,10 @@ static const vshCmdOptDef opts_attach_interface[] = {
.type = VSH_OT_BOOL,
.help = N_("affect current domain")
},
+ {.name = "print-xml",
+ .type = VSH_OT_BOOL,
+ .help = N_("print XML document rather than attach the interface")
+ },
{.name = NULL}
};
@@ -938,9 +942,6 @@ cmdAttachInterface(vshControl *ctl, const vshCmd *cmd)
if (live)
flags |= VIR_DOMAIN_AFFECT_LIVE;
- if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
- return false;
-
if (persistent &&
virDomainIsActive(dom) == 1)
flags |= VIR_DOMAIN_AFFECT_LIVE;
@@ -1051,6 +1052,7 @@ cmdAttachInterface(vshControl *ctl, const vshCmd *cmd)
virBufferAddLit(&buf, "</bandwidth>\n");
}
+ virBufferAdjustIndent(&buf, -2);
virBufferAddLit(&buf, "</interface>\n");
if (virBufferError(&buf)) {
@@ -1060,6 +1062,15 @@ cmdAttachInterface(vshControl *ctl, const vshCmd *cmd)
xml = virBufferContentAndReset(&buf);
+ if (vshCommandOptBool(cmd, "print-xml")) {
+ vshPrint(ctl, "%s", xml);
+ functionReturn = true;
+ goto cleanup;
+ }
+
+ if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
+ goto cleanup;
+
if (flags || current)
ret = virDomainAttachDeviceFlags(dom, xml, flags);
else
@@ -1075,7 +1086,8 @@ cmdAttachInterface(vshControl *ctl, const vshCmd *cmd)
}
cleanup:
- virDomainFree(dom);
+ if (dom)
+ virDomainFree(dom);
virBufferFreeAndReset(&buf);
return functionReturn;
}
diff --git a/tools/virsh.pod b/tools/virsh.pod
index 83c445d3..0212e7a 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -2507,6 +2507,7 @@ Likewise, I<--shareable> is an alias for I<--mode shareable>.
[[[I<--live>] [I<--config>] | [I<--current>]] | [I<--persistent>]]
[I<--target target>] [I<--mac mac>] [I<--script script>] [I<--model model>]
[I<--inbound average,peak,burst,floor>] [I<--outbound average,peak,burst>]
+[I<--print-xml>]
Attach a new network interface to the domain. I<type> can be
I<network> to indicate connection via a libvirt virtual network, or
@@ -2536,6 +2537,9 @@ kilobytes in a single burst at I<peak> speed as described in the
Network XML documentation at
L<http://libvirt.org/formatnetwork.html#elementQoS>.
+If I<--print-xml> is specified, then the XML of the interface that would be
+attached is printed instead.
+
If I<--live> is specified, affect a running domain.
If I<--config> is specified, affect the next startup of a persistent domain.
If I<--current> is specified, affect the current domain state.
--
2.4.6
9 years, 2 months
[libvirt] [PATCH sandbox 0/4] Fix data retention with QEMU sandboxes
by Daniel P. Berrange
In testing the docker sandbox patches I found that with QEMU
sandboxes, we would randomly loose data written to the block
device. This meant that after untar'ing the image contents into
the qcow2 the filesystem was left empty!
Eventually I realized that there was no where we are calling sync()
to flush data out to disk. We never noticed this before because
the sandbox code mostly used 9p filesystems with QEMU which do not
need this sync().
Daniel P. Berrange (4):
push changing of user ID down into child process
Sync and unmount filesystems during shutdown
Fix passing of strace option to guest kernel
Don't close immediately when getting EOF on RPC console
bin/virt-sandbox.c | 23 ++-
libvirt-sandbox/libvirt-sandbox-builder-machine.c | 7 +-
libvirt-sandbox/libvirt-sandbox-init-common.c | 226 +++++++++++++++++++---
libvirt-sandbox/libvirt-sandbox-init-qemu.c | 3 +-
4 files changed, 225 insertions(+), 34 deletions(-)
--
2.4.3
9 years, 2 months
[libvirt] [PATCHv3 0/2] Added waiting for DAD to finish for bridge address.
by Maxim Perevedentsev
This is a fix for commit db488c79173b240459c7754f38c3c6af9b432970
dnsmasq main process which is relied on when waiting for DAD to complete
exits without actually waiting for DAD. This is dnsmasq daemon's task.
It seems to be a race that DAD finished before dnsmasq main process exited.
The above commit needs the execution to block until DAD finishes
for bridge IPv6 address because then it closes dummy tap device.
Thus we need to ensure this ourselves.
So we periodically poll the kernel using netlink and
check whether there are any IPv6 addresses assigned to bridge
which have 'tentative' state. After DAD is finished, execution continues.
I guess that is what dnsmasq was assumed to do.
We use netlink to dump information about existing IPv6 addresses. Netlink's
response is a multi-part message. Unfortunately, the current implementation
of virNetlink treats such messages as faulty and throws an error. So the patch 2/2
adds multi-part nelink response support.
Update v2: fixed syntax.
Update v3: moved to virnetdev.
Maxim Perevedentsev (2):
network: added waiting for DAD to finish for bridge address.
Add support for multi-part netlink messages.
src/libvirt_private.syms | 1 +
src/network/bridge_driver.c | 35 +++++++++-
src/util/virnetdev.c | 160 ++++++++++++++++++++++++++++++++++++++++++++
src/util/virnetdev.h | 2 +
src/util/virnetlink.c | 4 +-
5 files changed, 200 insertions(+), 2 deletions(-)
--
Sincerely,
Maxim Perevedentsev
9 years, 2 months
[libvirt] [PATCH] cpu: Introduce IvyBridge CPU model
by Jiri Denemark
https://bugzilla.redhat.com/show_bug.cgi?id=1254420
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/cpu/cpu_map.xml | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 49 insertions(+)
diff --git a/src/cpu/cpu_map.xml b/src/cpu/cpu_map.xml
index d2469ee..51aa899 100644
--- a/src/cpu/cpu_map.xml
+++ b/src/cpu/cpu_map.xml
@@ -869,6 +869,55 @@
<feature name='xsave'/>
</model>
+ <model name='IvyBridge'>
+ <vendor name='Intel'/>
+ <feature name='aes'/>
+ <feature name='apic'/>
+ <feature name='avx'/>
+ <feature name='clflush'/>
+ <feature name='cmov'/>
+ <feature name='cx16'/>
+ <feature name='cx8'/>
+ <feature name='de'/>
+ <feature name='erms'/>
+ <feature name='f16c'/>
+ <feature name='fpu'/>
+ <feature name='fsgsbase'/>
+ <feature name='fxsr'/>
+ <feature name='lahf_lm'/>
+ <feature name='lm'/>
+ <feature name='mca'/>
+ <feature name='mce'/>
+ <feature name='mmx'/>
+ <feature name='msr'/>
+ <feature name='mtrr'/>
+ <feature name='nx'/>
+ <feature name='pae'/>
+ <feature name='pat'/>
+ <feature name='pclmuldq'/>
+ <feature name='pge'/>
+ <feature name='pni'/>
+ <feature name='popcnt'/>
+ <feature name='pse'/>
+ <feature name='pse36'/>
+ <feature name='rdrand'/>
+ <feature name='rdtscp'/>
+ <feature name='sep'/>
+ <feature name='smep'/>
+ <feature name='sse'/>
+ <feature name='sse2'/>
+ <feature name='sse4.1'/>
+ <feature name='sse4.2'/>
+ <feature name='ssse3'/>
+ <feature name='syscall'/>
+ <feature name='tsc'/>
+ <feature name='tsc-deadline'/>
+ <feature name='vme'/>
+ <feature name='x2apic'/>
+ <feature name='xsave'/>
+ <feature name='xsaveopt'/>
+ </model>
+
<model name='Haswell-noTSX'>
<vendor name='Intel'/>
<feature name='aes'/>
--
2.5.1
9 years, 2 months
[libvirt] [PATCH] .gitignore: Ignore the correct rename example binary
by Michal Privoznik
In e755186c5c305a9 we tried to introduce an example demonstrating
new virDomainRename API. Unfortunately, in the .gitignore we had
a different binary listed. It's 'rename' binary which we want git
to ignore, not 'test'.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
Pushed under trivial rule.
.gitignore | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.gitignore b/.gitignore
index 19402f5..2d52a8f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -83,7 +83,7 @@
/examples/domtop/domtop
/examples/hellolibvirt/hellolibvirt
/examples/openauth/openauth
-/examples/rename/test
+/examples/rename/rename
/gnulib/lib/*
/gnulib/m4/*
/gnulib/tests/*
--
2.4.6
9 years, 2 months