[libvirt] [PATCH v7 0/5] Add native TLS encrypted chardev TCP support
by John Ferlan
v6: http://www.redhat.com/archives/libvir-list/2016-September/msg00302.html
Differences over v6 - rather than disable on specific chardev's, modify the
code to be need to enable by setting tls='yes' for the chardev
John Ferlan (5):
domain: Add optional 'tls' attribute for TCP chardev
conf: Introduce {default|chardev}_tls_x509_secret_uuid
qemu: Introduce qemuDomainChardevPrivatePtr
qemu: Add a secret object to/for a chardev tcp with secret
qemu: Add the ability to hotplug a secret object for TCP chardev TLS
docs/formatdomain.html.in | 21 +++
docs/schemas/domaincommon.rng | 5 +
src/conf/domain_conf.c | 51 ++++++--
src/conf/domain_conf.h | 5 +-
src/libxl/libxl_domain.c | 2 +-
src/lxc/lxc_native.c | 2 +-
src/qemu/libvirtd_qemu.aug | 2 +
src/qemu/qemu.conf | 24 ++++
src/qemu/qemu_command.c | 35 ++++-
src/qemu/qemu_command.h | 1 +
src/qemu/qemu_conf.c | 22 ++++
src/qemu/qemu_conf.h | 3 +
src/qemu/qemu_domain.c | 143 ++++++++++++++++++++-
src/qemu/qemu_domain.h | 30 ++++-
src/qemu/qemu_driver.c | 2 +-
src/qemu/qemu_hotplug.c | 64 ++++++++-
src/qemu/qemu_hotplug.h | 3 +-
src/qemu/qemu_parse_command.c | 4 +-
src/qemu/qemu_process.c | 6 +-
src/qemu/test_libvirtd_qemu.aug.in | 2 +
src/vz/vz_sdk.c | 2 +-
src/xenconfig/xen_sxpr.c | 2 +-
tests/qemuhotplugtest.c | 2 +-
...emuxml2argv-serial-tcp-tlsx509-chardev-tls.args | 30 +++++
...qemuxml2argv-serial-tcp-tlsx509-chardev-tls.xml | 50 +++++++
.../qemuxml2argv-serial-tcp-tlsx509-chardev.xml | 2 +-
...xml2argv-serial-tcp-tlsx509-secret-chardev.args | 38 ++++++
...uxml2argv-serial-tcp-tlsx509-secret-chardev.xml | 50 +++++++
tests/qemuxml2argvtest.c | 22 ++++
...muxml2xmlout-serial-tcp-tlsx509-chardev-tls.xml | 1 +
.../qemuxml2xmlout-serial-tcp-tlsx509-chardev.xml | 2 +-
tests/qemuxml2xmltest.c | 1 +
32 files changed, 593 insertions(+), 36 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-tlsx509-chardev-tls.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-tlsx509-chardev-tls.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-tlsx509-secret-chardev.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-serial-tcp-tlsx509-secret-chardev.xml
create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-serial-tcp-tlsx509-chardev-tls.xml
--
2.7.4
8 years, 1 month
[libvirt] [PATCH] storage_backend_rbd: remove unnessary translated message marker
by Chen Hanxiao
From: Chen Hanxiao <chenhanxiao(a)gmail.com>
Remove unnessary translated message marker _()
for the VIR_WARN messages.
Signed-off-by: Chen Hanxiao <chenhanxiao(a)gmail.com>
---
src/storage/storage_backend_rbd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backend_rbd.c
index 4dd4b24..21693c4 100644
--- a/src/storage/storage_backend_rbd.c
+++ b/src/storage/storage_backend_rbd.c
@@ -427,7 +427,7 @@ virStorageBackendRBDRefreshPool(virConnectPtr conn,
if (len >= 0)
break;
if (len != -ERANGE) {
- VIR_WARN("%s", _("A problem occurred while listing RBD images"));
+ VIR_WARN("%s", "A problem occurred while listing RBD images");
goto cleanup;
}
VIR_FREE(names);
@@ -582,7 +582,7 @@ virStorageBackendRBDDeleteVol(virConnectPtr conn,
VIR_DEBUG("Removing RBD image %s/%s", pool->def->source.name, vol->name);
if (flags & VIR_STORAGE_VOL_DELETE_ZEROED)
- VIR_WARN("%s", _("This storage backend does not support zeroed removal of volumes"));
+ VIR_WARN("%s", "This storage backend does not support zeroed removal of volumes");
if (virStorageBackendRBDOpenRADOSConn(&ptr, conn, &pool->def->source) < 0)
goto cleanup;
--
1.8.3.1
8 years, 1 month
[libvirt] [PATCH] Fix Typos
by Nitesh Konkar
Signed-off-by: Nitesh Konkar <nitkon12(a)linux.vnet.ibm.com>
---
src/esx/esx_vi.c | 2 +-
src/libvirt-nodedev.c | 2 +-
src/openvz/openvz_conf.c | 2 +-
tools/virt-admin.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/esx/esx_vi.c b/src/esx/esx_vi.c
index a28ac7b..8586e3f 100644
--- a/src/esx/esx_vi.c
+++ b/src/esx/esx_vi.c
@@ -1110,7 +1110,7 @@ esxVI_Context_Connect(esxVI_Context *ctx, const char *url,
* FIXME: Actually this should be detected by really calling
* QueryVirtualDiskUuid and checking if a NotImplemented fault is
* returned. But currently we don't deserialized the details of a
- * possbile fault and therefore we don't know if the fault was a
+ * possible fault and therefore we don't know if the fault was a
* NotImplemented fault or not.
*/
ctx->hasQueryVirtualDiskUuid = true;
diff --git a/src/libvirt-nodedev.c b/src/libvirt-nodedev.c
index 59f020b..6ea14b3 100644
--- a/src/libvirt-nodedev.c
+++ b/src/libvirt-nodedev.c
@@ -636,7 +636,7 @@ virNodeDeviceReAttach(virNodeDevicePtr dev)
* virNodeDeviceReset:
* @dev: pointer to the node device
*
- * Reset a previously dettached node device to the node before or
+ * Reset a previously detached node device to the node before or
* after assigning it to a guest.
*
* The exact reset semantics depends on the hypervisor and device
diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c
index 9b820a9..65c441e 100644
--- a/src/openvz/openvz_conf.c
+++ b/src/openvz/openvz_conf.c
@@ -762,7 +762,7 @@ openvzReadConfigParam(const char *conf_file, const char *param, char **value)
/*
* Read parameter from container config
*
- * value will be freed before a new value is assined to it, the caller is
+ * value will be freed before a new value is assigned to it, the caller is
* responsible for freeing it afterwards.
*
* sample: 133, "OSTEMPLATE", &value
diff --git a/tools/virt-admin.c b/tools/virt-admin.c
index b749acb..b1e0c49 100644
--- a/tools/virt-admin.c
+++ b/tools/virt-admin.c
@@ -109,7 +109,7 @@ vshAdmGetTimeStr(vshControl *ctl, time_t then, char **result)
* vshAdmCatchDisconnect:
*
* We get here when the connection was closed. Unlike virsh, we do not save
- * the fact that the event was raised, sice there is virAdmConnectIsAlive to
+ * the fact that the event was raised, since there is virAdmConnectIsAlive to
* check if the communication channel has not been closed by remote party.
*/
static void
--
2.1.0
8 years, 1 month
[libvirt] [PATCH v2 00/11] Couple of migration fixes
by Michal Privoznik
v2 of:
https://www.redhat.com/archives/libvir-list/2016-September/msg00802.html
diff to v1:
- Instead of introducing vir*Opaque() APIs, just add parseOpaque argument to everything that needs it
- Pass qemuCaps directly instead of domain object
Michal Privoznik (11):
virDomainDefPostParse: Introduce @parseOpaque argument
virDomainDefParseNode: Introduce @parseOpaque argument
virDomainDefParse{File,String}: Introduce @parseOpaque argument
virDomainDefCopy: Introduce @parseOpaque argument
qemuDomainDefPostParse: Fetch qemuCaps from domain object
conf: Extend virDomainDeviceDefPostParse for parseOpaque
qemuDomainDeviceDefPostParse: Fetch caps from domain object
conf: Extend virDomainDefAssignAddressesCallback for parseOpaque
qemuDomainDefAssignAddresses: Fetch caps from domain object
domain_conf: Introduce VIR_DOMAIN_DEF_PARSE_SKIP_POST_PARSE
conf: Skip post parse callbacks when creating copy
src/bhyve/bhyve_domain.c | 6 ++--
src/bhyve/bhyve_driver.c | 6 ++--
src/conf/domain_conf.c | 60 ++++++++++++++++++++++++++++------------
src/conf/domain_conf.h | 40 +++++++++++++++++++--------
src/conf/snapshot_conf.c | 2 +-
src/conf/virdomainobjlist.c | 2 +-
src/esx/esx_driver.c | 4 +--
src/libxl/libxl_domain.c | 12 ++++----
src/libxl/libxl_driver.c | 6 ++--
src/libxl/libxl_migration.c | 3 ++
src/lxc/lxc_domain.c | 6 ++--
src/lxc/lxc_driver.c | 4 +--
src/lxc/lxc_native.c | 2 +-
src/openvz/openvz_driver.c | 11 +++++---
src/phyp/phyp_driver.c | 7 +++--
src/qemu/qemu_domain.c | 54 +++++++++++++++++++++++-------------
src/qemu/qemu_driver.c | 23 +++++++--------
src/qemu/qemu_migration.c | 8 +++---
src/qemu/qemu_parse_command.c | 2 +-
src/security/virt-aa-helper.c | 2 +-
src/test/test_driver.c | 13 +++++----
src/uml/uml_driver.c | 10 ++++---
src/vbox/vbox_common.c | 8 ++++--
src/vmware/vmware_driver.c | 10 ++++---
src/vmx/vmx.c | 8 ++++--
src/vz/vz_driver.c | 9 ++++--
src/xen/xen_driver.c | 11 +++++---
src/xen/xm_internal.c | 1 +
src/xenapi/xenapi_driver.c | 8 ++++--
src/xenconfig/xen_sxpr.c | 2 +-
src/xenconfig/xen_xl.c | 2 +-
src/xenconfig/xen_xm.c | 2 +-
tests/bhyvexml2argvtest.c | 2 +-
tests/domainconftest.c | 2 +-
tests/qemuagenttest.c | 2 +-
tests/qemuhotplugtest.c | 1 +
tests/qemuxml2argvtest.c | 2 +-
tests/securityselinuxlabeltest.c | 2 +-
tests/testutils.c | 2 +-
tests/xlconfigtest.c | 4 +--
tests/xmconfigtest.c | 2 +-
tests/xml2sexprtest.c | 2 +-
tests/xml2vmxtest.c | 2 +-
43 files changed, 231 insertions(+), 136 deletions(-)
--
2.8.4
8 years, 1 month
[libvirt] [PATCH 0/2] Fix virsh save-restore/migration with memory hotplug.
by Nitesh Konkar
Virsh restore/migration fails on a VM which has gone
through a series of memory attach and detach where
the sequence of detach is random(not in LIFO order).
With memory hotplug, the dimms are looked up
using the object-id and so, the restore/migration
fails because the qemu command that gets generated
has memdev and id values which wouldn't exist for
the given slotid.
This patch ensures that the source and destination would
always have same memdev-objectid-slotid values.
Steps to hit the issue:
1. Hot add two memory dimms twice.
virsh attach-device VMName memHotplug.xml --live
virsh attach-device VMName memHotplug.xml --live
2. cat memHotplug.xml
<memory model='dimm' >
<target>
<size unit='MiB'>128</size>
<node>0</node>
</target>
</memory>
3. Now hot unplug the first memory module attached.
virsh detach-device VMName detach.xml --live
4. cat detach.xml
<memory model='dimm'>
<target>
<size unit='MiB'>128</size>
<node>0</node>
</target>
<alias name='dimm0'/>
<address type='dimm' slot='0' base='0x100000000'/>
</memory>
5.Save the VM and then restore. Restore fails..
virsh save VMName ./VMName.vmsav
virsh restore ./VMName.vmsav
Error: Unknown ramblock "memdimm1".
6. Example qemu log without current patch.
dimm,node=0,memdev=memdimm0,id=dimm0,slot=1,addr=4429185024 -object memory-backend-ram,id=memdimm1,size=134217728 -device pc-dimm,node=0,memdev=memdimm1,id=dimm1,slot=2,addr=4563402752 -object memory-backend-ram,id=memdimm2,size=134217728 -device pc-dimm,node=0,memdev=memdimm2,id=dimm2,slot=3,addr=4697620480 -object memory-backend-ram,id=memdimm3,size=134217728 -device pc-dimm,node=0,memdev=memdimm3,id=dimm3,slot=4,addr=4831838208 -object memory-backend-ram,id=memdimm4,size=134217728 -device pc-dimm,node=0,memdev=memdimm4,id=dimm4,slot=5,addr=4966055936
7. With the current patch we have kept the dimm name as dimmX where X=slot number.In such a
case the memdev and id generated are always correct w.r.t the slotid and the virsh restore/
migrate succeeds.
dimm,node=0,memdev=memdimm1,id=dimm1,slot=1,addr=4429185024 -object memory-backend-ram,id=memdimm2,size=134217728 -device pc-dimm,node=0,memdev=memdimm2,id=dimm2,slot=2,addr=4563402752 -object memory-backend-ram,id=memdimm3,size=134217728 -device pc-dimm,node=0,memdev=memdimm3,id=dimm3,slot=3,addr=4697620480 -object memory-backend-ram,id=memdimm4,size=134217728 -device pc-dimm,node=0,memdev=memdimm4,id=dimm4,slot=4,addr=4831838208 -object memory-backend-ram,id=memdimm5,size=134217728 -device pc-dimm,node=0,memdev=memdimm5,id=dimm5,slot=5,addr=4966055936
Nitesh Konkar (2):
qemu_alias:Set dimm alias name to dimmX where X=slot number.
tests/qemuxml2argvdata:Add a testcase
src/qemu/qemu_alias.c | 51 +++++++++---
.../qemuxml2argv-memory-hotplug-dimm-alias.args | 35 ++++++++
.../qemuxml2argv-memory-hotplug-dimm-alias.xml | 94 ++++++++++++++++++++++
tests/qemuxml2argvtest.c | 2 +
4 files changed, 172 insertions(+), 10 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-dimm-alias.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-dimm-alias.xml
--
1.9.3
8 years, 1 month
[libvirt] [PATCH] qemuDomainUpdateDeviceConfig: Allow full disk update
by Michal Privoznik
https://bugzilla.redhat.com/show_bug.cgi?id=1368417
So far, when it comes to 'virsh update-device --config' of disks
we are limiting ourselves for just the disk source update and
just for CDROMs and floppies. This makes no sense. Especially if
you look around and see that we already allow full update to
graphics and net devices. So let's just take whatever XML user
wants to have there and replace our internal definition with it.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_driver.c | 26 +++++++-------------------
1 file changed, 7 insertions(+), 19 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 2efaa2a..b5abb0c 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -8104,35 +8104,23 @@ qemuDomainUpdateDeviceConfig(virDomainDefPtr vmdef,
unsigned int parse_flags,
virDomainXMLOptionPtr xmlopt)
{
- virDomainDiskDefPtr orig, disk;
+ virDomainDiskDefPtr newDisk;
virDomainGraphicsDefPtr newGraphics;
virDomainNetDefPtr net;
int pos;
switch ((virDomainDeviceType) dev->type) {
case VIR_DOMAIN_DEVICE_DISK:
- disk = dev->data.disk;
- if (!(orig = virDomainDiskByName(vmdef, disk->dst, false))) {
+ newDisk = dev->data.disk;
+ if ((pos = virDomainDiskIndexByName(vmdef, newDisk->dst, false)) < 0) {
virReportError(VIR_ERR_INVALID_ARG,
- _("target %s doesn't exist."), disk->dst);
+ _("target %s doesn't exist."), newDisk->dst);
return -1;
}
- if (!(orig->device == VIR_DOMAIN_DISK_DEVICE_CDROM) &&
- !(orig->device == VIR_DOMAIN_DISK_DEVICE_FLOPPY)) {
- virReportError(VIR_ERR_INVALID_ARG, "%s",
- _("this disk doesn't support update"));
- return -1;
- }
- /*
- * Update 'orig'
- * We allow updating src/type//driverType/cachemode/
- */
- orig->cachemode = disk->cachemode;
- orig->startupPolicy = disk->startupPolicy;
- virStorageSourceFree(orig->src);
- orig->src = disk->src;
- disk->src = NULL;
+ virDomainDiskDefFree(vmdef->disks[pos]);
+ vmdef->disks[pos] = newDisk;
+ dev->data.disk = NULL;
break;
case VIR_DOMAIN_DEVICE_GRAPHICS:
--
2.8.4
8 years, 1 month
[libvirt] [PATCH 2/2] tests/qemuxml2argvdata:Add a testcase
by Nitesh Konkar
Signed-off-by: Nitesh Konkar <nitkon12(a)linux.vnet.ibm.com>
---
.../qemuxml2argv-memory-hotplug-dimm-alias.args | 35 ++++++++
.../qemuxml2argv-memory-hotplug-dimm-alias.xml | 94 ++++++++++++++++++++++
tests/qemuxml2argvtest.c | 2 +
3 files changed, 131 insertions(+)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-dimm-alias.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-dimm-alias.xml
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-dimm-alias.args b/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-dimm-alias.args
new file mode 100644
index 0000000..0e9f8e0
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-dimm-alias.args
@@ -0,0 +1,35 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/home/test \
+USER=test \
+LOGNAME=test \
+QEMU_AUDIO_DRV=none \
+/home/usr/qemu/x86_64-softmmu/qemu-system-x86_64 \
+-name Fedora \
+-S \
+-M pc-i440fx-2.7 \
+-m size=1048576k,slots=32,maxmem=3145728k \
+-smp 8,maxcpus=160,sockets=40,cores=2,threads=2 \
+-numa node,nodeid=0,cpus=0-3,mem=512 \
+-numa node,nodeid=1,cpus=4-7,mem=512 \
+-object memory-backend-ram,id=memdimm2,size=134217728 \
+-device pc-dimm,node=0,memdev=memdimm2,id=dimm2,slot=2,addr=4563402752 \
+-object memory-backend-ram,id=memdimm4,size=134217728 \
+-device pc-dimm,node=0,memdev=memdimm4,id=dimm4,slot=4,addr=4966055936 \
+-object memory-backend-ram,id=memdimm0,size=134217728 \
+-device pc-dimm,node=0,memdev=memdimm0,id=dimm0,slot=0,addr=4294967296 \
+-object memory-backend-ram,id=memdimm1,size=134217728 \
+-device pc-dimm,node=0,memdev=memdimm1,id=dimm1,slot=1,addr=4429185024 \
+-object memory-backend-ram,id=memdimm3,size=134217728 \
+-device pc-dimm,node=0,memdev=memdimm3,id=dimm3,slot=3,addr=4697620480 \
+-uuid aecf3e5e-6f9a-42a3-9d6a-223a75569a66 \
+-nographic \
+-nodefaults \
+-monitor unix:/tmp/lib/domain--1-Fedora/monitor.sock,server,nowait \
+-boot c \
+-usb \
+-drive file=/home/nitesh/Fedora24.qcow2,format=qcow2,if=none,id=drive-ide0-0-0 \
+-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
+-serial pty \
+-device usb-mouse,id=input0,bus=usb.0,port=1 \
+-vga cirrus \
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x6
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-dimm-alias.xml b/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-dimm-alias.xml
new file mode 100644
index 0000000..9c0625d
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-dimm-alias.xml
@@ -0,0 +1,94 @@
+<domain type='kvm'>
+ <name>Fedora</name>
+ <uuid>aecf3e5e-6f9a-42a3-9d6a-223a75569a66</uuid>
+ <maxMemory slots='32' unit='KiB'>3145728</maxMemory>
+ <memory unit='KiB'>1703936</memory>
+ <currentMemory unit='KiB'>1572864</currentMemory>
+ <vcpu placement='static' current='8'>160</vcpu>
+ <os>
+ <type arch='x86_64' machine='pc-i440fx-2.7'>hvm</type>
+ <boot dev='hd'/>
+ <bootmenu enable='yes'/>
+ </os>
+ <features>
+ <acpi/>
+ </features>
+ <cpu>
+ <topology sockets='40' cores='2' threads='2'/>
+ <numa>
+ <cell id='0' cpus='0-3' memory='524288' unit='KiB'/>
+ <cell id='1' cpus='4-7' memory='524288' unit='KiB'/>
+ </numa>
+ </cpu>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/home/usr/qemu/x86_64-softmmu/qemu-system-x86_64</emulator>
+ <disk type='file' device='disk'>
+ <driver name='qemu' type='qcow2'/>
+ <source file='/home/nitesh/Fedora24.qcow2'/>
+ <target dev='hda' bus='ide'/>
+ <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+ </disk>
+ <controller type='pci' index='0' model='pci-root'/>
+ <controller type='ide' index='0'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
+ </controller>
+ <serial type='pty'>
+ <target port='0'/>
+ </serial>
+ <console type='pty'>
+ <target type='serial' port='0'/>
+ </console>
+ <input type='mouse' bus='usb'>
+ <address type='usb' bus='0' port='1'/>
+ </input>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <video>
+ <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+ </video>
+ <memballoon model='virtio'>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
+ </memballoon>
+ <memory model='dimm'>
+ <target>
+ <size unit='KiB'>131072</size>
+ <node>0</node>
+ </target>
+ <address type='dimm' slot='2' base='0x110000000'/>
+ </memory>
+ <memory model='dimm'>
+ <target>
+ <size unit='KiB'>131072</size>
+ <node>0</node>
+ </target>
+ <address type='dimm' slot='4' base='0x128000000'/>
+ </memory>
+ <memory model='dimm'>
+ <target>
+ <size unit='KiB'>131072</size>
+ <node>0</node>
+ </target>
+ <address type='dimm' slot='0' base='0x100000000'/>
+ </memory>
+ <memory model='dimm'>
+ <target>
+ <size unit='KiB'>131072</size>
+ <node>0</node>
+ </target>
+ <address type='dimm' slot='1' base='0x108000000'/>
+ </memory>
+ <memory model='dimm'>
+ <target>
+ <size unit='KiB'>131072</size>
+ <node>0</node>
+ </target>
+ <address type='dimm' slot='3' base='0x118000000'/>
+ </memory>
+ </devices>
+ <seclabel type='none' model='none'/>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index aaf00c2..a592c40 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1992,6 +1992,8 @@ mymain(void)
QEMU_CAPS_OBJECT_MEMORY_FILE);
DO_TEST("memory-hotplug-ppc64-nonuma", QEMU_CAPS_KVM, QEMU_CAPS_DEVICE_PC_DIMM, QEMU_CAPS_NUMA,
QEMU_CAPS_OBJECT_MEMORY_RAM, QEMU_CAPS_OBJECT_MEMORY_FILE);
+ DO_TEST("memory-hotplug-dimm-alias", QEMU_CAPS_KVM, QEMU_CAPS_DEVICE_PC_DIMM, QEMU_CAPS_NUMA,
+ QEMU_CAPS_OBJECT_MEMORY_RAM, QEMU_CAPS_OBJECT_MEMORY_FILE);
DO_TEST("machine-aeskeywrap-on-caps",
QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_AES_KEY_WRAP,
--
1.9.3
8 years, 1 month
[libvirt] [libvirt-php][PATCH] libvirt_domain_get_screenshot_api: Don't unlink screenshot file on success
by Michal Privoznik
In 5120ba28a2021 I've tried to fix couple of problems with this
API (all kinds of resource leaks, bad conditions to some checks
and so on). However, my clumsy fix introduced unlink even to a
success path so after all callers were left with a non-existent
path to screenshot file.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/libvirt-php.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/libvirt-php.c b/src/libvirt-php.c
index 7916d07..693f911 100644
--- a/src/libvirt-php.c
+++ b/src/libvirt-php.c
@@ -4790,7 +4790,6 @@ PHP_FUNCTION(libvirt_domain_get_screenshot_api)
VIRT_ADD_ASSOC_STRING(return_value, "file", fileNew);
VIRT_ADD_ASSOC_STRING(return_value, "mime", "image/png");
} else {
- unlink(file);
close(fd);
fd = -1;
VIRT_ADD_ASSOC_STRING(return_value, "file", file);
--
2.8.4
8 years, 2 months
[libvirt] [libvirt-php][PATCH 00/14] Fix code styling in libvirt-php
by Katerina Koukiou
Fixed some basic code styling issues in libvirt-php.c that made the code
hard to read.
Katerina Koukiou (14):
libvirt-php.c: Fix coding style issues: space required after ','
libvirt-php.c: Fix coding style issues: spaces required around
'==', '>=', '<=' etc.
libvirt-php.c: Fix coding style issues: space prohibited between
function name and open parenthesis '('
libvirt-php.c: Fix coding style issues: remove unwanted spaces
after '(' and before ')'
libvirt-php.c: Fix code styling issues: no space needed after '['
and before ']'
libvirt-php.c: Fix code styling issues: if then else statement
style issues
libvirt-php.c: Fix coding style issues with braces
libvirt-php.c Fix coding style issues with if statements
libvirt-php.c: Fix coding style issues: space required around '='
in assignments
libvirt-php.c: Fix code styling issues with for loops
libvirt-php.c: Fix coding style issues: "(foo*)" should be "(foo *)"
libvirt-php.c: Fix coding style issues with operators
libvirt-php.c: Fix coding style issues with extra/less spaces
libvirt-php.c: Fix coding style issues in macros
src/libvirt-php.c | 2220 ++++++++++++++++++++++++++---------------------------
1 file changed, 1101 insertions(+), 1119 deletions(-)
--
2.7.3
8 years, 2 months
[libvirt] [PATCH] libxl: increase usbdevice list only when finding such an input device
by Cédric Bosdonnat
If passing an empty usbdevice_list to libxl, qemu will always get an
-usb parameter for HVM guests with only non-USB input devices. This
causes qemu to crash when passing pvusb device on HVM guests.
The solution is to allocate the list only when an item to put in it
is found.
---
src/libxl/libxl_conf.c | 58 ++++++++++++++++++++++++++++----------------------
1 file changed, 33 insertions(+), 25 deletions(-)
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index 306e441..f85f005 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -298,6 +298,7 @@ libxlMakeDomBuildInfo(virDomainDefPtr def,
libxl_domain_build_info *b_info = &d_config->b_info;
int hvm = def->os.type == VIR_DOMAIN_OSTYPE_HVM;
size_t i;
+ size_t nusbdevice = 0;
libxl_domain_build_info_init(b_info);
@@ -469,47 +470,54 @@ libxlMakeDomBuildInfo(virDomainDefPtr def,
libxl_defbool_set(&b_info->u.hvm.vnc.enable, 0);
libxl_defbool_set(&b_info->u.hvm.sdl.enable, 0);
- if (def->ninputs) {
+ for (i = 0; i < def->ninputs; i++) {
+ char **usbdevice;
+
+ if (def->inputs[i]->bus != VIR_DOMAIN_INPUT_BUS_USB)
+ continue;
+
#ifdef LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST
- if (VIR_ALLOC_N(b_info->u.hvm.usbdevice_list, def->ninputs+1) < 0)
+ if (VIR_EXPAND_N(b_info->u.hvm.usbdevice_list, nusbdevice, 1) < 0)
return -1;
#else
- if (def->ninputs > 1) {
+ if (i > 1) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("libxenlight supports only one input device"));
return -1;
}
#endif
- for (i = 0; i < def->ninputs; i++) {
- char **usbdevice;
-
- if (def->inputs[i]->bus != VIR_DOMAIN_INPUT_BUS_USB)
- continue;
#ifdef LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST
- usbdevice = &b_info->u.hvm.usbdevice_list[i];
+ usbdevice = &b_info->u.hvm.usbdevice_list[i];
#else
- usbdevice = &b_info->u.hvm.usbdevice;
+ usbdevice = &b_info->u.hvm.usbdevice;
#endif
- switch (def->inputs[i]->type) {
- case VIR_DOMAIN_INPUT_TYPE_MOUSE:
- VIR_FREE(*usbdevice);
- if (VIR_STRDUP(*usbdevice, "mouse") < 0)
- return -1;
- break;
- case VIR_DOMAIN_INPUT_TYPE_TABLET:
- VIR_FREE(*usbdevice);
- if (VIR_STRDUP(*usbdevice, "tablet") < 0)
- return -1;
- break;
- default:
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("Unknown input device type"));
+ switch (def->inputs[i]->type) {
+ case VIR_DOMAIN_INPUT_TYPE_MOUSE:
+ VIR_FREE(*usbdevice);
+ if (VIR_STRDUP(*usbdevice, "mouse") < 0)
return -1;
- }
+ break;
+ case VIR_DOMAIN_INPUT_TYPE_TABLET:
+ VIR_FREE(*usbdevice);
+ if (VIR_STRDUP(*usbdevice, "tablet") < 0)
+ return -1;
+ break;
+ default:
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("Unknown input device type"));
+ return -1;
}
}
+#ifdef LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST
+ if (nusbdevice > 0 &&
+ VIR_EXPAND_N(b_info->u.hvm.usbdevice_list, nusbdevice, 1) < 0) {
+ VIR_DISPOSE_N(b_info->u.hvm.usbdevice_list, nusbdevice);
+ return -1;
+ }
+#endif
+
/* Allow libxl to calculate shadow memory requirements */
b_info->shadow_memkb =
libxl_get_required_shadow_memory(b_info->max_memkb,
--
2.9.3
8 years, 2 months