[libvirt] [PATCH v2 0/4] Remove deprecated pc-0.x machine types and related hacks
by Thomas Huth
These have been on the deprecation list since a year now, so it's
time to finally remove the pc-0.x machine types.
We then can also remove some compatibility hacks in the devices, i.e.
the "use_broken_id" in ac97, the "command_serr_enable" in PCI devices
and the "rombar" stuff in VGA devices.
v2:
- Minor updates to the first patch (fix comment, add deprecation_reason
message for the pc-1.x machines)
- Keep the QEMU_PCI_CAP_SERR enum in the third patch
- Added fourth patch to remove the "rombar" hacks from the VGA devices
Thomas Huth (4):
hw/i386: Remove the deprecated machines 0.12 up to 0.15
hw/audio: Remove the "use_broken_id" hack from the AC97 device
hw/pci: Remove the "command_serr_enable" property
hw/display: Remove "rombar" hack from vga-pci and vmware_vga
hw/audio/ac97.c | 9 -----
hw/display/vga-pci.c | 5 ---
hw/display/vga.c | 4 +-
hw/display/vmware_vga.c | 5 ---
hw/i386/pc_piix.c | 85 +----------------------------------------
hw/pci/pci.c | 6 +--
include/hw/pci/pci.h | 2 +-
qemu-deprecated.texi | 2 +-
tests/cpu-plug-test.c | 6 +--
9 files changed, 7 insertions(+), 117 deletions(-)
--
2.18.1
5 years
[libvirt] [PATCH 0/5] Misc build fixes for RHEL-7
by Daniel P. Berrangé
This fixes some problems from my series related to RHEL-7 and
VZ, and also one that seems to have hit VZ for a long while
before.
I'm pushing all as trivial/build fixes.
Daniel P. Berrangé (5):
tests: fix warning with old GCC about missing struct initializer
vz: pass virDomainXMLOptionPtr to virDomainVideoDefNew
vz: pass pointer to vz capabilities
vz: declare missing driver variable
vz: drop virCapsPtr param from many API domain parse calls
src/vz/vz_driver.c | 12 ++++++------
src/vz/vz_sdk.c | 14 +++++++++-----
tests/openvzutilstest.c | 8 ++++----
3 files changed, 19 insertions(+), 15 deletions(-)
--
2.23.0
5 years
[libvirt] [jenkins-ci PATCH] guests: Rename Ubuntu targets
by Andrea Bolognani
Back when they were introduced, we chose to only include the part
of the version number preceding the dot with the rationale that
doing so introduced no ambiguity since, while there are two Ubuntu
releases per year, we only support LTS releases and those happen
once every two years.
When introducing openSUSE support, however, we could not adopt the
same strategy because openSUSE Leap 15.0 and openSUSe Leap 15.1
are, at least in some regards, just as distinct as Ubuntu 16.04 and
Ubuntu 18.04 are, despite sharing the same major version number;
we've thus decided to encode the full version number, dropping the
dot to avoid issues connected to the fact that we use the target
name as host name for guests.
Let's retroactively apply this new convention to existing Ubuntu
targets in order to maintain consistency.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
.../docker.yml | 0
.../install.yml | 0
.../main.yml | 2 +-
.../docker.yml | 0
.../install.yml | 0
.../main.yml | 2 +-
guests/inventory | 4 ++--
guests/playbooks/build/jobs/defaults.yml | 4 ++--
.../playbooks/build/projects/libvirt-dbus.yml | 2 +-
.../build/projects/libvirt-go-xml.yml | 4 ++--
.../playbooks/build/projects/libvirt-go.yml | 4 ++--
.../build/projects/libvirt-sandbox.yml | 4 ++--
.../playbooks/build/projects/libvirt-tck.yml | 4 ++--
guests/playbooks/build/projects/libvirt.yml | 4 ++--
.../playbooks/build/projects/virt-manager.yml | 4 ++--
guests/vars/mappings.yml | 22 +++++++++----------
16 files changed, 30 insertions(+), 30 deletions(-)
rename guests/host_vars/{libvirt-ubuntu-16 => libvirt-ubuntu-1604}/docker.yml (100%)
rename guests/host_vars/{libvirt-ubuntu-16 => libvirt-ubuntu-1604}/install.yml (100%)
rename guests/host_vars/{libvirt-ubuntu-16 => libvirt-ubuntu-1604}/main.yml (95%)
rename guests/host_vars/{libvirt-ubuntu-18 => libvirt-ubuntu-1804}/docker.yml (100%)
rename guests/host_vars/{libvirt-ubuntu-18 => libvirt-ubuntu-1804}/install.yml (100%)
rename guests/host_vars/{libvirt-ubuntu-18 => libvirt-ubuntu-1804}/main.yml (95%)
diff --git a/guests/host_vars/libvirt-ubuntu-16/docker.yml b/guests/host_vars/libvirt-ubuntu-1604/docker.yml
similarity index 100%
rename from guests/host_vars/libvirt-ubuntu-16/docker.yml
rename to guests/host_vars/libvirt-ubuntu-1604/docker.yml
diff --git a/guests/host_vars/libvirt-ubuntu-16/install.yml b/guests/host_vars/libvirt-ubuntu-1604/install.yml
similarity index 100%
rename from guests/host_vars/libvirt-ubuntu-16/install.yml
rename to guests/host_vars/libvirt-ubuntu-1604/install.yml
diff --git a/guests/host_vars/libvirt-ubuntu-16/main.yml b/guests/host_vars/libvirt-ubuntu-1604/main.yml
similarity index 95%
rename from guests/host_vars/libvirt-ubuntu-16/main.yml
rename to guests/host_vars/libvirt-ubuntu-1604/main.yml
index 179dd03..4f803a5 100644
--- a/guests/host_vars/libvirt-ubuntu-16/main.yml
+++ b/guests/host_vars/libvirt-ubuntu-1604/main.yml
@@ -18,6 +18,6 @@ projects:
package_format: 'deb'
package_manager: 'apt-get'
os_name: 'Ubuntu'
-os_version: '16'
+os_version: '1604'
ansible_python_interpreter: /usr/bin/python3
diff --git a/guests/host_vars/libvirt-ubuntu-18/docker.yml b/guests/host_vars/libvirt-ubuntu-1804/docker.yml
similarity index 100%
rename from guests/host_vars/libvirt-ubuntu-18/docker.yml
rename to guests/host_vars/libvirt-ubuntu-1804/docker.yml
diff --git a/guests/host_vars/libvirt-ubuntu-18/install.yml b/guests/host_vars/libvirt-ubuntu-1804/install.yml
similarity index 100%
rename from guests/host_vars/libvirt-ubuntu-18/install.yml
rename to guests/host_vars/libvirt-ubuntu-1804/install.yml
diff --git a/guests/host_vars/libvirt-ubuntu-18/main.yml b/guests/host_vars/libvirt-ubuntu-1804/main.yml
similarity index 95%
rename from guests/host_vars/libvirt-ubuntu-18/main.yml
rename to guests/host_vars/libvirt-ubuntu-1804/main.yml
index 5b5bf0c..9070157 100644
--- a/guests/host_vars/libvirt-ubuntu-18/main.yml
+++ b/guests/host_vars/libvirt-ubuntu-1804/main.yml
@@ -19,6 +19,6 @@ projects:
package_format: 'deb'
package_manager: 'apt-get'
os_name: 'Ubuntu'
-os_version: '18'
+os_version: '1804'
ansible_python_interpreter: /usr/bin/python3
diff --git a/guests/inventory b/guests/inventory
index f1f7708..ecdcc34 100644
--- a/guests/inventory
+++ b/guests/inventory
@@ -9,5 +9,5 @@ libvirt-freebsd-11
libvirt-freebsd-12
libvirt-freebsd-current
libvirt-opensuse-151
-libvirt-ubuntu-16
-libvirt-ubuntu-18
+libvirt-ubuntu-1604
+libvirt-ubuntu-1804
diff --git a/guests/playbooks/build/jobs/defaults.yml b/guests/playbooks/build/jobs/defaults.yml
index 43ab882..0175a05 100644
--- a/guests/playbooks/build/jobs/defaults.yml
+++ b/guests/playbooks/build/jobs/defaults.yml
@@ -11,8 +11,8 @@ all_machines:
- libvirt-freebsd-12
- libvirt-freebsd-current
- libvirt-opensuse-151
- - libvirt-ubuntu-16
- - libvirt-ubuntu-18
+ - libvirt-ubuntu-1604
+ - libvirt-ubuntu-1804
rpm_machines:
- libvirt-centos-7
- libvirt-fedora-30
diff --git a/guests/playbooks/build/projects/libvirt-dbus.yml b/guests/playbooks/build/projects/libvirt-dbus.yml
index fac1d8f..8c946af 100644
--- a/guests/playbooks/build/projects/libvirt-dbus.yml
+++ b/guests/playbooks/build/projects/libvirt-dbus.yml
@@ -19,7 +19,7 @@
- libvirt-debian-sid
- libvirt-fedora-30
- libvirt-fedora-rawhide
- - libvirt-ubuntu-18
+ - libvirt-ubuntu-1804
- include: '{{ playbook_base }}/jobs/meson-rpm-job.yml'
vars:
# RPM build is still not possible on CentOS7 as it does not
diff --git a/guests/playbooks/build/projects/libvirt-go-xml.yml b/guests/playbooks/build/projects/libvirt-go-xml.yml
index f96df60..5cacb7c 100644
--- a/guests/playbooks/build/projects/libvirt-go-xml.yml
+++ b/guests/playbooks/build/projects/libvirt-go-xml.yml
@@ -11,8 +11,8 @@
- libvirt-freebsd-11
- libvirt-freebsd-12
- libvirt-freebsd-current
- - libvirt-ubuntu-16
- - libvirt-ubuntu-18
+ - libvirt-ubuntu-1604
+ - libvirt-ubuntu-1804
archive_format: gz
git_url: '{{ git_urls["libvirt-go-xml"][git_remote] }}'
diff --git a/guests/playbooks/build/projects/libvirt-go.yml b/guests/playbooks/build/projects/libvirt-go.yml
index 654190c..36322b1 100644
--- a/guests/playbooks/build/projects/libvirt-go.yml
+++ b/guests/playbooks/build/projects/libvirt-go.yml
@@ -11,8 +11,8 @@
- libvirt-freebsd-11
- libvirt-freebsd-12
- libvirt-freebsd-current
- - libvirt-ubuntu-16
- - libvirt-ubuntu-18
+ - libvirt-ubuntu-1604
+ - libvirt-ubuntu-1804
archive_format: gz
git_url: '{{ git_urls["libvirt-go"][git_remote] }}'
diff --git a/guests/playbooks/build/projects/libvirt-sandbox.yml b/guests/playbooks/build/projects/libvirt-sandbox.yml
index ec72051..0b4fe50 100644
--- a/guests/playbooks/build/projects/libvirt-sandbox.yml
+++ b/guests/playbooks/build/projects/libvirt-sandbox.yml
@@ -11,8 +11,8 @@
- libvirt-fedora-30
- libvirt-fedora-31
- libvirt-fedora-rawhide
- - libvirt-ubuntu-16
- - libvirt-ubuntu-18
+ - libvirt-ubuntu-1604
+ - libvirt-ubuntu-1804
archive_format: gz
git_url: '{{ git_urls["libvirt-sandbox"][git_remote] }}'
diff --git a/guests/playbooks/build/projects/libvirt-tck.yml b/guests/playbooks/build/projects/libvirt-tck.yml
index 9d885c1..ef88cd3 100644
--- a/guests/playbooks/build/projects/libvirt-tck.yml
+++ b/guests/playbooks/build/projects/libvirt-tck.yml
@@ -11,8 +11,8 @@
- libvirt-freebsd-11
- libvirt-freebsd-12
- libvirt-freebsd-current
- - libvirt-ubuntu-16
- - libvirt-ubuntu-18
+ - libvirt-ubuntu-1604
+ - libvirt-ubuntu-1804
archive_format: gz
git_url: '{{ git_urls["libvirt-tck"][git_remote] }}'
diff --git a/guests/playbooks/build/projects/libvirt.yml b/guests/playbooks/build/projects/libvirt.yml
index 66ea851..e0f2f7c 100644
--- a/guests/playbooks/build/projects/libvirt.yml
+++ b/guests/playbooks/build/projects/libvirt.yml
@@ -20,8 +20,8 @@
- libvirt-fedora-31
- libvirt-fedora-rawhide
- libvirt-opensuse-151
- - libvirt-ubuntu-16
- - libvirt-ubuntu-18
+ - libvirt-ubuntu-1604
+ - libvirt-ubuntu-1804
- include: '{{ playbook_base }}/jobs/autotools-check-job.yml'
vars:
local_env: |
diff --git a/guests/playbooks/build/projects/virt-manager.yml b/guests/playbooks/build/projects/virt-manager.yml
index a30718c..c0d4294 100644
--- a/guests/playbooks/build/projects/virt-manager.yml
+++ b/guests/playbooks/build/projects/virt-manager.yml
@@ -14,7 +14,7 @@
- libvirt-freebsd-11
- libvirt-freebsd-12
- libvirt-freebsd-current
- - libvirt-ubuntu-18
+ - libvirt-ubuntu-1804
archive_format: gz
git_url: '{{ git_urls["virt-manager"][git_remote] }}'
@@ -35,7 +35,7 @@
- libvirt-fedora-30
- libvirt-fedora-31
- libvirt-fedora-rawhide
- - libvirt-ubuntu-18
+ - libvirt-ubuntu-1804
- include: '{{ playbook_base }}/jobs/python-distutils-rpm-job.yml'
vars:
machines:
diff --git a/guests/vars/mappings.yml b/guests/vars/mappings.yml
index d4016fb..56310f0 100644
--- a/guests/vars/mappings.yml
+++ b/guests/vars/mappings.yml
@@ -22,7 +22,7 @@
# - CentOS, Debian, Fedora, FreeBSD, OpenSUSE, Ubuntu
#
# Valid OS versions are:
-# - CentOS7, Debian9, FedoraRawhide, OpenSUSE151, Ubuntu18 and so on
+# - CentOS7, Debian9, FedoraRawhide, OpenSUSE151, Ubuntu1804 and so on
#
# The arch specific rules use a prefix "$ARCH-" where $ARCH
# is a libvirt arch name.
@@ -199,8 +199,8 @@ mappings:
rpm: glusterfs-api-devel
Debian9: glusterfs-common
OpenSUSE: glusterfs-devel
- Ubuntu16: glusterfs-common
- Ubuntu18: glusterfs-common
+ Ubuntu1604: glusterfs-common
+ Ubuntu1804: glusterfs-common
cross-policy-deb: foreign
gnutls:
@@ -232,7 +232,7 @@ mappings:
gtk-update-icon-cache:
default: gtk-update-icon-cache
- Ubuntu16: libgtk2.0-bin
+ Ubuntu1604: libgtk2.0-bin
gtk-vnc2:
deb: libgtk-vnc-2.0-dev
@@ -268,7 +268,7 @@ mappings:
pkg: openjdk11
rpm: java-11-openjdk-headless
Debian9: openjdk-8-jre-headless
- Ubuntu16: openjdk-8-jre-headless
+ Ubuntu1604: openjdk-8-jre-headless
json-glib:
deb: libjson-glib-dev
@@ -463,8 +463,8 @@ mappings:
default: meson
CentOS7:
Debian9:
- Ubuntu16:
- Ubuntu18:
+ Ubuntu1604:
+ Ubuntu1804:
ninja:
default: ninja-build
@@ -645,7 +645,7 @@ mappings:
pkg: ncurses
rpm: ncurses-devel
Debian9: libncurses5-dev
- Ubuntu18: libncurses5-dev
+ Ubuntu1804: libncurses5-dev
cross-policy-deb: foreign
netcf:
@@ -838,7 +838,7 @@ mappings:
default: python3-libxml2
FreeBSD: py36-libxml2
CentOS7:
- Ubuntu16:
+ Ubuntu1604:
python3-lxml:
default: python3-lxml
@@ -853,8 +853,8 @@ mappings:
python3-pip:
CentOS7: python3-pip
Debian9: python3-pip
- Ubuntu16: python3-pip
- Ubuntu18: python3-pip
+ Ubuntu1604: python3-pip
+ Ubuntu1804: python3-pip
python3-pytest:
default: python3-pytest
--
2.23.0
5 years
[libvirt] [python PATCH] setup: Accept 'nosetests3' as nosetests binary
by Andrea Bolognani
This is the name used on Ubuntu.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
setup.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/setup.py b/setup.py
index ea25dc0..2831595 100755
--- a/setup.py
+++ b/setup.py
@@ -297,6 +297,7 @@ class my_test(Command):
"nosetests-%d.%d" % (sys.version_info[0],
sys.version_info[1]),
"nosetests-%d" % (sys.version_info[0]),
+ "nosetests%d" % (sys.version_info[0]),
"nosetests",
]
--
2.23.0
5 years
[libvirt] [PATCH] xen: Remove unused 'cfg'
by Peter Krempa
Refactoring of the XML parser left few instances of the
libxlDriverConfig object unused. Remove them.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
Pushed under the build-breaker rule as it makes clang unhappy.
src/libxl/libxl_domain.c | 1 -
tests/xlconfigtest.c | 1 -
tests/xmconfigtest.c | 1 -
3 files changed, 3 deletions(-)
diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
index ff9502d3bb..915aaeb8b0 100644
--- a/src/libxl/libxl_domain.c
+++ b/src/libxl/libxl_domain.c
@@ -1547,7 +1547,6 @@ libxlDomainDefCheckABIStability(libxlDriverPrivatePtr driver,
{
virDomainDefPtr migratableDefSrc = NULL;
virDomainDefPtr migratableDefDst = NULL;
- g_autoptr(libxlDriverConfig) cfg = libxlDriverConfigGet(driver);
bool ret = false;
if (!(migratableDefSrc = virDomainDefCopy(src, driver->xmlopt, NULL, true)) ||
diff --git a/tests/xlconfigtest.c b/tests/xlconfigtest.c
index 3c0469be85..4e4b28cd34 100644
--- a/tests/xlconfigtest.c
+++ b/tests/xlconfigtest.c
@@ -72,7 +72,6 @@ testCompareParseXML(const char *xlcfg, const char *xml, bool replaceVars)
int ret = -1;
virDomainDefPtr def = NULL;
char *replacedXML = NULL;
- g_autoptr(libxlDriverConfig) cfg = libxlDriverConfigGet(driver);
if (VIR_ALLOC_N(gotxlcfgData, wrote) < 0)
goto fail;
diff --git a/tests/xmconfigtest.c b/tests/xmconfigtest.c
index 7e324eb5d2..6bd18d0fe1 100644
--- a/tests/xmconfigtest.c
+++ b/tests/xmconfigtest.c
@@ -45,7 +45,6 @@ testCompareParseXML(const char *xmcfg, const char *xml)
virConnectPtr conn = NULL;
int wrote = 4096;
virDomainDefPtr def = NULL;
- g_autoptr(libxlDriverConfig) cfg = libxlDriverConfigGet(driver);
if (VIR_ALLOC_N(gotxmcfgData, wrote) < 0)
goto fail;
--
2.23.0
5 years
[libvirt] [PATCH] qemu: snapshot: Mark file becoming backingStore as read-only
by Peter Krempa
For any backing file we set 'read-only' to true, but didn't do this when
modifying the recorded backing store when creating external snapshots.
This meant that qemu would attempt to open the backing-file read-write.
This would fail for example when selinux is used as qemu doesn't have
write permission for the backing file.
https://bugzilla.redhat.com/show_bug.cgi?id=1781079
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_driver.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 738e8832cc..96e811a893 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -14659,6 +14659,7 @@ qemuDomainSnapshotCreateInactiveExternal(virQEMUDriverPtr driver,
goto cleanup;
if (virStorageSourceHasBacking(defdisk->src)) {
+ defdisk->src->readonly = true;
newsrc->backingStore = g_steal_pointer(&defdisk->src);
} else {
virObjectUnref(defdisk->src);
@@ -15510,6 +15511,7 @@ qemuDomainSnapshotDiskUpdateSource(virQEMUDriverPtr driver,
qemuDomainSnapshotDiskUpdateSourceRenumber(dd->disk->src);
if (dd->persistdisk) {
+ dd->persistdisk->src->readonly = true;
dd->persistsrc->backingStore = g_steal_pointer(&dd->persistdisk->src);
dd->persistdisk->src = g_steal_pointer(&dd->persistsrc);
}
--
2.23.0
5 years
[libvirt] [python PATCH] Remove 'Makefile'
by Peter Krempa
Python world uses setup.py for everything so our Makefile is just a
"convenience" wrapper for people using to type 'make'. Remove it as it
doesn't add that much value and would need to be updated for python 3.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
Makefile | 18 ------------------
1 file changed, 18 deletions(-)
delete mode 100644 Makefile
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 6c8da0a..0000000
--- a/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-# Shim wrapper around setup.py to allow for familiar build targets
-
-PYTHON ?= python
-
-all:
- $(PYTHON) setup.py build
-
-install: all
- $(PYTHON) setup.py install
-
-clean:
- $(PYTHON) setup.py clean
-
-check: all
- $(PYTHON) setup.py test
-
-rpm:
- $(PYTHON) setup.py rpm
--
2.23.0
5 years
[libvirt] [PATCH v2] qemu: cold-unplug of sound
by Jidong Xia
With this patch users can cold unplug some sound devices.
use "virsh detach-device vm sound.xml --config" command.
Signed-off-by: Jidong Xia <xiajidong(a)cmss.chinamobile.com>
---
src/conf/domain_conf.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
src/conf/domain_conf.h | 3 +++
src/libvirt_private.syms | 2 ++
src/qemu/qemu_driver.c | 9 ++++++++-
4 files changed, 61 insertions(+), 1 deletion(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 9580884..4b28502 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -2753,6 +2753,14 @@ void virDomainSoundDefFree(virDomainSoundDefPtr def)
VIR_FREE(def);
}
+virDomainSoundDefPtr
+virDomainSoundDefRemove(virDomainDefPtr def, size_t idx)
+{
+ virDomainSoundDefPtr ret = def->sounds[idx];
+ VIR_DELETE_ELEMENT(def->sounds, idx, def->nsounds);
+ return ret;
+}
+
void virDomainMemballoonDefFree(virDomainMemballoonDefPtr def)
{
if (!def)
@@ -14554,6 +14562,46 @@ virDomainSoundDefParseXML(virDomainXMLOptionPtr xmlopt,
}
+static bool
+virDomainSoundDefEquals(const virDomainSoundDef *a,
+ const virDomainSoundDef *b)
+{
+ size_t i;
+
+ if (a->model != b->model)
+ return false;
+
+ if (a->ncodecs != b->ncodecs)
+ return false;
+
+ for (i = 0; i < a->ncodecs; i++) {
+ if (a->codecs[i]->type != b->codecs[i]->type)
+ return false;
+ }
+
+ if (a->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE &&
+ !virDomainDeviceInfoAddressIsEqual(&a->info, &b->info))
+ return false;
+
+ return true;
+}
+
+
+ssize_t
+virDomainSoundDefFind(const virDomainDef *def,
+ const virDomainSoundDef *sound)
+{
+ size_t i;
+
+ for (i = 0; i < def->nsounds; i++) {
+ if (virDomainSoundDefEquals(sound, def->sounds[i]))
+ return i;
+ }
+
+ return -1;
+}
+
+
static virDomainWatchdogDefPtr
virDomainWatchdogDefParseXML(virDomainXMLOptionPtr xmlopt,
xmlNodePtr node,
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 49cb697..cdb7b92 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2883,7 +2883,10 @@ void virDomainChrDefFree(virDomainChrDefPtr def);
int virDomainChrSourceDefCopy(virDomainChrSourceDefPtr dest,
virDomainChrSourceDefPtr src);
void virDomainSoundCodecDefFree(virDomainSoundCodecDefPtr def);
+ssize_t virDomainSoundDefFind(const virDomainDef *def,
+ const virDomainSoundDef *sound);
void virDomainSoundDefFree(virDomainSoundDefPtr def);
+virDomainSoundDefPtr virDomainSoundDefRemove(virDomainDefPtr def, size_t idx);
void virDomainMemballoonDefFree(virDomainMemballoonDefPtr def);
void virDomainNVRAMDefFree(virDomainNVRAMDefPtr def);
void virDomainWatchdogDefFree(virDomainWatchdogDefPtr def);
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 8fe0bf9..cdbd64f 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -578,7 +578,9 @@ virDomainSmartcardTypeFromString;
virDomainSmartcardTypeToString;
virDomainSmbiosModeTypeFromString;
virDomainSmbiosModeTypeToString;
+virDomainSoundDefFind;
virDomainSoundDefFree;
+virDomainSoundDefRemove;
virDomainSoundModelTypeFromString;
virDomainSoundModelTypeToString;
virDomainStartupPolicyTypeFromString;
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 18bd010..8d91bb2 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -8302,6 +8302,7 @@ qemuDomainDetachDeviceConfig(virDomainDefPtr vmdef,
{
virDomainDiskDefPtr disk, det_disk;
virDomainNetDefPtr net;
+ virDomainSoundDefPtr sound;
virDomainHostdevDefPtr hostdev, det_hostdev;
virDomainLeaseDefPtr lease, det_lease;
virDomainControllerDefPtr cont, det_cont;
@@ -8330,6 +8331,13 @@ qemuDomainDetachDeviceConfig(virDomainDefPtr vmdef,
virDomainNetDefFree(virDomainNetRemove(vmdef, idx));
break;
+ case VIR_DOMAIN_DEVICE_SOUND:
+ sound = dev->data.sound;
+ if ((idx = virDomainSoundDefFind(vmdef, sound)) < 0)
+ return -1;
+ virDomainSoundDefFree(virDomainSoundDefRemove(vmdef, idx));
+ break;
+
case VIR_DOMAIN_DEVICE_HOSTDEV: {
hostdev = dev->data.hostdev;
if ((idx = virDomainHostdevFind(vmdef, hostdev, &det_hostdev)) < 0) {
@@ -8460,7 +8468,6 @@ qemuDomainDetachDeviceConfig(virDomainDefPtr vmdef,
vmdef->vsock = NULL;
break;
- case VIR_DOMAIN_DEVICE_SOUND:
case VIR_DOMAIN_DEVICE_VIDEO:
case VIR_DOMAIN_DEVICE_GRAPHICS:
case VIR_DOMAIN_DEVICE_HUB:
--
1.8.3.1
5 years
[libvirt] [PATCH] qemu: checkpoint: fix NULL dereference at create time
by Cole Robinson
'cfg' is never initialized here, which causes a crash
later in qemuCheckpointCreateFinalize
Signed-off-by: Cole Robinson <crobinso(a)redhat.com>
---
src/qemu/qemu_checkpoint.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_checkpoint.c b/src/qemu/qemu_checkpoint.c
index d5af6b99bf..58cf337833 100644
--- a/src/qemu/qemu_checkpoint.c
+++ b/src/qemu/qemu_checkpoint.c
@@ -468,7 +468,7 @@ qemuCheckpointCreateXML(virDomainPtr domain,
bool update_current = true;
bool redefine = flags & VIR_DOMAIN_CHECKPOINT_CREATE_REDEFINE;
unsigned int parse_flags = 0;
- g_autoptr(virQEMUDriverConfig) cfg = NULL;
+ g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
g_autoptr(virCaps) caps = NULL;
g_autoptr(virDomainCheckpointDef) def = NULL;
--
2.23.0
5 years
[libvirt] [PATCH 0/4] drop usage of c-strcase gnulib module
by Pavel Hrdina
Pavel Hrdina (4):
use g_ascii_strcasecmp instead of c_strcasecmp from gnulib
use g_ascii_strncasecmp instead of c_strncasecmp from gnulib
syntax-check: update strcase check to refer to GLib
bootstrap.conf: drop usage of c-strcase gnulib module
bootstrap.conf | 1 -
build-aux/syntax-check.mk | 2 +-
src/internal.h | 11 +++++------
tests/virhashtest.c | 2 +-
4 files changed, 7 insertions(+), 9 deletions(-)
--
2.23.0
5 years