[libvirt] [PATCH 1/3] esx_vi.c: Simplify error handling in MachineByName
by Marcos Paulo de Souza
The same pattern is used in lots of other places.
Signed-off-by: Marcos Paulo de Souza <marcos.souza.org(a)gmail.com>
---
src/esx/esx_vi.c | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/src/esx/esx_vi.c b/src/esx/esx_vi.c
index 43ff7ea048..25fbdc7e44 100644
--- a/src/esx/esx_vi.c
+++ b/src/esx/esx_vi.c
@@ -3014,16 +3014,10 @@ esxVI_LookupVirtualMachineByName(esxVI_Context *ctx, const char *name,
break;
}
- if (!(*virtualMachine)) {
- if (occurrence == esxVI_Occurrence_OptionalItem) {
- result = 0;
-
- goto cleanup;
- } else {
- virReportError(VIR_ERR_NO_DOMAIN,
- _("Could not find domain with name '%s'"), name);
- goto cleanup;
- }
+ if (!(*virtualMachine) && occurrence != esxVI_Occurrence_OptionalItem) {
+ virReportError(VIR_ERR_NO_DOMAIN,
+ _("Could not find domain with name '%s'"), name);
+ goto cleanup;
}
result = 0;
--
2.17.1
6 years, 5 months
[libvirt] [PATCH 0/5] viriscsi: Couple of fixes
by Michal Privoznik
I've noticed that I'm unable to start my iscsi pool if I put my
own IQN into the pool XML. This is very surprising because
iscsiadm would read it from initiatorname.conf file, right? Well,
no. If IQN is provided in pool XML the code calls slightly
different iscsiadm commands (e.g. to set up iSCSI interface) and
we don't pass the interface everywhere we should.
Michal Privoznik (5):
virStorageBackendIQNFound: Fix ret value assignment
virStorageBackendIQNFound: Rename out label
virStorageBackendIQNFound: Rework iscsiadm output parsing
virISCSIScanTargets: Honour iSCSI interface
virISCSIScanTargets: Allow making targets persistent
src/storage/storage_backend_iscsi.c | 5 +-
src/util/viriscsi.c | 197 +++++++++++++++++++++++-------------
src/util/viriscsi.h | 2 +
tests/viriscsitest.c | 3 +-
4 files changed, 137 insertions(+), 70 deletions(-)
--
2.16.4
6 years, 5 months
[libvirt] [PATCH] qemuOpenFileAs: Lose bypassSecurityDriver
by Michal Privoznik
This argument is not used anymore. The only function that is
passing non-NULL (qemuDomainSaveMemory) does not actually care
for the value (after 23087cfdb) and every other caller just
passes NULL anyway.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_driver.c | 32 +++++++++-----------------------
1 file changed, 9 insertions(+), 23 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 825b2b27e6..9a35e04a85 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -152,7 +152,7 @@ static int qemuDomainManagedSaveLoad(virDomainObjPtr vm,
static int qemuOpenFileAs(uid_t fallback_uid, gid_t fallback_gid,
bool dynamicOwnership,
const char *path, int oflags,
- bool *needUnlink, bool *bypassSecurityDriver);
+ bool *needUnlink);
static int qemuGetDHCPInterfaces(virDomainPtr dom,
virDomainObjPtr vm,
@@ -2984,9 +2984,6 @@ qemuCompressGetCommand(virQEMUSaveFormat compression)
* @path: path to file to open
* @oflags: flags for opening/creation of the file
* @needUnlink: set to true if file was created by this function
- * @bypassSecurityDriver: optional pointer to a boolean that will be set to true
- * if security driver operations are pointless (due to
- * NFS mount)
*
* Internal function to properly create or open existing files, with
* ownership affected by qemu driver setup and domain DAC label.
@@ -3001,8 +2998,7 @@ qemuOpenFile(virQEMUDriverPtr driver,
virDomainObjPtr vm,
const char *path,
int oflags,
- bool *needUnlink,
- bool *bypassSecurityDriver)
+ bool *needUnlink)
{
int ret = -1;
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
@@ -3021,7 +3017,7 @@ qemuOpenFile(virQEMUDriverPtr driver,
goto cleanup;
ret = qemuOpenFileAs(user, group, dynamicOwnership,
- path, oflags, needUnlink, bypassSecurityDriver);
+ path, oflags, needUnlink);
cleanup:
return ret;
@@ -3031,12 +3027,11 @@ static int
qemuOpenFileAs(uid_t fallback_uid, gid_t fallback_gid,
bool dynamicOwnership,
const char *path, int oflags,
- bool *needUnlink, bool *bypassSecurityDriver)
+ bool *needUnlink)
{
struct stat sb;
bool is_reg = true;
bool need_unlink = false;
- bool bypass_security = false;
unsigned int vfoflags = 0;
int fd = -1;
int path_shared = virFileIsSharedFS(path);
@@ -3134,19 +3129,11 @@ qemuOpenFileAs(uid_t fallback_uid, gid_t fallback_gid,
path);
goto cleanup;
}
-
- /* Since we had to setuid to create the file, and the fstype
- is NFS, we assume it's a root-squashing NFS share, and that
- the security driver stuff would have failed anyway */
-
- bypass_security = true;
}
}
cleanup:
if (needUnlink)
*needUnlink = need_unlink;
- if (bypassSecurityDriver)
- *bypassSecurityDriver = bypass_security;
return fd;
error:
@@ -3198,7 +3185,6 @@ qemuDomainSaveMemory(virQEMUDriverPtr driver,
unsigned int flags,
qemuDomainAsyncJob asyncJob)
{
- bool bypassSecurityDriver = false;
bool needUnlink = false;
int ret = -1;
int fd = -1;
@@ -3218,7 +3204,7 @@ qemuDomainSaveMemory(virQEMUDriverPtr driver,
}
fd = qemuOpenFile(driver, vm, path,
O_WRONLY | O_TRUNC | O_CREAT | directFlag,
- &needUnlink, &bypassSecurityDriver);
+ &needUnlink);
if (fd < 0)
goto cleanup;
@@ -3249,7 +3235,7 @@ qemuDomainSaveMemory(virQEMUDriverPtr driver,
if (qemuFileWrapperFDClose(vm, wrapperFd) < 0)
goto cleanup;
- if ((fd = qemuOpenFile(driver, vm, path, O_WRONLY, NULL, NULL)) < 0 ||
+ if ((fd = qemuOpenFile(driver, vm, path, O_WRONLY, NULL)) < 0 ||
virQEMUSaveDataFinish(data, &fd, path) < 0)
goto cleanup;
@@ -3809,7 +3795,7 @@ doCoreDump(virQEMUDriverPtr driver,
* created. */
if ((fd = qemuOpenFile(driver, vm, path,
O_CREAT | O_TRUNC | O_WRONLY | directFlag,
- NULL, NULL)) < 0)
+ NULL)) < 0)
goto cleanup;
if (!(wrapperFd = virFileWrapperFdNew(&fd, path, flags)))
@@ -6419,7 +6405,7 @@ qemuDomainSaveImageOpen(virQEMUDriverPtr driver,
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
goto error;
- if ((fd = qemuOpenFile(driver, NULL, path, oflags, NULL, NULL)) < 0)
+ if ((fd = qemuOpenFile(driver, NULL, path, oflags, NULL)) < 0)
goto error;
if (bypass_cache &&
!(*wrapperFd = virFileWrapperFdNew(&fd, path,
@@ -11863,7 +11849,7 @@ qemuDomainStorageOpenStat(virQEMUDriverPtr driver,
{
if (virStorageSourceIsLocalStorage(src)) {
if ((*ret_fd = qemuOpenFile(driver, vm, src->path, O_RDONLY,
- NULL, NULL)) < 0)
+ NULL)) < 0)
return -1;
if (fstat(*ret_fd, ret_sb) < 0) {
--
2.16.4
6 years, 5 months
[libvirt] [PATCH v4] 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 v4:
- Move error checks to post parse validator
src/qemu/qemu_command.c | 13 ++++-----
src/qemu/qemu_domain.c | 27 +++++++++++++++++++
.../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 -
11 files changed, 57 insertions(+), 31 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 70acbde80a..04c5c28438 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -1613,7 +1613,7 @@ qemuBuildDiskFrontendAttributes(virDomainDiskDefPtr disk,
disk->geometry.sectors);
if (disk->geometry.trans != VIR_DOMAIN_DISK_TRANS_DEFAULT)
- virBufferAsprintf(buf, ",trans=%s",
+ virBufferAsprintf(buf, ",bios-chs-trans=%s",
virDomainDiskGeometryTransTypeToString(disk->geometry.trans));
}
@@ -1621,8 +1621,6 @@ qemuBuildDiskFrontendAttributes(virDomainDiskDefPtr disk,
virBufferAddLit(buf, ",serial=");
virBufferEscape(buf, '\\', " ", "%s", disk->serial);
}
-
- qemuBuildDiskFrontendAttributeErrorPolicy(disk, buf);
}
@@ -1664,9 +1662,10 @@ qemuBuildDriveStr(virDomainDiskDefPtr disk,
virBufferAsprintf(&opt, ",index=%d", idx);
}
- /* 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 +2124,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/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index e671656121..a60bca29ca 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -4657,6 +4657,33 @@ qemuDomainDeviceDefValidateDisk(const virDomainDiskDef *disk,
}
}
+ if (disk->geometry.cylinders > 0 &&
+ disk->geometry.heads > 0 &&
+ disk->geometry.sectors > 0) {
+ if (disk->bus == VIR_DOMAIN_DISK_BUS_USB ||
+ disk->bus == VIR_DOMAIN_DISK_BUS_SD) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("CHS geometry can not be set for '%s' bus"),
+ virDomainDiskBusTypeToString(disk->bus));
+ return -1;
+ }
+
+ if (disk->geometry.trans != VIR_DOMAIN_DISK_TRANS_DEFAULT &&
+ 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;
+ }
+ }
+
+ if (disk->serial && disk->bus == VIR_DOMAIN_DISK_BUS_SD) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Serial property not supported for drive bus '%s'"),
+ virDomainDiskBusTypeToString(disk->bus));
+ return -1;
+ }
+
if (driverName && STRNEQ(driverName, "qemu")) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("unsupported driver name '%s' for disk '%s'"),
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, 5 months
[libvirt] [PATCH 00/25] util:Fix with process number and pid file do not match
by dubo163
Andrea Bolognani (5):
news: Update for 4.5.0 release
qemu: Add capability for the HTM pSeries feature
conf: Parse and format the HTM pSeries feature
qemu: Format the HTM pSeries feature
news: Update for the HTM pSeries feature
Anya Harter (2):
domain_addr: delete virDomainCCWAddressReleaseAddr
domain_addr: delete virDomainVirtioSerialAddrRelease
Daniel Veillard (1):
Release of libvirt-4.5.0
Jiri Denemark (2):
qemu_migration: Rename 'offline' variable in SrcPerformPeer2Peer
qemu_migration: Check for active domain after talking to remote daemon
John Ferlan (3):
Post-release version bump to 4.6.0
lxc: Remove FORCE flag from lxcDomainUpdateDeviceFlags
lxc: Rearrange order in lxcDomainUpdateDeviceFlags
Julio Faracco (2):
lxc: moving 'type' argument to avoid issues with mount() syscall.
util: moving 'type' argument to avoid issues with mount() syscall.
Laine Stump (3):
util: new function virNetDevOpenvswitchInterfaceGetMaster()
util: add some debug log to virNetDevGetMaster
network: properly check for taps that are connected to an OVS bridge
Marcos Paulo de Souza (1):
esx_driver: Simplify IsEncrypted and IsSecure
Michal Privoznik (2):
qemuDomainDeviceDefValidateNetwork: Check for range only if IP prefix
set
virsh: Provide completer for detach-device-alias
Peter Krempa (3):
qemu: domain: update only newly detected images in
qemuDomainDetermineDiskChain
tests: qemumonitorjson: Add only required replies for blockstats test
tests: qemumonitorjson: Fix name and call apropriate API
dubo163 (1):
util:Fix with process number and pid file do not match
configure.ac | 2 +-
docs/formatdomain.html.in | 8 ++
docs/news.xml | 100 ++++++++++++++++++++++-
docs/schemas/domaincommon.rng | 5 ++
src/conf/domain_addr.c | 68 ---------------
src/conf/domain_addr.h | 8 --
src/conf/domain_conf.c | 19 +++++
src/conf/domain_conf.h | 1 +
src/esx/esx_driver.c | 12 +--
src/libvirt_private.syms | 3 +-
src/lxc/lxc_container.c | 26 +++---
src/lxc/lxc_driver.c | 66 +++++----------
src/network/bridge_driver.c | 21 ++++-
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 20 +++++
src/qemu/qemu_domain.c | 32 +++++++-
src/qemu/qemu_domain.h | 5 +-
src/qemu/qemu_migration.c | 60 +++++++-------
src/util/vircgroup.c | 2 +-
src/util/virnetdev.c | 1 +
src/util/virnetdevopenvswitch.c | 56 +++++++++++++
src/util/virnetdevopenvswitch.h | 6 ++
src/util/virpidfile.c | 8 ++
tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml | 1 +
tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml | 1 +
tests/qemumonitorjsontest.c | 19 ++---
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 +
tools/virsh-completer.c | 48 +++++++++++
tools/virsh-completer.h | 4 +
tools/virsh-domain.c | 1 +
35 files changed, 414 insertions(+), 198 deletions(-)
--
1.8.3.1
6 years, 5 months
[libvirt] [PATCH] qemuDomainSaveMemory: Don't enforce dynamicOwnership
by Michal Privoznik
https://bugzilla.redhat.com/show_bug.cgi?id=1589115
When doing a memory snapshot qemuOpenFile() is used. This means
that the file where memory is saved is firstly attempted to be
created under root:root (because that's what libvirtd is running
under) and if this fails the second attempt is done under
domain's uid:gid. This does not make much sense - qemu is given
opened FD so it does not need to access the file. Moreover, if
dynamicOwnership is set in qemu.conf and the file lives on a
squashed NFS this is deadly combination and very likely to fail.
The fix consists of using:
qemuOpenFileAs(fallback_uid = cfg->user,
fallback_gid = cfg->group,
dynamicOwnership = false)
In other words, dynamicOwnership is turned off for memory
snapshot (chown() will still be attempted if the file does not
live on NFS) and instead of using domain DAC label, configured
user:group is set as fallback.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_driver.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 129bacdd34..6af7e6e171 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -3223,6 +3223,7 @@ qemuDomainSaveMemory(virQEMUDriverPtr driver,
unsigned int flags,
qemuDomainAsyncJob asyncJob)
{
+ virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
bool bypassSecurityDriver = false;
bool needUnlink = false;
int ret = -1;
@@ -3241,9 +3242,10 @@ qemuDomainSaveMemory(virQEMUDriverPtr driver,
goto cleanup;
}
}
- fd = qemuOpenFile(driver, vm, path,
- O_WRONLY | O_TRUNC | O_CREAT | directFlag,
- &needUnlink, &bypassSecurityDriver);
+
+ fd = qemuOpenFileAs(cfg->user, cfg->group, false, path,
+ O_WRONLY | O_TRUNC | O_CREAT | directFlag,
+ &needUnlink, &bypassSecurityDriver);
if (fd < 0)
goto cleanup;
@@ -3283,6 +3285,7 @@ qemuDomainSaveMemory(virQEMUDriverPtr driver,
cleanup:
VIR_FORCE_CLOSE(fd);
virFileWrapperFdFree(wrapperFd);
+ virObjectUnref(cfg);
if (ret < 0 && needUnlink)
unlink(path);
--
2.16.4
6 years, 5 months
[libvirt] [PATCH 0/3] fix bad error log on libvirtd restart when using OVS
by Laine Stump
This BZ:
https://bugzilla.redhat.com/show_bug.cgi?id=1596176
and the log message of patch 3 explain the problem.
Laine Stump (3):
util: new function virNetDevOpenvswitchInterfaceGetMaster()
util: add some debug log to virNetDevGetMaster
network: properly check for taps that are connected to an OVS bridge
src/libvirt_private.syms | 1 +
src/network/bridge_driver.c | 21 ++++++++++++++--
src/util/virnetdev.c | 1 +
src/util/virnetdevopenvswitch.c | 55 +++++++++++++++++++++++++++++++++++++++++
src/util/virnetdevopenvswitch.h | 6 +++++
5 files changed, 82 insertions(+), 2 deletions(-)
--
2.14.4
6 years, 5 months
[libvirt] [PATCH 0/2] domain_addr: delete unused functions
by Anya Harter
each commit references the commit where the last use was removed
Anya Harter (2):
domain_addr: delete virDomainCCWAddressReleaseAddr
domain_addr: delete virDomainVirtioSerialAddrRelease
src/conf/domain_addr.c | 68 ----------------------------------------
src/conf/domain_addr.h | 8 -----
src/libvirt_private.syms | 2 --
3 files changed, 78 deletions(-)
--
2.17.1
6 years, 5 months
[libvirt] [PATCH] Post-release version bump to 4.6.0
by John Ferlan
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
configure.ac | 2 +-
docs/news.xml | 8 ++++++++
2 files changed, 9 insertions(+), 1 deletion(-)
Pushed under trivial rule.
diff --git a/configure.ac b/configure.ac
index e25bf0a6ec..59d2d09611 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], [4.5.0], [libvir-list(a)redhat.com], [], [https://libvirt.org])
+AC_INIT([libvirt], [4.6.0], [libvir-list(a)redhat.com], [], [https://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 33824ddadb..1ddfbd1df8 100644
--- a/docs/news.xml
+++ b/docs/news.xml
@@ -33,6 +33,14 @@
-->
<libvirt>
+ <release version="v4.6.0" date="unreleased">
+ <section title="New features">
+ </section>
+ <section title="Improvements">
+ </section>
+ <section title="Bug fixes">
+ </section>
+ </release>
<release version="v4.5.0" date="2018-07-02">
<section title="New features">
<change>
--
2.14.4
6 years, 5 months
[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, 5 months