[libvirt] GSoC Project
by Venkat Datta
Hi Team,
I'm an undergraduate student studying Computer Science at PES University ,
India .
I had applied for the GSoC program this year . I'm happy to hear that my
proposal has been accepted.
The project idea i will be working on " Conversion to and from
OCI-formatted containers "
[
http://wiki.libvirt.org/page/Google_Summer_of_Code_Ideas#Conversion_to_an...
].
I'm looking forward to learn more and keep contributing to the libvirt
community.
Thanks,
Venkat Datta N H
7 years, 6 months
[libvirt] [PATCH] Post-release version bump to 3.4.0
by Erik Skultety
Signed-off-by: Erik Skultety <eskultet(a)redhat.com>
---
Pushed as trivial.
configure.ac | 2 +-
docs/news.xml | 8 ++++++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 0b564a030..3329b1781 100644
--- a/configure.ac
+++ b/configure.ac
@@ -16,7 +16,7 @@ dnl You should have received a copy of the GNU Lesser General Public
dnl License along with this library. If not, see
dnl <http://www.gnu.org/licenses/>.
-AC_INIT([libvirt], [3.3.0], [libvir-list(a)redhat.com], [], [http://libvirt.org])
+AC_INIT([libvirt], [3.4.0], [libvir-list(a)redhat.com], [], [http://libvirt.org])
AC_CONFIG_SRCDIR([src/libvirt.c])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_HEADERS([config.h])
diff --git a/docs/news.xml b/docs/news.xml
index fb4e792ec..2f0144972 100644
--- a/docs/news.xml
+++ b/docs/news.xml
@@ -33,6 +33,14 @@
-->
<libvirt>
+ <release version="v3.4.0" date="unreleased">
+ <section title="New features">
+ </section>
+ <section title="Improvements">
+ </section>
+ <section title="Bug fixes">
+ </section>
+ </release>
<release version="v3.3.0" date="2017-05-05">
<section title="New features">
<change>
--
2.12.2
7 years, 6 months
[libvirt] [PATCH] configure: enforce presence of python for build
by Daniel P. Berrange
The API docs extractor, ESX code generator and keycodemapdb tools
rely on python. Historically every platform that this present, but
with switch to Python3 by default, we're increasingly seeing
installs without a /usr/bin/python.
This tightens up the check during configure, so it exits immediately
if python is missing, rather than leaving an empty $(PYTHON) make
variable which leads to more obscure errors later.
Also add it as a build dep for Mingw, since Fedora build roots no
longer get python2 by default. This was not previously a major
problem, since both ESX & API generated files were included in
EXTRA_DIST, but the keycodemapdb generated files are not, so we
require python all the time now.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
configure.ac | 5 ++++-
mingw-libvirt.spec.in | 1 +
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 5f7a07a..0b564a0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -624,9 +624,12 @@ fi
dnl Allow perl/python overrides
AC_PATH_PROGS([PYTHON], [python2 python])
+if test -z "$PYTHON"; then
+ AC_MSG_ERROR(['python' or 'python2' binary is required to build libvirt])
+fi
AC_PATH_PROG([PERL], [perl])
if test -z "$PERL"; then
- AC_MSG_ERROR([Failed to find perl.])
+ AC_MSG_ERROR(['perl' binary is required to build libvirt])
fi
LIBVIRT_ARG_WITH([TEST_SUITE], [build test suite by default], [check])
diff --git a/mingw-libvirt.spec.in b/mingw-libvirt.spec.in
index dec799b..302f663 100644
--- a/mingw-libvirt.spec.in
+++ b/mingw-libvirt.spec.in
@@ -54,6 +54,7 @@ BuildRequires: mingw64-portablexdr
BuildRequires: pkgconfig
# Need native version for msgfmt
BuildRequires: gettext
+BuildRequires: python
BuildRequires: perl
BuildRequires: perl(Getopt::Long)
%if 0%{?enable_autotools}
--
2.9.3
7 years, 6 months
[libvirt] [PATCH v2] qemu: clean up network interfaces before qemuProcessKill is called in qemuProcessStop
by ZhiPeng Lu
In qemuProcessStop we explicitly remove the port from the openvswitch bridge after
qemuProcessKill is called. But there is a certain interval of time between
deleting tap device and removing it from bridge. The problem occurs when two vms
start and shutdown with the same name's network interface attached to the same
openvswitch bridge. When one vm with the nic named "vnet0" stopping, it deleted
tap device without timely removing the port from bridge.
At this time, another vm created the tap device named "vnet0" and added port to the
same bridge. Then, the first vm removed the port from the same bridge.
Finally, the tap device of the second vm did not attached to the bridge.
We need to delete the bridge port before deleting the tap device instead of after.
So what's needed is to move the loop in qemuProcessStop that cleans up
network interfaces so that it happens before qemuProcessKill is called.
Signed-off-by: Zhipeng Lu <lu.zhipeng(a)zte.com.cn>
Signed-off-by: Laine Stump <laine(a)laine.org>
---
src/qemu/qemu_process.c | 99 ++++++++++++++++++++++++-------------------------
1 file changed, 49 insertions(+), 50 deletions(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 53170d7..f76ced1 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -6253,56 +6253,6 @@ void qemuProcessStop(virQEMUDriverPtr driver,
qemuProcessCleanupChardevDevice,
NULL));
-
- /* shut it off for sure */
- ignore_value(qemuProcessKill(vm,
- VIR_QEMU_PROCESS_KILL_FORCE|
- VIR_QEMU_PROCESS_KILL_NOCHECK));
-
- qemuDomainCleanupRun(driver, vm);
-
- /* Stop autodestroy in case guest is restarted */
- qemuProcessAutoDestroyRemove(driver, vm);
-
- /* now that we know it's stopped call the hook if present */
- if (virHookPresent(VIR_HOOK_DRIVER_QEMU)) {
- char *xml = qemuDomainDefFormatXML(driver, vm->def, 0);
-
- /* we can't stop the operation even if the script raised an error */
- ignore_value(virHookCall(VIR_HOOK_DRIVER_QEMU, vm->def->name,
- VIR_HOOK_QEMU_OP_STOPPED, VIR_HOOK_SUBOP_END,
- NULL, xml, NULL));
- VIR_FREE(xml);
- }
-
- /* Reset Security Labels unless caller don't want us to */
- if (!(flags & VIR_QEMU_PROCESS_STOP_NO_RELABEL))
- qemuSecurityRestoreAllLabel(driver, vm,
- !!(flags & VIR_QEMU_PROCESS_STOP_MIGRATED));
-
- qemuSecurityReleaseLabel(driver->securityManager, vm->def);
-
- for (i = 0; i < vm->def->ndisks; i++) {
- virDomainDeviceDef dev;
- virDomainDiskDefPtr disk = vm->def->disks[i];
-
- dev.type = VIR_DOMAIN_DEVICE_DISK;
- dev.data.disk = disk;
- ignore_value(qemuRemoveSharedDevice(driver, &dev, vm->def->name));
- }
-
- /* Clear out dynamically assigned labels */
- for (i = 0; i < vm->def->nseclabels; i++) {
- if (vm->def->seclabels[i]->type == VIR_DOMAIN_SECLABEL_DYNAMIC)
- VIR_FREE(vm->def->seclabels[i]->label);
- VIR_FREE(vm->def->seclabels[i]->imagelabel);
- }
-
- virStringListFree(priv->qemuDevices);
- priv->qemuDevices = NULL;
-
- qemuHostdevReAttachDomainDevices(driver, vm->def);
-
def = vm->def;
for (i = 0; i < def->nnets; i++) {
virDomainNetDefPtr net = def->nets[i];
@@ -6360,6 +6310,55 @@ void qemuProcessStop(virQEMUDriverPtr driver,
networkReleaseActualDevice(vm->def, net);
}
+ /* shut it off for sure */
+ ignore_value(qemuProcessKill(vm,
+ VIR_QEMU_PROCESS_KILL_FORCE|
+ VIR_QEMU_PROCESS_KILL_NOCHECK));
+
+ qemuDomainCleanupRun(driver, vm);
+
+ /* Stop autodestroy in case guest is restarted */
+ qemuProcessAutoDestroyRemove(driver, vm);
+
+ /* now that we know it's stopped call the hook if present */
+ if (virHookPresent(VIR_HOOK_DRIVER_QEMU)) {
+ char *xml = qemuDomainDefFormatXML(driver, vm->def, 0);
+
+ /* we can't stop the operation even if the script raised an error */
+ ignore_value(virHookCall(VIR_HOOK_DRIVER_QEMU, vm->def->name,
+ VIR_HOOK_QEMU_OP_STOPPED, VIR_HOOK_SUBOP_END,
+ NULL, xml, NULL));
+ VIR_FREE(xml);
+ }
+
+ /* Reset Security Labels unless caller don't want us to */
+ if (!(flags & VIR_QEMU_PROCESS_STOP_NO_RELABEL))
+ qemuSecurityRestoreAllLabel(driver, vm,
+ !!(flags & VIR_QEMU_PROCESS_STOP_MIGRATED));
+
+ qemuSecurityReleaseLabel(driver->securityManager, vm->def);
+
+ for (i = 0; i < vm->def->ndisks; i++) {
+ virDomainDeviceDef dev;
+ virDomainDiskDefPtr disk = vm->def->disks[i];
+
+ dev.type = VIR_DOMAIN_DEVICE_DISK;
+ dev.data.disk = disk;
+ ignore_value(qemuRemoveSharedDevice(driver, &dev, vm->def->name));
+ }
+
+ /* Clear out dynamically assigned labels */
+ for (i = 0; i < vm->def->nseclabels; i++) {
+ if (vm->def->seclabels[i]->type == VIR_DOMAIN_SECLABEL_DYNAMIC)
+ VIR_FREE(vm->def->seclabels[i]->label);
+ VIR_FREE(vm->def->seclabels[i]->imagelabel);
+ }
+
+ virStringListFree(priv->qemuDevices);
+ priv->qemuDevices = NULL;
+
+ qemuHostdevReAttachDomainDevices(driver, vm->def);
+
retry:
if ((ret = qemuRemoveCgroup(vm)) < 0) {
if (ret == -EBUSY && (retries++ < 5)) {
--
1.8.3.1
7 years, 6 months
[libvirt] [PATCH] Detect VMDK version 3 files
by Daniel P. Berrange
The metadata libvirt cares about is identical for version 3
as for previous versions, so we merely need list the new
version number.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
src/util/virstoragefile.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
index 94a77ce..3109b40 100644
--- a/src/util/virstoragefile.c
+++ b/src/util/virstoragefile.c
@@ -374,7 +374,7 @@ static struct FileTypeInfo const fileTypeInfo[] = {
},
[VIR_STORAGE_FILE_VMDK] = {
0, "KDMV", NULL,
- LV_LITTLE_ENDIAN, 4, 4, {1, 2},
+ LV_LITTLE_ENDIAN, 4, 4, {1, 2, 3},
4+4+4, 8, 512, NULL, vmdk4GetBackingStore, NULL
},
};
--
2.9.3
7 years, 6 months
[libvirt] [PATCH] Add "io" option to virsh attach-disk sub-command.
by Gordon Messmer
---
tools/virsh-domain.c | 14 +++++++++++---
tools/virsh.pod | 2 ++
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 0d19d0e..d2a2a05 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -267,6 +267,10 @@ static const vshCmdOptDef opts_attach_disk[] = {
.type = VSH_OT_STRING,
.help = N_("cache mode of disk device")
},
+ {.name = "io",
+ .type = VSH_OT_STRING,
+ .help = N_("io mode of disk device")
+ },
{.name = "type",
.type = VSH_OT_STRING,
.help = N_("target device type")
@@ -504,8 +508,9 @@ cmdAttachDisk(vshControl *ctl, const vshCmd *cmd)
virDomainPtr dom = NULL;
const char *source = NULL, *target = NULL, *driver = NULL,
*subdriver = NULL, *type = NULL, *mode = NULL,
- *iothread = NULL, *cache = NULL, *serial = NULL,
- *straddr = NULL, *wwn = NULL, *targetbus = NULL;
+ *iothread = NULL, *cache = NULL, *io = NULL,
+ *serial = NULL, *straddr = NULL, *wwn = NULL,
+ *targetbus = NULL;
struct DiskAddress diskAddr;
bool isFile = false, functionReturn = false;
int ret;
@@ -537,6 +542,7 @@ cmdAttachDisk(vshControl *ctl, const vshCmd *cmd)
vshCommandOptStringReq(ctl, cmd, "mode", &mode) < 0 ||
vshCommandOptStringReq(ctl, cmd, "iothread", &iothread) < 0 ||
vshCommandOptStringReq(ctl, cmd, "cache", &cache) < 0 ||
+ vshCommandOptStringReq(ctl, cmd, "io", &io) < 0 ||
vshCommandOptStringReq(ctl, cmd, "serial", &serial) < 0 ||
vshCommandOptStringReq(ctl, cmd, "wwn", &wwn) < 0 ||
vshCommandOptStringReq(ctl, cmd, "address", &straddr) < 0 ||
@@ -579,7 +585,7 @@ cmdAttachDisk(vshControl *ctl, const vshCmd *cmd)
virBufferAddLit(&buf, ">\n");
virBufferAdjustIndent(&buf, 2);
- if (driver || subdriver || iothread || cache) {
+ if (driver || subdriver || iothread || cache || io) {
virBufferAddLit(&buf, "<driver");
if (driver)
@@ -590,6 +596,8 @@ cmdAttachDisk(vshControl *ctl, const vshCmd *cmd)
virBufferAsprintf(&buf, " iothread='%s'", iothread);
if (cache)
virBufferAsprintf(&buf, " cache='%s'", cache);
+ if (io)
+ virBufferAsprintf(&buf, " io='%s'", io);
virBufferAddLit(&buf, "/>\n");
}
diff --git a/tools/virsh.pod b/tools/virsh.pod
index cd1f25f..9656411 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -2860,6 +2860,8 @@ I<mode> can specify the two specific mode
I<readonly> or I<shareable>.
I<sourcetype> can indicate the type of source (block|file)
I<cache> can be one of "default", "none", "writethrough", "writeback",
"directsync" or "unsafe".
+I<io> io is "threads", or "native" and selects between pthread based disk
+I/O and native Linux AIO.
I<iothread> is the number within the range of domain IOThreads to which
this disk may be attached (QEMU only).
I<serial> is the serial of disk device. I<wwn> is the wwn of disk device.
--
2.9.3
7 years, 6 months
[libvirt] vmdk matches vmdk magic, but version is wrong
by Yaniv Kaul
ykaul.tlv.redhat.com libvirtd[23662]: 23688: warning :
virStorageFileProbeFormatFromBuf:834 : File
/home/ykaul/Downloads/Dallas/Dallas-VM-disk001.vmdk matches vmdk magic, but
version is wrong. Please report new version to libvir-list(a)redhat.com
I hope this helps:
00000000 4B 44 4D 56 03 00 00 00 01 00 03 00 00 00 80 02 00 00 00 00
80 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 02 00 00 00 00 00 00
00 KDMV........................................
0000002C 00 02 00 00 00 00 00 00 00 00 00 00 FF FF FF FF FF FF FF FF
80 00 00 00 00 00 00 00 00 0A 20 0D 0A 01 00 00 00 00 00 00 00 00 00
00 .............................. .............
00000058 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 ............................................
00000084 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 ............................................
000000B0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 ............................................
000000DC 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 ............................................
00000108 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 ............................................
00000134 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 ............................................
00000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 ............................................
0000018C 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 ............................................
000001B8 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 ............................................
000001E4 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 23 20 44 69 73 6B 20 44 65 73 63 72 69 70 74
6F ............................# Disk Descripto
00000210 72 46 69 6C 65 0A 76 65 72 73 69 6F 6E 3D 31 0A 43 49 44 3D
32 63 33 65 32 30 34 37 0A 70 61 72 65 6E 74 43 49 44 3D 66 66 66 66
66 rFile.version=1.CID=2c3e2047.parentCID=fffff
0000023C 66 66 66 0A 63 72 65 61 74 65 54 79 70 65 3D 22 73 74 72 65
61 6D 4F 70 74 69 6D 69 7A 65 64 22 0A 0A 23 20 45 78 74 65 6E 74 20
64 fff.createType="streamOptimized"..# Extent d
00000268 65 73 63 72 69 70 74 69 6F 6E 0A 52 44 4F 4E 4C 59 20 34 31
39 34 33 30 34 30 20 53 50 41 52 53 45 20 22 44 61 6C 6C 61 73 2D 56
4D escription.RDONLY 41943040 SPARSE "Dallas-VM
00000294 2D 64 69 73 6B 30 30 31 2E 76 6D 64 6B 22 0A 0A 23 20 54 68
65 20 64 69 73 6B 20 44 61 74 61 20 42 61 73 65 20 0A 23 44 44 42 0A
0A -disk001.vmdk"..# The disk Data Base .#DDB..
000002C0 64 64 62 2E 76 69 72 74 75 61 6C 48 57 56 65 72 73 69 6F 6E
20 3D 20 22 34 22 0A 64 64 62 2E 61 64 61 70 74 65 72 54 79 70 65 3D
22 ddb.virtualHWVersion = "4".ddb.adapterType="
000002EC 69 64 65 22 0A 64 64 62 2E 67 65 6F 6D 65 74 72 79 2E 63 79
6C 69 6E 64 65 72 73 3D 22 31 36 33 38 33 22 0A 64 64 62 2E 67 65 6F
6D ide".ddb.geometry.cylinders="16383".ddb.geom
00000318 65 74 72 79 2E 68 65 61 64 73 3D 22 31 36 22 0A 64 64 62 2E
67 65 6F 6D 65 74 72 79 2E 73 65 63 74 6F 72 73 3D 22 36 33 22 0A 64
64 etry.heads="16".ddb.geometry.sectors="63".dd
00000344 62 2E 67 65 6F 6D 65 74 72 79 2E 62 69 6F 73 43 79 6C 69 6E
64 65 72 73 3D 22 31 30 32 34 22 0A 64 64 62 2E 67 65 6F 6D 65 74 72
79 b.geometry.biosCylinders="1024".ddb.geometry
00000370 2E 62 69 6F 73 48 65 61 64 73 3D 22 32 35 35 22 0A 64 64 62
2E 67 65 6F 6D 65 74 72 79 2E 62 69 6F 73 53 65 63 74 6F 72 73 3D 22
36 .biosHeads="255".ddb.geometry.biosSectors="6
0000039C 33 22 0A 64 64 62 2E 75 75 69 64 2E 69 6D 61 67 65 3D 22 39
30 33 33 38 66 61 63 2D 66 31 38 38 2D 34 61 30 61 2D 62 37 31 36 2D
34 3".ddb.uuid.image="90338fac-f188-4a0a-b716-4
000003C8 64 38 64 63 61 38 61 37 61 36 61 22 0A 64 64 62 2E 75 75 69
64 2E 70 61 72 65 6E 74 3D 22 30 30 30 30 30 30 30 30 2D 30 30 30 30
2D d8dca8a7a6a".ddb.uuid.parent="00000000-0000-
000003F4 30 30 30 30 2D 30 30 30 30 2D 30 30 30 30 30 30 30 30 30 30
30 30 22 0A 64 64 62 2E 75 75 69 64 2E 6D 6F 64 69 66 69 63 61 74 69
6F 0000-0000-000000000000".ddb.uuid.modificatio
00000420 6E 3D 22 30 30 30 30 30 30 30 30 2D 30 30 30 30 2D 30 30 30
30 2D 30 30 30 30 2D 30 30 30 30 30 30 30 30 30 30 30 30 22 0A 64 64
62 n="00000000-0000-0000-0000-000000000000".ddb
0000044C 2E 75 75 69 64 2E 70 61 72 65 6E 74 6D 6F 64 69 66 69 63 61
74 69 6F 6E 3D 22 30 30 30 30 30 30 30 30 2D 30 30 30 30 2D 30 30 30
30 .uuid.parentmodification="00000000-0000-0000
00000478 2D 30 30 30 30 2D 30 30 30 30 30 30 30 30 30 30 30 30 22 0A
64 64 62 2E 63 6F 6D 6D 65 6E 74 3D 22 22 0A 00 00 00 00 00 00 00 00
00 -0000-000000000000".ddb.comment=""..........
libvirt version: 2.2.0, package: 2.fc25 (Fedora Project,
2016-11-14-21:04:29, buildvm-25.phx2.fedoraproject.org
7 years, 6 months
[libvirt] Release of libvirt-3.3.0
by Daniel Veillard
I did the release yesterday evening, just sending this mail now. The
release has been tagged in git, I have pushed signed tarball and rpms to
the usual place at :
ftp://libvirt.org/libvirt/
I also pushed version 3.3.0 of the python bindings, same tagged in git and
signed tarball and rpms should be in their respective place:
ftp://libvirt.org/libvirt/python/
this is a balanced release with a fair amount of both new features and
improvements, in addition to a set of bug fixes:
* New features
- net: Add support for coalesce settings
Enabling data batching through these settings can improve network
performance for guests.
- qemu: Add support for guest CPU cache specification
This features allows fine-grained control of the cache behavior of the
guest CPU.
- qemu: Add support for the qemu-xhci USB controller
* Improvements
- hyperv: Support Hyper-V 2012 and newer
Starting with Hyper-V 2012 the API has changed causing the existing
driver to be unable to send and process requests properly. This has
been resolved by adding abstractions to handle the differences and ease
handling such breaks if they happen in the future.
- libxl: Add support for nested HVM domains
Xen has supported nested HVM domains since version 4.4. The libvirt
libxl driver now supports nested HVM domains by specifying the
host-passthrough CPU mode when defining a domain.
- qemu: Implement ACPI support for aarch64 guests
Up until this point, ACPI support was only advertised for x86_64 guests
and disabling it for aarch64 guests was not possible at all.
- vz: Add support for changing the number of vCPUs
- qemu: Automatically choose the best USB controller for guests
The recently introduced qemu-xhci USB controller is the best choice for
both ppc64 and aarch64 guests, so use it by default on those
architectures if available.
- daemon: Increase default task limit for libvirtd
The default number of tasks for the pids cgroup controller is 512,
which libvirtd can quickly bump into when starting lots of guests.
Raise the limit to a more reasonable 32768.
- docs: Include man pages describing key code names and values
- virsh: Report initialization errors
Sometimes virsh might be unable to start: when that happens, report
useful diagnostics instead of failing silently.
* Bug fixes
- nss: Don't require a network restart for libvirt_guest
Previously, the libvirt_guest NSS module would only work properly after
the corresponding network had been restarted; now newly started guests
will be reported correctly right away.
- storage: Remove unavailable transient pools after restart
Solve an issue where transient storage pools would be stuck in an
unmanageable state if the source disappeared and libvirtd was
subsequently restarted.
- storage: Fix capacity value for LUKS encrypted volumes
The 'capacity' value (e.g. guest logical size) for a LUKS volume is
smaller than the 'physical' value of the file in the file system, so we
need to account for that.
- qemu: Fix regression when hyperv/vendor_id feature is used
Guests using the feature would not be started at all; it is now
possible to start them as expected.
- qemu: Do not crash on USB address with no port and invalid bus
- crypto: Always pad data before encrypting it
If this step is not performed, when the data length matches the chunk
size the decryption routines will misinterpret the last byte of data as
the padding length and fail to decode it correctly.
Thanks everybody for your help toward this release, be it with patches,
documentation, bug reports, reviews ideas, etc ...
Enjoy !
Daniel
--
Daniel Veillard | Red Hat Developers Tools http://developer.redhat.com/
veillard(a)redhat.com | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | virtualization library http://libvirt.org/
7 years, 6 months
[libvirt] [PATCH] libxl: add default controllers for USB devices
by Jim Fehlig
Attempting to start a domain with USB hostdevs but no USB controllers
fails with the rather cryptic error
libxl: error: libxl_qmp.c:287:qmp_handle_error_response: received an
error message from QMP server: Bus 'xenusb-0.0' not found
This can be fixed by creating default USB controllers. When no USB
controllers are defined, create the number of 8 port controllers
necessary to accommodate the number of defined USB devices.
Note that USB controllers are already created as needed in the
domainAttachDevice code path. E.g. a USB controller will be created,
if necessary, when attaching a USB device with
'virsh attach-device dom usbdev.xml'.
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
src/libxl/libxl_conf.c | 80 +++++++++++++++++++++++++++++++++++++++++++-------
1 file changed, 69 insertions(+), 11 deletions(-)
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index 4bab651b3..ed36dd1ff 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -1786,34 +1786,92 @@ libxlMakeUSBController(virDomainControllerDefPtr controller,
}
static int
+libxlMakeDefaultUSBControllers(virDomainDefPtr def,
+ libxl_domain_config *d_config)
+{
+ virDomainControllerDefPtr l_controller = NULL;
+ libxl_device_usbctrl *x_controllers = NULL;
+ size_t nusbdevs = 0;
+ size_t ncontrollers;
+ size_t i;
+
+ for (i = 0; i < def->nhostdevs; i++) {
+ if (def->hostdevs[i]->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS &&
+ def->hostdevs[i]->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB)
+ nusbdevs++;
+ }
+
+ /* No controllers needed if there are no USB devs */
+ if (nusbdevs == 0)
+ return 0;
+
+ /* Create USB controllers with 8 ports */
+ ncontrollers = VIR_DIV_UP(nusbdevs, 8);
+ if (VIR_ALLOC_N(x_controllers, ncontrollers) < 0)
+ return -1;
+
+ for (i = 0; i < ncontrollers; i++) {
+ if (!(l_controller = virDomainControllerDefNew(VIR_DOMAIN_CONTROLLER_TYPE_USB)))
+ goto error;
+
+ l_controller->model = VIR_DOMAIN_CONTROLLER_MODEL_USB_QUSB2;
+ l_controller->idx = i;
+ l_controller->opts.usbopts.ports = 8;
+
+ libxl_device_usbctrl_init(&x_controllers[i]);
+
+ if (libxlMakeUSBController(l_controller, &x_controllers[i]) < 0)
+ goto error;
+
+ virDomainControllerInsertPreAlloced(def, l_controller);
+ l_controller = NULL;
+ }
+
+ d_config->usbctrls = x_controllers;
+ d_config->num_usbctrls = ncontrollers;
+ return 0;
+
+ error:
+ virDomainControllerDefFree(l_controller);
+ for (i = 0; i < ncontrollers; i++)
+ libxl_device_usbctrl_dispose(&x_controllers[i]);
+ VIR_FREE(x_controllers);
+ return -1;
+}
+
+static int
libxlMakeUSBControllerList(virDomainDefPtr def, libxl_domain_config *d_config)
{
virDomainControllerDefPtr *l_controllers = def->controllers;
size_t ncontrollers = def->ncontrollers;
size_t nusbctrls = 0;
libxl_device_usbctrl *x_usbctrls;
- size_t i;
-
- if (ncontrollers == 0)
- return 0;
-
- if (VIR_ALLOC_N(x_usbctrls, ncontrollers) < 0)
- return -1;
+ size_t i, j;
for (i = 0; i < ncontrollers; i++) {
+ if (l_controllers[i]->type == VIR_DOMAIN_CONTROLLER_TYPE_USB)
+ nusbctrls++;
+ }
+
+ if (nusbctrls == 0)
+ return libxlMakeDefaultUSBControllers(def, d_config);
+
+ if (VIR_ALLOC_N(x_usbctrls, nusbctrls) < 0)
+ return -1;
+
+ for (i = 0, j = 0; i < ncontrollers && j < nusbctrls; i++) {
if (l_controllers[i]->type != VIR_DOMAIN_CONTROLLER_TYPE_USB)
continue;
- libxl_device_usbctrl_init(&x_usbctrls[nusbctrls]);
+ libxl_device_usbctrl_init(&x_usbctrls[j]);
if (libxlMakeUSBController(l_controllers[i],
- &x_usbctrls[nusbctrls]) < 0)
+ &x_usbctrls[j]) < 0)
goto error;
- nusbctrls++;
+ j++;
}
- VIR_SHRINK_N(x_usbctrls, ncontrollers, ncontrollers - nusbctrls);
d_config->usbctrls = x_usbctrls;
d_config->num_usbctrls = nusbctrls;
--
2.11.0
7 years, 6 months
[libvirt] [PATCH go-xml] remove superfluous state & omitempty entries
by Ryan Goodfellow
This commit removes the superfluous state and omit entries from my last
commit. It factors the 'state' data member into a DomainFeatureState
struct and only uses that struct where necessary e.g. HyperV features
as well as a few top level features such as PMU, HAP etc. The HyperV
suffix has also been added to features that are specific to
HyperV.
---
domain.go | 62 +++++++++++++++++++++++++++++-----------------------------
domain_test.go | 26 +++++++++++++-----------
2 files changed, 46 insertions(+), 42 deletions(-)
diff --git a/domain.go b/domain.go
index c9ffaef..b4b2256 100644
--- a/domain.go
+++ b/domain.go
@@ -372,61 +372,61 @@ type DomainCPU struct {
}
type DomainFeature struct {
+}
+
+type DomainFeatureState struct {
State string `xml:"state,attr,omitempty"`
}
type DomainFeatureAPIC struct {
- DomainFeature
EOI string `xml:"eio,attr,omitempty"`
}
-type DomainFeatureVendorId struct {
- DomainFeature
+type DomainFeatureHyperVVendorId struct {
+ DomainFeatureState
Value string `xml:"value,attr,omitempty"`
}
-type DomainFeatureSpinlocks struct {
- DomainFeature
+type DomainFeatureHyperVSpinlocks struct {
+ DomainFeatureState
Retries uint `xml:"retries,attr,omitempty"`
}
type DomainFeatureHyperV struct {
DomainFeature
- Relaxed *DomainFeature `xml:"relaxed,omitempty"`
- VAPIC *DomainFeature `xml:"vapic,omitempty"`
- Spinlocks *DomainFeatureSpinlocks `xml:"spinlocks,omitempty"`
- VPIndex *DomainFeature `xml:"vpindex,omitempty"`
- Runtime *DomainFeature `xml:"runtime,omitempty"`
- Synic *DomainFeature `xml:"synic,omitempty"`
- STimer *DomainFeature `xml:"stimer,omitempty"`
- Reset *DomainFeature `xml:"reset,omitempty"`
- VendorId *DomainFeatureVendorId `xml:"vendor_id,omitempty"`
+ Relaxed *DomainFeatureState `xml:"relaxed"`
+ VAPIC *DomainFeatureState `xml:"vapic"`
+ Spinlocks *DomainFeatureHyperVSpinlocks `xml:"spinlocks"`
+ VPIndex *DomainFeatureState `xml:"vpindex"`
+ Runtime *DomainFeatureState `xml:"runtime"`
+ Synic *DomainFeatureState `xml:"synic"`
+ STimer *DomainFeatureState `xml:"stimer"`
+ Reset *DomainFeatureState `xml:"reset"`
+ VendorId *DomainFeatureHyperVVendorId `xml:"vendor_id"`
}
type DomainFeatureKVM struct {
- DomainFeature
- Hidden *DomainFeature `xml:"hidden,omitempty"`
+ Hidden *DomainFeatureState `xml:"hidden"`
}
type DomainFeatureGIC struct {
- DomainFeature
Version string `xml:"version,attr,omitempty"`
}
type DomainFeatureList struct {
- PAE *DomainFeature `xml:"pae,omitempty"`
- ACPI *DomainFeature `xml:"acpi,omitempty"`
- APIC *DomainFeatureAPIC `xml:"apic,omitempty"`
- HAP *DomainFeature `xml:"hap,omitempty"`
- Viridian *DomainFeature `xml:"viridian,omitempty"`
- PrivNet *DomainFeature `xml:"privnet,omitempty"`
- HyperV *DomainFeatureHyperV `xml:"hyperv,omitempty"`
- KVM *DomainFeatureKVM `xml:"kvm,omitempty"`
- PVSpinlock *DomainFeature `xml:"pvspinlock,omitempty"`
- PMU *DomainFeature `xml:"pmu,omitempty"`
- VMPort *DomainFeature `xml:"vmport,omitempty"`
- GIC *DomainFeatureGIC `xml:"gic,omitempty"`
- SMM *DomainFeature `xml:"smm,omitempty"`
+ PAE *DomainFeature `xml:"pae"`
+ ACPI *DomainFeature `xml:"acpi"`
+ APIC *DomainFeatureAPIC `xml:"apic"`
+ HAP *DomainFeatureState `xml:"hap"`
+ Viridian *DomainFeature `xml:"viridian"`
+ PrivNet *DomainFeature `xml:"privnet"`
+ HyperV *DomainFeatureHyperV `xml:"hyperv"`
+ KVM *DomainFeatureKVM `xml:"kvm"`
+ PVSpinlock *DomainFeatureState `xml:"pvspinlock"`
+ PMU *DomainFeatureState `xml:"pmu"`
+ VMPort *DomainFeatureState `xml:"vmport"`
+ GIC *DomainFeatureGIC `xml:"gic"`
+ SMM *DomainFeatureState `xml:"smm"`
}
type Domain struct {
@@ -446,7 +446,7 @@ type Domain struct {
OnPoweroff string `xml:"on_poweroff,omitempty"`
OnReboot string `xml:"on_reboot,omitempty"`
OnCrash string `xml:"on_crash,omitempty"`
- Features *DomainFeatureList `xml:"features,omitempty"`
+ Features *DomainFeatureList `xml:"features"`
}
func (d *Domain) Unmarshal(doc string) error {
diff --git a/domain_test.go b/domain_test.go
index e25007e..11156c1 100644
--- a/domain_test.go
+++ b/domain_test.go
@@ -753,22 +753,26 @@ var domainTestData = []struct {
PAE: &DomainFeature{},
ACPI: &DomainFeature{},
APIC: &DomainFeatureAPIC{},
- HAP: &DomainFeature{},
+ HAP: &DomainFeatureState{},
PrivNet: &DomainFeature{},
HyperV: &DomainFeatureHyperV{
- Relaxed: &DomainFeature{State: "on"},
- VAPIC: &DomainFeature{State: "on"},
- Spinlocks: &DomainFeatureSpinlocks{DomainFeature{State: "on"}, 4096},
- VPIndex: &DomainFeature{State: "on"},
- Runtime: &DomainFeature{State: "on"},
- Synic: &DomainFeature{State: "on"},
- Reset: &DomainFeature{State: "on"},
- VendorId: &DomainFeatureVendorId{DomainFeature{State: "on"}, "KVM Hv"},
+ Relaxed: &DomainFeatureState{State: "on"},
+ VAPIC: &DomainFeatureState{State: "on"},
+ Spinlocks: &DomainFeatureHyperVSpinlocks{
+ DomainFeatureState{State: "on"}, 4096,
+ },
+ VPIndex: &DomainFeatureState{State: "on"},
+ Runtime: &DomainFeatureState{State: "on"},
+ Synic: &DomainFeatureState{State: "on"},
+ Reset: &DomainFeatureState{State: "on"},
+ VendorId: &DomainFeatureHyperVVendorId{
+ DomainFeatureState{State: "on"}, "KVM Hv",
+ },
},
KVM: &DomainFeatureKVM{
- Hidden: &DomainFeature{State: "on"},
+ Hidden: &DomainFeatureState{State: "on"},
},
- PVSpinlock: &DomainFeature{State: "on"},
+ PVSpinlock: &DomainFeatureState{State: "on"},
GIC: &DomainFeatureGIC{Version: "2"},
},
},
--
2.11.0
7 years, 6 months