[libvirt] Release of libvirt-4.5.0
by Daniel Veillard
As planned the release is out, it is tagged in git and I have pushed
the signed tarball and rpms to the usual place:
ftp://libvirt.org/libvirt/
I also made a release of the python bindings 4.5.0 also tagged in git with
signed tarball and rpms at:
ftp://libvirt.org/libvirt/python
This release has a distinct flavour around security, with one added feature
and improvement in that direction but also removal of some features which might
prove insecure. Beside that a potential crasher was fixed so user are invited
to update to this new version:
New features:
- qemu: Provide TPM emulator support
Support QEMU's TPM emulator based on swtpm. Each QEMU guest gets its
own virtual TPM.
- bhyve: Support specifying guest CPU topology
Bhyve's guest CPU topology could be specified using the <cpu><topology
../></cpu> element.
- qemu: Add support for extended TSEG size
Support specifying extended TSEG size for SMM in QEMU.
- qemu: Add support for SEV guests
SEV (Secure Encrypted Virtualization) is a feature available on AMD
CPUs that encrypts the guest memory and makes it inaccessible even to
the host OS.
Removed features:
- Remove support for qcow/default encrypted volumes
Disallow using a qcow encrypted volume for the guest and disallow
creation of the qcow or default encrypted volume from the storage
driver. Support for qcow encrypted volumes has been phasing out since
QEMU 2.3 and by QEMU 2.9 creation of a qcow encrypted volume via
qemu-img required usage of secret objects, but that support was never
added to libvirt.
- Make GnuTLS mandatory
Building without GnuTLS is no longer possible.
- qemu: Remove allow_disk_format_probing configuration option
The option represented a security risk when used with malicious disk
images, so users were recommended against enabling it; with this
release, it's been removed altogether.
Improvements:
- capabilities: Provide info about host IOMMU support
Capabilities XML now provide information about host IOMMU support.
- virsh: Add --all to domblkinfo command
Alter the domblkinfo command to add the option --all in order to
display the size details of each domain block device from one command
in a output table.
- qemu: Allow concurrent access to monitor and guest agent
Historically libvirt prevented concurrent accesses to the qemu monitor
and the guest agent. Therefore two independent calls (one querying the
monitor and the other querying guest agent) would serialize which hurts
performance. The code was reworked to allow two independent calls run
at the same time.
- qemu: Allow configuring the page size for HPT pSeries guests
For HPT pSeries guests, the size of the host pages used to back guest
memory and the usable guest page sizes are connected; the new setting
can be used to request that a certain page size is available in the
guest.
- Add support to use an raw input volume for encryption
It is now possible to provide a raw input volume as input for to
generate a luks encrypted volume via either virsh vol-create-from or
virStorageVolCreateXMLFrom.
- qemu: Add support for vsock hot (un)plug and cold (un)plug
- qemu: Add support for NBD over TLS
NBD volumes can now be accessed securely.
- qemu: Implement FD passing for Unix sockets
Instead of having QEMU open the socket and then connecting to it, which
is inherently racy, starting with QEMU 2.12 we can open the socket
ourselves and pass it to QEMU, avoiding race conditions.
- virsh: Introduce --nowait option for domstat command
When this option is specified, virsh will try to fetch the guest stats
but abort instead of stalling if they can't be retrieved right away.
Bug fixes:
- qemu: Fix a potential libvirtd crash on VM reconnect
Initialization of the driver worker pool needs to come before libvirtd
trying to reconnect to all machines, since one of the QEMU processes
migh have already emitted events which need to be handled prior to us
getting to the worker pool initialization.
- qemu: Fix domain resume after failed migration
Recent versions of QEMU activate block devices before the guest CPU has
been started, which makes it impossible to roll back a failed
migration. Use the late-block-activate migration capability if
supported to avoid the issue.
- vmx: Permit guests to have an odd number of vCPUs
An odd number of vCPUs greater than 1 was forbidden in the past, but
current versions of ESXi have lifted that restriction.
Thanks everybody for your contributions to this release, be it with
code, ideas, bug reports, patch reviews, documentation, etc...
Enjoy the release !
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/
6 years, 10 months
[libvirt] [PATCH] qemu: don't use chardev FD passing with standalone args
by Daniel P. Berrangé
When using domxml-to-native, we must generate CLI args that can be used
in a standalone scenario. This means no FD passing can be used. To
achieve this we must clear the QEMU_CAPS_CHARDEV_FD_PASS capability bit.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/qemu/qemu_process.c | 5 +++++
src/qemu/qemu_process.h | 2 ++
2 files changed, 7 insertions(+)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index ac32dafcbe..40d35cbe6b 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -5124,6 +5124,9 @@ qemuProcessInit(virQEMUDriverPtr driver,
vm->def->os.machine)))
goto cleanup;
+ if (flags & VIR_QEMU_PROCESS_START_STANDALONE)
+ virQEMUCapsClear(priv->qemuCaps, QEMU_CAPS_CHARDEV_FD_PASS);
+
if (qemuDomainUpdateCPU(vm, updatedCPU, &origCPU) < 0)
goto cleanup;
@@ -6632,6 +6635,8 @@ qemuProcessCreatePretendCmd(virQEMUDriverPtr driver,
flags |= VIR_QEMU_PROCESS_START_PRETEND;
flags |= VIR_QEMU_PROCESS_START_NEW;
+ if (standalone)
+ flags |= VIR_QEMU_PROCESS_START_STANDALONE;
if (qemuProcessInit(driver, vm, NULL, QEMU_ASYNC_JOB_NONE,
!!migrateURI, flags) < 0)
diff --git a/src/qemu/qemu_process.h b/src/qemu/qemu_process.h
index 531c2a0cc7..07ce3a9915 100644
--- a/src/qemu/qemu_process.h
+++ b/src/qemu/qemu_process.h
@@ -81,6 +81,8 @@ typedef enum {
VIR_QEMU_PROCESS_START_PRETEND = 1 << 3,
VIR_QEMU_PROCESS_START_NEW = 1 << 4, /* internal, new VM is starting */
VIR_QEMU_PROCESS_START_GEN_VMID = 1 << 5, /* Generate a new VMID */
+ VIR_QEMU_PROCESS_START_STANDALONE = 1 << 6, /* Require CLI args to be usable standalone,
+ ie no FD passing and the like */
} qemuProcessStartFlags;
int qemuProcessStart(virConnectPtr conn,
--
2.17.1
6 years, 10 months
[libvirt] [PATCH v2 0/2] {lxc, util}: Fix issues with NULL argument 'type' for mount().
by Julio Faracco
This serie fixes the argument 'type' of syscall mount(). Valgrind is
throwing an issue when that parameter 'type' of the syscall is NULL.
The best option to fix this issue is replace NULL to "none"
filesystem. For more details about the Valgrind bug, see the commit
message at 794b576c.
Julio Faracco (2):
lxc: moving 'type' argument to avoid issues with mount() syscall.
util: moving 'type' argument to avoid issues with mount() syscall.
src/lxc/lxc_container.c | 26 +++++++++++++-------------
src/util/vircgroup.c | 2 +-
2 files changed, 14 insertions(+), 14 deletions(-)
--
2.17.1
6 years, 10 months
[libvirt] [PATCH v3] qemu: format serial and geometry on frontend disk device
by Daniel P. Berrangé
Currently we format the serial, geometry and error policy on the -drive
backend argument.
QEMU added the ability to set serial and geometry on the frontend in
the 1.2 release deprecating use of -drive, with support being deleted
from -drive in 3.0.
We keep formatting error policy on -drive for now, because we don't
ahve support for that with -device for usb-storage just yet.
Note that some disk buses (sd) still don't support -device. Although
QEMU allowed these properties to be set on -drive for if=sd, they
have been ignored so we now report an error in this case.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
Changed in v3:
- Report error for setting CHS on USB
- Report error for setting CHS translation mode for bus != IDE
- Use 'bios-chs-trans' property not 'trans'
src/qemu/qemu_command.c | 46 ++++++++++++++++---
.../disk-drive-network-tlsx509.args | 12 ++---
.../disk-drive-network-vxhs.args | 4 +-
tests/qemuxml2argvdata/disk-drive-shared.args | 5 +-
tests/qemuxml2argvdata/disk-geometry.args | 6 +--
tests/qemuxml2argvdata/disk-ide-wwn.args | 5 +-
.../qemuxml2argvdata/disk-scsi-disk-wwn.args | 4 +-
tests/qemuxml2argvdata/disk-serial.args | 10 ++--
tests/qemuxml2argvdata/disk-serial.xml | 1 -
tests/qemuxml2xmloutdata/disk-serial.xml | 1 -
10 files changed, 62 insertions(+), 32 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 4fc3176ad3..46726b055e 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -1599,7 +1599,7 @@ qemuBuildDiskFrontendAttributeErrorPolicy(virDomainDiskDefPtr disk,
}
-static void
+static int
qemuBuildDiskFrontendAttributes(virDomainDiskDefPtr disk,
virBufferPtr buf)
{
@@ -1607,14 +1607,27 @@ qemuBuildDiskFrontendAttributes(virDomainDiskDefPtr disk,
if (disk->geometry.cylinders > 0 &&
disk->geometry.heads > 0 &&
disk->geometry.sectors > 0) {
+ if (disk->bus == VIR_DOMAIN_DISK_BUS_USB) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("CHS geometry can not be set for 'usb' bus"));
+ return -1;
+ }
+
virBufferAsprintf(buf, ",cyls=%u,heads=%u,secs=%u",
disk->geometry.cylinders,
disk->geometry.heads,
disk->geometry.sectors);
- if (disk->geometry.trans != VIR_DOMAIN_DISK_TRANS_DEFAULT)
- virBufferAsprintf(buf, ",trans=%s",
+ if (disk->geometry.trans != VIR_DOMAIN_DISK_TRANS_DEFAULT) {
+ if (disk->bus != VIR_DOMAIN_DISK_BUS_IDE) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("CHS translation mode can only be set for 'ide' bus not '%s'"),
+ virDomainDiskBusTypeToString(disk->bus));
+ return -1;
+ }
+ virBufferAsprintf(buf, ",bios-chs-trans=%s",
virDomainDiskGeometryTransTypeToString(disk->geometry.trans));
+ }
}
if (disk->serial) {
@@ -1622,7 +1635,7 @@ qemuBuildDiskFrontendAttributes(virDomainDiskDefPtr disk,
virBufferEscape(buf, '\\', " ", "%s", disk->serial);
}
- qemuBuildDiskFrontendAttributeErrorPolicy(disk, buf);
+ return 0;
}
@@ -1662,11 +1675,27 @@ qemuBuildDriveStr(virDomainDiskDefPtr disk,
virBufferAsprintf(&opt, "if=%s",
virDomainDiskQEMUBusTypeToString(disk->bus));
virBufferAsprintf(&opt, ",index=%d", idx);
+
+ if (disk->serial) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Serial property not supported for drive bus '%s'"),
+ virDomainDiskBusTypeToString(disk->bus));
+ goto error;
+ }
+ if (disk->geometry.cylinders > 0 &&
+ disk->geometry.heads > 0 &&
+ disk->geometry.sectors > 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Geometry not supported for drive bus '%s'"),
+ virDomainDiskBusTypeToString(disk->bus));
+ goto error;
+ }
}
- /* Format attributes for the drive itself (not the storage backing it) which
- * we've formatted historically with -drive */
- qemuBuildDiskFrontendAttributes(disk, &opt);
+ /* werror/rerror are really frontend attributes, but older
+ * qemu requires them on -drive instead of -device */
+ qemuBuildDiskFrontendAttributeErrorPolicy(disk, &opt);
+
/* While this is a frontend attribute, it only makes sense to be used when
* legacy -drive is used. In modern qemu the 'ide-cd' or 'scsi-cd' are used.
@@ -2125,6 +2154,9 @@ qemuBuildDriveDevStr(const virDomainDef *def,
if (qemuBuildDriveDevCacheStr(disk, &opt, qemuCaps) < 0)
goto error;
+ if (qemuBuildDiskFrontendAttributes(disk, &opt) < 0)
+ goto error;
+
if (virBufferCheckError(&opt) < 0)
goto error;
diff --git a/tests/qemuxml2argvdata/disk-drive-network-tlsx509.args b/tests/qemuxml2argvdata/disk-drive-network-tlsx509.args
index e25f45742c..b5e73064c0 100644
--- a/tests/qemuxml2argvdata/disk-drive-network-tlsx509.args
+++ b/tests/qemuxml2argvdata/disk-drive-network-tlsx509.args
@@ -28,22 +28,22 @@ server,nowait \
-drive file.driver=vxhs,file.tls-creds=objvirtio-disk0_tls0,\
file.vdisk-id=eb90327c-8302-4725-9e1b-4e85ed4dc251,\
file.server.host=192.168.0.1,file.server.port=9999,format=raw,if=none,\
-id=drive-virtio-disk0,serial=eb90327c-8302-4725-9e1b-4e85ed4dc251,cache=none \
+id=drive-virtio-disk0,cache=none \
-device virtio-blk-pci,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,\
-id=virtio-disk0 \
+id=virtio-disk0,serial=eb90327c-8302-4725-9e1b-4e85ed4dc251 \
-object tls-creds-x509,id=objvirtio-disk1_tls0,dir=/etc/pki/libvirt-vxhs/dummy,\
,path,endpoint=client,verify-peer=yes \
-drive file.driver=vxhs,file.tls-creds=objvirtio-disk1_tls0,\
file.vdisk-id=eb90327c-8302-4725-9e1b-4e85ed4dc252,\
file.server.host=192.168.0.2,file.server.port=9999,format=raw,if=none,\
-id=drive-virtio-disk1,serial=eb90327c-8302-4725-9e1b-4e85ed4dc252,cache=none \
+id=drive-virtio-disk1,cache=none \
-device virtio-blk-pci,bus=pci.0,addr=0x5,drive=drive-virtio-disk1,\
-id=virtio-disk1 \
+id=virtio-disk1,serial=eb90327c-8302-4725-9e1b-4e85ed4dc252 \
-drive file.driver=vxhs,file.vdisk-id=eb90327c-8302-4725-9e1b-4e85ed4dc253,\
file.server.host=192.168.0.3,file.server.port=9999,format=raw,if=none,\
-id=drive-virtio-disk2,serial=eb90327c-8302-4725-9e1b-4e85ed4dc252,cache=none \
+id=drive-virtio-disk2,cache=none \
-device virtio-blk-pci,bus=pci.0,addr=0x6,drive=drive-virtio-disk2,\
-id=virtio-disk2 \
+id=virtio-disk2,serial=eb90327c-8302-4725-9e1b-4e85ed4dc252 \
-object tls-creds-x509,id=objvirtio-disk3_tls0,dir=/etc/pki/libvirt-nbd/dummy,,\
path,endpoint=client,verify-peer=yes \
-drive file.driver=nbd,file.server.type=inet,file.server.host=example.com,\
diff --git a/tests/qemuxml2argvdata/disk-drive-network-vxhs.args b/tests/qemuxml2argvdata/disk-drive-network-vxhs.args
index c2a1d4681f..fad4dfd942 100644
--- a/tests/qemuxml2argvdata/disk-drive-network-vxhs.args
+++ b/tests/qemuxml2argvdata/disk-drive-network-vxhs.args
@@ -25,6 +25,6 @@ server,nowait \
-usb \
-drive file.driver=vxhs,file.vdisk-id=eb90327c-8302-4725-9e1b-4e85ed4dc251,\
file.server.host=192.168.0.1,file.server.port=9999,format=raw,if=none,\
-id=drive-virtio-disk0,serial=eb90327c-8302-4725-9e1b-4e85ed4dc251,cache=none \
+id=drive-virtio-disk0,cache=none \
-device virtio-blk-pci,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,\
-id=virtio-disk0
+id=virtio-disk0,serial=eb90327c-8302-4725-9e1b-4e85ed4dc251
diff --git a/tests/qemuxml2argvdata/disk-drive-shared.args b/tests/qemuxml2argvdata/disk-drive-shared.args
index 5306fdf750..032e86e291 100644
--- a/tests/qemuxml2argvdata/disk-drive-shared.args
+++ b/tests/qemuxml2argvdata/disk-drive-shared.args
@@ -23,8 +23,9 @@ server,nowait \
-boot c \
-usb \
-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0,\
-serial=XYZXYZXYZYXXYZYZYXYZY,cache=none \
--device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
+cache=none \
+-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,\
+serial=XYZXYZXYZYXXYZYZYXYZY \
-drive file=/dev/HostVG/QEMUGuest2,format=raw,if=none,id=drive-ide0-1-0,\
media=cdrom,readonly=on \
-device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 \
diff --git a/tests/qemuxml2argvdata/disk-geometry.args b/tests/qemuxml2argvdata/disk-geometry.args
index b173ab6407..f3e35b5f9e 100644
--- a/tests/qemuxml2argvdata/disk-geometry.args
+++ b/tests/qemuxml2argvdata/disk-geometry.args
@@ -22,7 +22,7 @@ server,nowait \
-no-acpi \
-boot c \
-usb \
--drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0,\
-cyls=16383,heads=16,secs=63,trans=lba \
--device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
+-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
+-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,cyls=16383,\
+heads=16,secs=63,bios-chs-trans=lba \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
diff --git a/tests/qemuxml2argvdata/disk-ide-wwn.args b/tests/qemuxml2argvdata/disk-ide-wwn.args
index e6d2758ec3..a0e3f06b68 100644
--- a/tests/qemuxml2argvdata/disk-ide-wwn.args
+++ b/tests/qemuxml2argvdata/disk-ide-wwn.args
@@ -22,8 +22,7 @@ server,nowait \
-no-acpi \
-boot c \
-usb \
--drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-1,\
-serial=WD-WMAP9A966149 \
+-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-1 \
-device ide-hd,bus=ide.0,unit=1,drive=drive-ide0-0-1,id=ide0-0-1,\
-wwn=0x5000c50015ea71ad \
+wwn=0x5000c50015ea71ad,serial=WD-WMAP9A966149 \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
diff --git a/tests/qemuxml2argvdata/disk-scsi-disk-wwn.args b/tests/qemuxml2argvdata/disk-scsi-disk-wwn.args
index 29607e8927..6407fd002d 100644
--- a/tests/qemuxml2argvdata/disk-scsi-disk-wwn.args
+++ b/tests/qemuxml2argvdata/disk-scsi-disk-wwn.args
@@ -25,9 +25,9 @@ server,nowait \
-device lsi,id=scsi1,bus=pci.0,addr=0x4 \
-usb \
-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-scsi0-0-1-0,\
-serial=WD-WMAP9A966149,readonly=on \
+readonly=on \
-device scsi-cd,bus=scsi0.0,channel=0,scsi-id=1,lun=0,drive=drive-scsi0-0-1-0,\
-id=scsi0-0-1-0,wwn=0x5000c50015ea71ac \
+id=scsi0-0-1-0,wwn=0x5000c50015ea71ac,serial=WD-WMAP9A966149 \
-drive file=/dev/HostVG/QEMUGuest2,format=raw,if=none,id=drive-scsi0-0-0-0 \
-device scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,\
id=scsi0-0-0-0,wwn=0x5000c50015ea71ad \
diff --git a/tests/qemuxml2argvdata/disk-serial.args b/tests/qemuxml2argvdata/disk-serial.args
index 88310b009f..5892f64c29 100644
--- a/tests/qemuxml2argvdata/disk-serial.args
+++ b/tests/qemuxml2argvdata/disk-serial.args
@@ -22,11 +22,11 @@ server,nowait \
-no-acpi \
-boot c \
-usb \
--drive 'file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-1,\
+-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-1 \
+-device 'ide-drive,bus=ide.0,unit=1,drive=drive-ide0-0-1,id=ide0-0-1,\
serial=\ \ WD-WMAP9A966149' \
--device ide-drive,bus=ide.0,unit=1,drive=drive-ide0-0-1,id=ide0-0-1 \
--drive 'file=/dev/HostVG/AllSerialChars,format=raw,if=none,id=drive-ide0-0-2,\
+-drive file=/dev/HostVG/AllSerialChars,format=raw,if=none,id=drive-ide0-0-2 \
+-device 'ide-drive,bus=ide.0,unit=2,drive=drive-ide0-0-2,id=ide0-0-2,\
serial=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_\ .+' \
--device ide-drive,bus=ide.0,unit=2,drive=drive-ide0-0-2,id=ide0-0-2 \
--drive file=/some/file,format=raw,if=sd,index=0,serial=sdserial \
+-drive file=/some/file,format=raw,if=sd,index=0 \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
diff --git a/tests/qemuxml2argvdata/disk-serial.xml b/tests/qemuxml2argvdata/disk-serial.xml
index ea71f2c339..18e72bb4ba 100644
--- a/tests/qemuxml2argvdata/disk-serial.xml
+++ b/tests/qemuxml2argvdata/disk-serial.xml
@@ -29,7 +29,6 @@
<disk type='file' device='disk'>
<source file='/some/file'/>
<target dev='sda' bus='sd'/>
- <serial>sdserial</serial>
</disk>
<controller type='usb' index='0'/>
<controller type='ide' index='0'/>
diff --git a/tests/qemuxml2xmloutdata/disk-serial.xml b/tests/qemuxml2xmloutdata/disk-serial.xml
index 9313c699b6..a803cd959c 100644
--- a/tests/qemuxml2xmloutdata/disk-serial.xml
+++ b/tests/qemuxml2xmloutdata/disk-serial.xml
@@ -32,7 +32,6 @@
<driver name='qemu' type='raw'/>
<source file='/some/file'/>
<target dev='sda' bus='sd'/>
- <serial>sdserial</serial>
</disk>
<controller type='usb' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
--
2.17.1
6 years, 10 months
[libvirt] [PATCH] util: return generic error in virCopyLastError if error is not set
by Nikolay Shirokovskiy
virCopyLastError is intended to be used after last error is set.
However due to virLastErrorObject failures (very unlikely through
as thread local error is allocated on first use) we can have zero
fields in a copy as a result. In particular code field can be set
to VIR_ERR_OK.
In some places (qemu monitor, qemu agent and qemu migaration code
for example) we use copy result as a flag and this leads to bugs.
Let's set copy result to generic error ("cause unknown") in this case.
Approach is based on John Ferlan comments in [1] and [2] to initial
attempt which fixes issue in much less generic way.
[1] https://www.redhat.com/archives/libvir-list/2018-April/msg02700.html
[2] https://www.redhat.com/archives/libvir-list/2018-May/msg00124.html
---
src/util/virerror.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/util/virerror.c b/src/util/virerror.c
index c000b00..9f158af 100644
--- a/src/util/virerror.c
+++ b/src/util/virerror.c
@@ -343,7 +343,7 @@ virCopyLastError(virErrorPtr to)
if (err)
virCopyError(err, to);
else
- virResetError(to);
+ virErrorGenericFailure(err);
return to->code;
}
--
1.8.3.1
6 years, 10 months
[libvirt] [PATCH v3 0/3] Implement the HTM pSeries feature
by Andrea Bolognani
Applies cleanly on top of aa51063927a0d48768ff88b11f12075ad5efc89f.
Changes from [v2]:
* rebase on top of master; the series is much smaller now.
Changes from [v1]:
* drop qom-list-properties machinery, as equivalent functionality
has been merged in the meantime;
* don't introduce scaffolding for uniform machine option handling
as a requirement for implementing this specific feature: we can
do ad-hoc processing for now, per the status quo, then clean up
everything (including existing features) with a separate series
later.
Changes from [RFC v3]:
* can be considered for merging, since the QEMU part already has;
* fix compatibility issues with QEMU <2.12 spotted by Shivaprasad;
* drop all features except for HTM, at least for the time being;
* add documentation.
Changes from [RFC v2]:
* use qom-list-properties to probe availability;
* test all features with a single XML file.
Changes from [RFC v1]:
* don't nest features inside a <pseries/> element;
* implement all optional features.
[v2] https://www.redhat.com/archives/libvir-list/2018-June/msg01374.html
[v1] https://www.redhat.com/archives/libvir-list/2018-March/msg00474.html
[RFC v3] https://www.redhat.com/archives/libvir-list/2018-March/msg00042.html
[RFC v2] https://www.redhat.com/archives/libvir-list/2018-February/msg00310.html
[RFC v1] https://www.redhat.com/archives/libvir-list/2018-January/msg00779.html
Andrea Bolognani (3):
qemu: Add capability for the HTM pSeries feature
qemu: Implement the HTM pSeries feature
news: Update for the HTM pSeries feature
docs/formatdomain.html.in | 8 ++++++++
docs/news.xml | 9 +++++++++
docs/schemas/domaincommon.rng | 5 +++++
src/conf/domain_conf.c | 19 ++++++++++++++++++
src/conf/domain_conf.h | 1 +
src/qemu/qemu_capabilities.c | 2 ++
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 20 +++++++++++++++++++
src/qemu/qemu_domain.c | 13 ++++++++++++
.../caps_2.12.0.ppc64.xml | 1 +
.../qemucapabilitiesdata/caps_3.0.0.ppc64.xml | 1 +
tests/qemuxml2argvdata/pseries-features.args | 2 +-
tests/qemuxml2argvdata/pseries-features.xml | 1 +
tests/qemuxml2argvtest.c | 1 +
tests/qemuxml2xmloutdata/pseries-features.xml | 1 +
tests/qemuxml2xmltest.c | 1 +
16 files changed, 85 insertions(+), 1 deletion(-)
--
2.17.1
6 years, 10 months
[libvirt] [jenkins-ci PATCH] projects: libvirt-dbus uses xz now
by Andrea Bolognani
Since commit 28ad40b3d4ab, libvirt-dbus uses xz rather than
gzip to compress release archives. Adapt to the change.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
projects/libvirt-dbus.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/projects/libvirt-dbus.yaml b/projects/libvirt-dbus.yaml
index c460db4..eaf5a61 100644
--- a/projects/libvirt-dbus.yaml
+++ b/projects/libvirt-dbus.yaml
@@ -2,6 +2,7 @@
- project:
name: libvirt-dbus
title: Libvirt D-Bus
+ archive_format: xz
jobs:
- autotools-build-job:
parent_jobs: 'libvirt-glib-master-build'
--
2.17.1
6 years, 10 months
[libvirt] [PATCH v2] qemu: format serial and geometry on frontend disk device
by Daniel P. Berrangé
Currently we format the serial, geometry and error policy on the -drive
backend argument.
QEMU added the ability to set serial and geometry on the frontend in
the 1.2 release deprecating use of -drive, with support being deleted
from -drive in 3.0.
We keep formatting error policy on -drive for now, because we don't
ahve support for that with -device for usb-storage just yet.
Note that some disk buses (sd) still don't support -device. Although
QEMU allowed these properties to be set on -drive for if=sd, they
have been ignored so we now report an error in this case.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/qemu/qemu_command.c | 26 +++++++++++++++----
.../disk-drive-network-tlsx509.args | 12 ++++-----
.../disk-drive-network-vxhs.args | 4 +--
tests/qemuxml2argvdata/disk-drive-shared.args | 5 ++--
tests/qemuxml2argvdata/disk-geometry.args | 6 ++---
tests/qemuxml2argvdata/disk-ide-wwn.args | 5 ++--
.../qemuxml2argvdata/disk-scsi-disk-wwn.args | 4 +--
tests/qemuxml2argvdata/disk-serial.args | 10 +++----
tests/qemuxml2argvdata/disk-serial.xml | 1 -
tests/qemuxml2xmloutdata/disk-serial.xml | 1 -
10 files changed, 44 insertions(+), 30 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 4fc3176ad3..86d4b10f74 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -1621,8 +1621,6 @@ qemuBuildDiskFrontendAttributes(virDomainDiskDefPtr disk,
virBufferAddLit(buf, ",serial=");
virBufferEscape(buf, '\\', " ", "%s", disk->serial);
}
-
- qemuBuildDiskFrontendAttributeErrorPolicy(disk, buf);
}
@@ -1662,11 +1660,27 @@ qemuBuildDriveStr(virDomainDiskDefPtr disk,
virBufferAsprintf(&opt, "if=%s",
virDomainDiskQEMUBusTypeToString(disk->bus));
virBufferAsprintf(&opt, ",index=%d", idx);
+
+ if (disk->serial) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Serial property not supported for drive bus '%s'"),
+ virDomainDiskBusTypeToString(disk->bus));
+ goto error;
+ }
+ if (disk->geometry.cylinders > 0 &&
+ disk->geometry.heads > 0 &&
+ disk->geometry.sectors > 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Geometry not supported for drive bus '%s'"),
+ virDomainDiskBusTypeToString(disk->bus));
+ goto error;
+ }
}
- /* Format attributes for the drive itself (not the storage backing it) which
- * we've formatted historically with -drive */
- qemuBuildDiskFrontendAttributes(disk, &opt);
+ /* werror/rerror are really frontend attributes, but older
+ * qemu requires them on -drive instead of -device */
+ qemuBuildDiskFrontendAttributeErrorPolicy(disk, &opt);
+
/* While this is a frontend attribute, it only makes sense to be used when
* legacy -drive is used. In modern qemu the 'ide-cd' or 'scsi-cd' are used.
@@ -2125,6 +2139,8 @@ qemuBuildDriveDevStr(const virDomainDef *def,
if (qemuBuildDriveDevCacheStr(disk, &opt, qemuCaps) < 0)
goto error;
+ qemuBuildDiskFrontendAttributes(disk, &opt);
+
if (virBufferCheckError(&opt) < 0)
goto error;
diff --git a/tests/qemuxml2argvdata/disk-drive-network-tlsx509.args b/tests/qemuxml2argvdata/disk-drive-network-tlsx509.args
index e25f45742c..b5e73064c0 100644
--- a/tests/qemuxml2argvdata/disk-drive-network-tlsx509.args
+++ b/tests/qemuxml2argvdata/disk-drive-network-tlsx509.args
@@ -28,22 +28,22 @@ server,nowait \
-drive file.driver=vxhs,file.tls-creds=objvirtio-disk0_tls0,\
file.vdisk-id=eb90327c-8302-4725-9e1b-4e85ed4dc251,\
file.server.host=192.168.0.1,file.server.port=9999,format=raw,if=none,\
-id=drive-virtio-disk0,serial=eb90327c-8302-4725-9e1b-4e85ed4dc251,cache=none \
+id=drive-virtio-disk0,cache=none \
-device virtio-blk-pci,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,\
-id=virtio-disk0 \
+id=virtio-disk0,serial=eb90327c-8302-4725-9e1b-4e85ed4dc251 \
-object tls-creds-x509,id=objvirtio-disk1_tls0,dir=/etc/pki/libvirt-vxhs/dummy,\
,path,endpoint=client,verify-peer=yes \
-drive file.driver=vxhs,file.tls-creds=objvirtio-disk1_tls0,\
file.vdisk-id=eb90327c-8302-4725-9e1b-4e85ed4dc252,\
file.server.host=192.168.0.2,file.server.port=9999,format=raw,if=none,\
-id=drive-virtio-disk1,serial=eb90327c-8302-4725-9e1b-4e85ed4dc252,cache=none \
+id=drive-virtio-disk1,cache=none \
-device virtio-blk-pci,bus=pci.0,addr=0x5,drive=drive-virtio-disk1,\
-id=virtio-disk1 \
+id=virtio-disk1,serial=eb90327c-8302-4725-9e1b-4e85ed4dc252 \
-drive file.driver=vxhs,file.vdisk-id=eb90327c-8302-4725-9e1b-4e85ed4dc253,\
file.server.host=192.168.0.3,file.server.port=9999,format=raw,if=none,\
-id=drive-virtio-disk2,serial=eb90327c-8302-4725-9e1b-4e85ed4dc252,cache=none \
+id=drive-virtio-disk2,cache=none \
-device virtio-blk-pci,bus=pci.0,addr=0x6,drive=drive-virtio-disk2,\
-id=virtio-disk2 \
+id=virtio-disk2,serial=eb90327c-8302-4725-9e1b-4e85ed4dc252 \
-object tls-creds-x509,id=objvirtio-disk3_tls0,dir=/etc/pki/libvirt-nbd/dummy,,\
path,endpoint=client,verify-peer=yes \
-drive file.driver=nbd,file.server.type=inet,file.server.host=example.com,\
diff --git a/tests/qemuxml2argvdata/disk-drive-network-vxhs.args b/tests/qemuxml2argvdata/disk-drive-network-vxhs.args
index c2a1d4681f..fad4dfd942 100644
--- a/tests/qemuxml2argvdata/disk-drive-network-vxhs.args
+++ b/tests/qemuxml2argvdata/disk-drive-network-vxhs.args
@@ -25,6 +25,6 @@ server,nowait \
-usb \
-drive file.driver=vxhs,file.vdisk-id=eb90327c-8302-4725-9e1b-4e85ed4dc251,\
file.server.host=192.168.0.1,file.server.port=9999,format=raw,if=none,\
-id=drive-virtio-disk0,serial=eb90327c-8302-4725-9e1b-4e85ed4dc251,cache=none \
+id=drive-virtio-disk0,cache=none \
-device virtio-blk-pci,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,\
-id=virtio-disk0
+id=virtio-disk0,serial=eb90327c-8302-4725-9e1b-4e85ed4dc251
diff --git a/tests/qemuxml2argvdata/disk-drive-shared.args b/tests/qemuxml2argvdata/disk-drive-shared.args
index 5306fdf750..032e86e291 100644
--- a/tests/qemuxml2argvdata/disk-drive-shared.args
+++ b/tests/qemuxml2argvdata/disk-drive-shared.args
@@ -23,8 +23,9 @@ server,nowait \
-boot c \
-usb \
-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0,\
-serial=XYZXYZXYZYXXYZYZYXYZY,cache=none \
--device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
+cache=none \
+-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,\
+serial=XYZXYZXYZYXXYZYZYXYZY \
-drive file=/dev/HostVG/QEMUGuest2,format=raw,if=none,id=drive-ide0-1-0,\
media=cdrom,readonly=on \
-device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 \
diff --git a/tests/qemuxml2argvdata/disk-geometry.args b/tests/qemuxml2argvdata/disk-geometry.args
index b173ab6407..db0c7fb561 100644
--- a/tests/qemuxml2argvdata/disk-geometry.args
+++ b/tests/qemuxml2argvdata/disk-geometry.args
@@ -22,7 +22,7 @@ server,nowait \
-no-acpi \
-boot c \
-usb \
--drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0,\
-cyls=16383,heads=16,secs=63,trans=lba \
--device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
+-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
+-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,cyls=16383,\
+heads=16,secs=63,trans=lba \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
diff --git a/tests/qemuxml2argvdata/disk-ide-wwn.args b/tests/qemuxml2argvdata/disk-ide-wwn.args
index e6d2758ec3..a0e3f06b68 100644
--- a/tests/qemuxml2argvdata/disk-ide-wwn.args
+++ b/tests/qemuxml2argvdata/disk-ide-wwn.args
@@ -22,8 +22,7 @@ server,nowait \
-no-acpi \
-boot c \
-usb \
--drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-1,\
-serial=WD-WMAP9A966149 \
+-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-1 \
-device ide-hd,bus=ide.0,unit=1,drive=drive-ide0-0-1,id=ide0-0-1,\
-wwn=0x5000c50015ea71ad \
+wwn=0x5000c50015ea71ad,serial=WD-WMAP9A966149 \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
diff --git a/tests/qemuxml2argvdata/disk-scsi-disk-wwn.args b/tests/qemuxml2argvdata/disk-scsi-disk-wwn.args
index 29607e8927..6407fd002d 100644
--- a/tests/qemuxml2argvdata/disk-scsi-disk-wwn.args
+++ b/tests/qemuxml2argvdata/disk-scsi-disk-wwn.args
@@ -25,9 +25,9 @@ server,nowait \
-device lsi,id=scsi1,bus=pci.0,addr=0x4 \
-usb \
-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-scsi0-0-1-0,\
-serial=WD-WMAP9A966149,readonly=on \
+readonly=on \
-device scsi-cd,bus=scsi0.0,channel=0,scsi-id=1,lun=0,drive=drive-scsi0-0-1-0,\
-id=scsi0-0-1-0,wwn=0x5000c50015ea71ac \
+id=scsi0-0-1-0,wwn=0x5000c50015ea71ac,serial=WD-WMAP9A966149 \
-drive file=/dev/HostVG/QEMUGuest2,format=raw,if=none,id=drive-scsi0-0-0-0 \
-device scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0-0-0-0,\
id=scsi0-0-0-0,wwn=0x5000c50015ea71ad \
diff --git a/tests/qemuxml2argvdata/disk-serial.args b/tests/qemuxml2argvdata/disk-serial.args
index 88310b009f..5892f64c29 100644
--- a/tests/qemuxml2argvdata/disk-serial.args
+++ b/tests/qemuxml2argvdata/disk-serial.args
@@ -22,11 +22,11 @@ server,nowait \
-no-acpi \
-boot c \
-usb \
--drive 'file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-1,\
+-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-1 \
+-device 'ide-drive,bus=ide.0,unit=1,drive=drive-ide0-0-1,id=ide0-0-1,\
serial=\ \ WD-WMAP9A966149' \
--device ide-drive,bus=ide.0,unit=1,drive=drive-ide0-0-1,id=ide0-0-1 \
--drive 'file=/dev/HostVG/AllSerialChars,format=raw,if=none,id=drive-ide0-0-2,\
+-drive file=/dev/HostVG/AllSerialChars,format=raw,if=none,id=drive-ide0-0-2 \
+-device 'ide-drive,bus=ide.0,unit=2,drive=drive-ide0-0-2,id=ide0-0-2,\
serial=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_\ .+' \
--device ide-drive,bus=ide.0,unit=2,drive=drive-ide0-0-2,id=ide0-0-2 \
--drive file=/some/file,format=raw,if=sd,index=0,serial=sdserial \
+-drive file=/some/file,format=raw,if=sd,index=0 \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
diff --git a/tests/qemuxml2argvdata/disk-serial.xml b/tests/qemuxml2argvdata/disk-serial.xml
index ea71f2c339..18e72bb4ba 100644
--- a/tests/qemuxml2argvdata/disk-serial.xml
+++ b/tests/qemuxml2argvdata/disk-serial.xml
@@ -29,7 +29,6 @@
<disk type='file' device='disk'>
<source file='/some/file'/>
<target dev='sda' bus='sd'/>
- <serial>sdserial</serial>
</disk>
<controller type='usb' index='0'/>
<controller type='ide' index='0'/>
diff --git a/tests/qemuxml2xmloutdata/disk-serial.xml b/tests/qemuxml2xmloutdata/disk-serial.xml
index 9313c699b6..a803cd959c 100644
--- a/tests/qemuxml2xmloutdata/disk-serial.xml
+++ b/tests/qemuxml2xmloutdata/disk-serial.xml
@@ -32,7 +32,6 @@
<driver name='qemu' type='raw'/>
<source file='/some/file'/>
<target dev='sda' bus='sd'/>
- <serial>sdserial</serial>
</disk>
<controller type='usb' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
--
2.17.1
6 years, 10 months