[libvirt] [libvirt-python PATCH] override: iterate virDomainFSInfo.devAliases using ndevAliases
by Tomoki Sekiyama
Currently devAliases in virDomainFSInfo struct are iterated as a
NULL-terminated list, but that is not guaranteed. It should use
ndevAliases which stores the number of the items in devAliases.
Signed-off-by: Tomoki Sekiyama <tomoki.sekiyama(a)hds.com>
---
libvirt-override.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/libvirt-override.c b/libvirt-override.c
index 7ef66b7..e51c44d 100644
--- a/libvirt-override.c
+++ b/libvirt-override.c
@@ -8334,8 +8334,8 @@ libvirt_virDomainGetFSInfo(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
PyObject *pyobj_domain;
unsigned int flags;
virDomainFSInfoPtr *fsinfo = NULL;
- char **dev;
int c_retval, i;
+ size_t j;
PyObject *py_retval = NULL;
if (!PyArg_ParseTuple(args, (char *)"Oi:virDomainFSInfo",
@@ -8373,8 +8373,9 @@ libvirt_virDomainGetFSInfo(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
PyTuple_SetItem(info, 2, libvirt_constcharPtrWrap(fs->fstype));
PyTuple_SetItem(info, 3, alias);
- for (dev = fs->devAlias; dev && *dev; dev++)
- if (PyList_Append(alias, libvirt_constcharPtrWrap(*dev)) < 0)
+ for (j = 0; j < fs->ndevAlias; j++)
+ if (PyList_Append(alias,
+ libvirt_constcharPtrWrap(fs->devAlias[j])) < 0)
goto cleanup;
}
9 years, 11 months
[libvirt] [PATCH] Fix race condition in qemuGetProcessInfo
by Eduardo Costa
There is a race condition between the fopen and fscanf calls
in qemuGetProcessInfo. If fopen succeeds, there is a small
possibility that the file no longer exists before reading from it.
Now, if either fopen or fscanf calls fail, the function will behave
just as only fopen had failed.
---
src/qemu/qemu_driver.c | 43 ++++++++++++++++---------------------------
1 file changed, 16 insertions(+), 27 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index ad5f70a..9ab1a81 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -1310,9 +1310,9 @@ qemuGetProcessInfo(unsigned long long *cpuTime, int *lastCpu, long *vm_rss,
{
char *proc;
FILE *pidinfo;
- unsigned long long usertime, systime;
- long rss;
- int cpu;
+ unsigned long long usertime = 0, systime = 0;
+ long rss = 0;
+ int cpu = 0;
int ret;
/* In general, we cannot assume pid_t fits in int; but /proc parsing
@@ -1324,33 +1324,24 @@ qemuGetProcessInfo(unsigned long long *cpuTime, int *lastCpu, long *vm_rss,
if (ret < 0)
return -1;
- if (!(pidinfo = fopen(proc, "r"))) {
- /* VM probably shut down, so fake 0 */
- if (cpuTime)
- *cpuTime = 0;
- if (lastCpu)
- *lastCpu = 0;
- if (vm_rss)
- *vm_rss = 0;
- VIR_FREE(proc);
- return 0;
- }
+ pidinfo = fopen(proc, "r");
VIR_FREE(proc);
/* See 'man proc' for information about what all these fields are. We're
* only interested in a very few of them */
- if (fscanf(pidinfo,
- /* pid -> stime */
- "%*d %*s %*c %*d %*d %*d %*d %*d %*u %*u %*u %*u %*u %llu %llu"
- /* cutime -> endcode */
- "%*d %*d %*d %*d %*d %*d %*u %*u %ld %*u %*u %*u"
- /* startstack -> processor */
- "%*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %*d %d",
- &usertime, &systime, &rss, &cpu) != 4) {
+ if (pidinfo) {
+ if (fscanf(pidinfo,
+ /* pid -> stime */
+ "%*d %*s %*c %*d %*d %*d %*d %*d %*u %*u %*u %*u %*u %llu %llu"
+ /* cutime -> endcode */
+ "%*d %*d %*d %*d %*d %*d %*u %*u %ld %*u %*u %*u"
+ /* startstack -> processor */
+ "%*u %*u %*u %*u %*u %*u %*u %*u %*u %*u %*d %d",
+ &usertime, &systime, &rss, &cpu) != 4) {
+ VIR_WARN("cannot parse process status data");
+ usertime = systime = 0; rss = 0; cpu = 0;
+ }
VIR_FORCE_FCLOSE(pidinfo);
- VIR_WARN("cannot parse process status data");
- errno = -EINVAL;
- return -1;
}
/* We got jiffies
@@ -1374,8 +1365,6 @@ qemuGetProcessInfo(unsigned long long *cpuTime, int *lastCpu, long *vm_rss,
VIR_DEBUG("Got status for %d/%d user=%llu sys=%llu cpu=%d rss=%ld",
(int) pid, tid, usertime, systime, cpu, rss);
- VIR_FORCE_FCLOSE(pidinfo);
-
return 0;
}
--
1.7.9.5
9 years, 12 months
[libvirt] [PATCH] qemu: Use AAVMF as UEFI default on ARMs
by Michal Privoznik
One of the things I've spotted while playing with OVMF is, that on
different architectures the OVMF firmware has different names. Like
arm and aarch64: it's AAVMF_{CODE,VARS}.fd. We should reflect that.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu.conf | 5 ++++-
src/qemu/qemu_conf.c | 9 +++++++--
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu.conf b/src/qemu/qemu.conf
index c6db568..36cacf9 100644
--- a/src/qemu/qemu.conf
+++ b/src/qemu/qemu.conf
@@ -507,5 +507,8 @@
# a list of strings when a single item is in form of:
# ${PATH_TO_UEFI_FW}:${PATH_TO_UEFI_VARS}.
# Later, when libvirt creates per domain variable store, this
-# list is searched for the master image.
+# list is searched for the master image. The UEFI firmware can be
+# called differently on different architectures. For instance,
+# it's OVMF on x86_64 and i686, but it's AAVMF on aarch64. The
+# libvirt default follows this scheme.
#nvram = [ "/usr/share/OVMF/OVMF_CODE.fd:/usr/share/OVMF/OVMF_VARS.fd" ]
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 4764bef..6c038c3 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -107,8 +107,13 @@ void qemuDomainCmdlineDefFree(qemuDomainCmdlineDefPtr def)
VIR_FREE(def);
}
-#define VIR_QEMU_LOADER_FILE_PATH "/usr/share/OVMF/OVMF_CODE.fd"
-#define VIR_QEMU_NVRAM_FILE_PATH "/usr/share/OVMF/OVMF_VARS.fd"
+#if defined(__arm__) || defined(__aarch64__)
+# define VIR_QEMU_LOADER_FILE_PATH "/usr/share/AAVMF/AAVMF_CODE.fd"
+# define VIR_QEMU_NVRAM_FILE_PATH "/usr/share/AAVMF/AAVMF_VARS.fd"
+#else
+# define VIR_QEMU_LOADER_FILE_PATH "/usr/share/OVMF/OVMF_CODE.fd"
+# define VIR_QEMU_NVRAM_FILE_PATH "/usr/share/OVMF/OVMF_VARS.fd"
+#endif
virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool privileged)
{
--
2.0.4
9 years, 12 months
[libvirt] [PATCH 0/4] Resolve some Coverity issues
by John Ferlan
The issues found in the first 3 patches aren't "usually" seen, but I've
had them sitting around awhile and figured they should be posted anyway
since the last issue was seen from a recent change...
John Ferlan (4):
hotplug: Resolve Coverity FORWARD_NULL
virhook: Resolve Coverity NULL_RETURNS
domain_conf: Resolve Coverity CHECKED_RETURN
libxl: Resolve Coverity CHECKED_RETURN
src/conf/domain_conf.c | 2 +-
src/libxl/libxl_migration.c | 3 +--
src/qemu/qemu_hotplug.c | 12 ++++++------
src/util/virhook.c | 3 ++-
4 files changed, 10 insertions(+), 10 deletions(-)
--
1.9.3
9 years, 12 months
[libvirt] [libvirt-python PATCH] fix examples
by Pavel Hrdina
The dhcpleases example had an old usage of print function. The formating
of leases record was also wrong.
The event-test example had an old usage of exceptions.
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
examples/dhcpleases.py | 30 ++++++++++++++++++++----------
examples/event-test.py | 4 ++--
2 files changed, 22 insertions(+), 12 deletions(-)
diff --git a/examples/dhcpleases.py b/examples/dhcpleases.py
index c172dc2..da51f52 100755
--- a/examples/dhcpleases.py
+++ b/examples/dhcpleases.py
@@ -6,8 +6,8 @@ import sys
import time
def usage():
- print "Usage: %s [URI] NETWORK" % sys.argv[0]
- print " Print leases info for a given virtual network"
+ print("Usage: %s [URI] NETWORK" % sys.argv[0])
+ print(" Print leases info for a given virtual network")
uri = None
network = None
@@ -24,18 +24,18 @@ else:
conn = libvirt.open(uri)
if conn == None:
- print "Unable to open connection to libvirt"
+ print("Unable to open connection to libvirt")
sys.exit(1)
try:
net = conn.networkLookupByName(network)
except libvirt.libvirtError:
- print "Network %s not found" % network
+ print("Network %s not found" % network)
sys.exit(0)
leases = net.DHCPLeases();
if (leases == None):
- print "Failed to get leases for %s" % net.name()
+ print("Failed to get leases for %s" % net.name())
sys.exit(0)
def toIPAddrType(addrType):
@@ -44,10 +44,20 @@ def toIPAddrType(addrType):
elif addrType == libvirt.VIR_IP_ADDR_TYPE_IPV6:
return "ipv6"
-print " {0:20} {1:18} {2:9} {3:25} {4:15} {5}".format("Expiry Time", "MAC address", "Protocol", "IP address", "Hostname", "Client ID or DUID")
-print "-"*115
+print(" {0:20} {1:18} {2:9} {3:25} {4:15} {5}".format("Expiry Time",
+ "MAC address",
+ "Protocol",
+ "IP address",
+ "Hostname",
+ "Client ID or DUID"))
+print("-"*115)
for lease in leases:
- print " {0:20}".format(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(lease['expirytime']))),
- print "{0:18} {1:9}".format(lease['mac'], toIPAddrType(lease['type'])),
- print "{0:<25} {1:15} {2}".format("{}/{}".format(lease['ipaddr'], lease['prefix']), lease['hostname'], lease['clientid'])
+ print(" {0:20} {1:18} {2:9} {3:25} {4:15} {5}".format(
+ time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(lease['expirytime'])),
+ lease['mac'],
+ toIPAddrType(lease['type']),
+ "{}/{}".format(lease['ipaddr'], lease['prefix']),
+ lease['hostname'],
+ lease['clientid']
+ ))
diff --git a/examples/event-test.py b/examples/event-test.py
index 6cc33ce..452f659 100755
--- a/examples/event-test.py
+++ b/examples/event-test.py
@@ -220,7 +220,7 @@ class virEventLoopPure:
t.set_last_fired(now)
t.dispatch()
- except (os.error, select.error), e:
+ except (os.error, select.error) as e:
if e.args[0] != errno.EINTR:
raise
finally:
@@ -576,7 +576,7 @@ def usage():
def main():
try:
opts, args = getopt.getopt(sys.argv[1:], "hdl", ["help", "debug", "loop"])
- except getopt.GetoptError, err:
+ except getopt.GetoptError as err:
# print help information and exit:
print(str(err)) # will print something like "option -a not recognized"
usage()
--
2.0.4
9 years, 12 months
[libvirt] [PATCH 0/2] Add more duplicate scsi_host/fc_host adapter checks
by John Ferlan
https://bugzilla.redhat.com/show_bug.cgi?id=1159180
Currently libvirt only detects duplicate fc_host & scsi_host adapter sources
when the incoming source type definition is the same as the pool type. This
misses the even more oddball cases where a scsi_host/fc_host definition is
using a scsi_hostN where the type of the definition isn't the same as the
type of the pool. It's a fairly twisted and perhaps edge kind of case.
A 'fc_host' has two scsi_hostN values that need to be compared against
existing 'scsi_host' pools - first the fc_host "parent" scsi_hostN (if
it exists or was provided) and second the vHBA scsi_hostN as determined
from the wwnn/wwpn. If a 'fc_host' has a 'parent' attribute of a scsi_hostN
that's already in use by some 'scsi_host' pool or if it's vHBA (as created
via nodedev-create) was (for some unknown reason) used by someone for a
'scsi_host' pool, then we have a duplicate.
A 'scsi_host' conversely needs to check against using either the fc_host
'parent' or vHBA. If a 'scsi_host' is using a scsi_hostN of some existing
fc_host 'parent' attribute or vHBA, then we have a duplicate.
To make matters more complex, the 'fc_host' 'parent' attribute doesn't have
to be provided in the fc_host XML. If not provided, then it can be determined
if the vHBA already exists (either via nodedev-create or a running fc_host
pool). This means moving the code that was created for fc_host startup to
find the vHBA parent into the storage_backend_scsi code in order for it to
be used there instead. I did try moving into virutil with no success since
that code wasn't very happy to be calling the virNodeDevice* API's.
The only oddball case that cannot be tested for in this scenario is if
the incoming fc_host definition isn't using a nodedev-create'd vHBA and
it doesn't provide a 'parent' attribute, then it is possible that the
vportCreate startup code will find "an available" scsi_hostN that was
(again for some strange reason) already being used by some 'scsi_host' pool.
Added some more verbiage to the documentation to dissuade usage of a
'scsi_host' for an FC capable scsi_hostN as well as to encourage usage
of the 'parent' attribute in a mixed environment
John Ferlan (2):
storage: Move and rename getVhbaSCSIHostParent
storage: Add mixed fc_host/scsi_host duplicate adapter source checks
docs/formatstorage.html.in | 26 +++++-
src/conf/storage_conf.c | 178 ++++++++++++++++++++++++++++++++++++-
src/conf/storage_conf.h | 8 +-
src/libvirt_private.syms | 1 +
src/parallels/parallels_storage.c | 2 +-
src/storage/storage_backend_scsi.c | 66 +-------------
src/storage/storage_driver.c | 4 +-
7 files changed, 215 insertions(+), 70 deletions(-)
--
1.9.3
9 years, 12 months
[libvirt] [PATCH v3 0/6] improve setting video memory
by Pavel Hrdina
As it was pointed out that QEMU needs that the video memory size should be
rounded to power of two this patch series introduces new macro to round number
to power of two. There are two special cases (more description in the commit
message).
This patch series also fixes few issues that I've found with using vram
attribute and possible some bugs (for example if you set vram for QXL to 0, we
pass the 0 to QEMU which is wrong and we shouldn't pass anything).
There were also wrong usage of primary 'qxl-vga' video device and secondary
'qxl' video device. We've been setting wrong primary/secondary parameters.
The main propose is to start using the vram attribute for other QEMU video
devices next to QXL and also introduce vgamem attribute to set the VGA
framebuffer for QXL video device.
v2: https://www.redhat.com/archives/libvir-list/2014-November/msg00525.html
v1: https://www.redhat.com/archives/libvir-list/2014-November/msg00024.html
Pavel Hrdina (6):
internal: add macro to round value to the next closest power of 2
video: cleanup usage of vram attribute and update documentation
QXL: fix setting ram and vram values for QEMU QXL device
caps: introduce new QEMU capability for vgamem_mb device property
qemu-command: use vram attribute for all video devices
qemu-command: introduce new vgamem attribute for QXL video device
bootstrap.conf | 1 +
docs/formatdomain.html.in | 68 ++++---
docs/schemas/domaincommon.rng | 5 +
src/conf/domain_conf.c | 41 +++-
src/conf/domain_conf.h | 4 +-
src/internal.h | 7 +
src/qemu/qemu_capabilities.c | 33 ++++
src/qemu/qemu_capabilities.h | 4 +
src/qemu/qemu_command.c | 74 ++++++-
src/qemu/qemu_domain.c | 18 ++
src/xen/xen_driver.c | 2 +-
tests/qemucapabilitiesdata/caps_1.2.2-1.caps | 4 +
tests/qemucapabilitiesdata/caps_1.2.2-1.replies | 206 ++++++++++++++++++-
tests/qemucapabilitiesdata/caps_1.3.1-1.caps | 4 +
tests/qemucapabilitiesdata/caps_1.3.1-1.replies | 218 ++++++++++++++++++++-
tests/qemucapabilitiesdata/caps_1.4.2-1.caps | 4 +
tests/qemucapabilitiesdata/caps_1.4.2-1.replies | 218 ++++++++++++++++++++-
tests/qemucapabilitiesdata/caps_1.5.3-1.caps | 4 +
tests/qemucapabilitiesdata/caps_1.5.3-1.replies | 218 ++++++++++++++++++++-
tests/qemucapabilitiesdata/caps_1.6.0-1.caps | 4 +
tests/qemucapabilitiesdata/caps_1.6.0-1.replies | 218 ++++++++++++++++++++-
tests/qemucapabilitiesdata/caps_1.6.50-1.caps | 4 +
tests/qemucapabilitiesdata/caps_1.6.50-1.replies | 218 ++++++++++++++++++++-
tests/qemucapabilitiesdata/caps_2.1.1-1.caps | 4 +
tests/qemucapabilitiesdata/caps_2.1.1-1.replies | 218 ++++++++++++++++++++-
...qemuhotplug-console-compat-2+console-virtio.xml | 2 +-
.../qemuxml2argv-console-compat-2.xml | 2 +-
.../qemuxml2argv-controller-order.xml | 2 +-
.../qemuxml2argv-graphics-listen-network.xml | 2 +-
.../qemuxml2argv-graphics-listen-network2.xml | 2 +-
.../qemuxml2argv-graphics-sdl-fullscreen.xml | 2 +-
.../qemuxml2argvdata/qemuxml2argv-graphics-sdl.xml | 2 +-
.../qemuxml2argv-graphics-spice-agentmouse.xml | 2 +-
.../qemuxml2argv-graphics-spice-compression.args | 2 +-
.../qemuxml2argv-graphics-spice-compression.xml | 4 +-
.../qemuxml2argv-graphics-spice-qxl-vga.xml | 4 +-
.../qemuxml2argv-graphics-spice-sasl.args | 4 +-
.../qemuxml2argv-graphics-spice-sasl.xml | 2 +-
.../qemuxml2argv-graphics-spice-timeout.xml | 2 +-
.../qemuxml2argv-graphics-spice.args | 4 +-
.../qemuxml2argv-graphics-spice.xml | 4 +-
.../qemuxml2argv-graphics-vnc-policy.xml | 2 +-
.../qemuxml2argv-graphics-vnc-sasl.xml | 2 +-
.../qemuxml2argv-graphics-vnc-socket.xml | 2 +-
.../qemuxml2argv-graphics-vnc-tls.xml | 2 +-
.../qemuxml2argv-graphics-vnc-websocket.xml | 2 +-
.../qemuxml2argvdata/qemuxml2argv-graphics-vnc.xml | 2 +-
.../qemuxml2argv-net-bandwidth.xml | 2 +-
.../qemuxml2argv-pci-autoadd-addr.xml | 2 +-
.../qemuxml2argv-pci-autoadd-idx.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-pci-bridge.xml | 2 +-
.../qemuxml2argv-pcihole64-q35.args | 2 +-
.../qemuxml2argv-pcihole64-q35.xml | 2 +-
.../qemuxml2argvdata/qemuxml2argv-pseries-disk.xml | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-q35.args | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-q35.xml | 2 +-
.../qemuxml2argv-serial-spiceport.args | 2 +-
.../qemuxml2argv-serial-spiceport.xml | 2 +-
.../qemuxml2argv-video-qxl-device-vgamem.args | 6 +
.../qemuxml2argv-video-qxl-device-vgamem.xml | 29 +++
.../qemuxml2argv-video-qxl-device.args | 6 +
.../qemuxml2argv-video-qxl-device.xml | 29 +++
.../qemuxml2argv-video-qxl-nodevice.args | 5 +
.../qemuxml2argv-video-qxl-nodevice.xml | 29 +++
.../qemuxml2argv-video-qxl-sec-device-vgamem.args | 8 +
.../qemuxml2argv-video-qxl-sec-device-vgamem.xml | 32 +++
.../qemuxml2argv-video-qxl-sec-device.args | 7 +
.../qemuxml2argv-video-qxl-sec-device.xml | 32 +++
.../qemuxml2argv-video-qxl-sec-nodevice.xml | 32 +++
.../qemuxml2argv-video-vga-device-vgamem.args | 6 +
.../qemuxml2argv-video-vga-device-vgamem.xml | 29 +++
.../qemuxml2argv-video-vga-device.args | 6 +
.../qemuxml2argv-video-vga-device.xml | 29 +++
.../qemuxml2argv-video-vga-nodevice.args | 5 +
.../qemuxml2argv-video-vga-nodevice.xml | 29 +++
tests/qemuxml2argvtest.c | 18 ++
.../qemuxml2xmlout-graphics-listen-network2.xml | 2 +-
.../qemuxml2xmlout-graphics-spice-timeout.xml | 2 +-
.../qemuxml2xmlout-pci-autoadd-addr.xml | 2 +-
.../qemuxml2xmlout-pci-autoadd-idx.xml | 2 +-
tests/qemuxml2xmloutdata/qemuxml2xmlout-q35.xml | 2 +-
tests/utiltest.c | 39 ++++
tests/virt-aa-helper-test | 2 +-
83 files changed, 2129 insertions(+), 134 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-vgamem.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-vgamem.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-nodevice.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-nodevice.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-nodevice.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-vga-device-vgamem.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-vga-device-vgamem.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-vga-device.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-vga-device.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-vga-nodevice.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-vga-nodevice.xml
--
2.0.4
9 years, 12 months
[libvirt] [PATCH v2 0/5] Allow time sync on domain resume
by Michal Privoznik
Diff to v1:
-Fixed issues raised by Peter
Michal Privoznik (5):
Introduce virDomainResumeFlags API
Implement virDomainResumeFlags in all drivers
qemu: Split qemuDomainSetTime into two functions
qemuDomainResumeFlags: Introduce VIR_DOMAIN_RESUME_SYNC_TIME
virsh: Implement virDomainResumeFlags
include/libvirt/libvirt-domain.h | 9 +++
src/driver-hypervisor.h | 5 ++
src/esx/esx_driver.c | 14 ++++-
src/hyperv/hyperv_driver.c | 14 ++++-
src/libvirt-domain.c | 50 ++++++++++++++++
src/libvirt_public.syms | 5 ++
src/libxl/libxl_driver.c | 14 ++++-
src/lxc/lxc_driver.c | 15 ++++-
src/openvz/openvz_driver.c | 13 ++++-
src/parallels/parallels_driver.c | 11 +++-
src/phyp/phyp_driver.c | 12 +++-
src/qemu/qemu_driver.c | 119 ++++++++++++++++++++++++++++-----------
src/remote/remote_driver.c | 1 +
src/remote/remote_protocol.x | 13 ++++-
src/remote_protocol-structs | 5 ++
src/test/test_driver.c | 13 ++++-
src/vbox/vbox_common.c | 11 +++-
src/vmware/vmware_driver.c | 12 +++-
src/xen/xen_driver.c | 14 ++++-
src/xenapi/xenapi_driver.c | 21 ++++++-
tools/virsh-domain.c | 13 ++++-
tools/virsh.pod | 11 ++--
22 files changed, 339 insertions(+), 56 deletions(-)
--
2.0.4
9 years, 12 months
[libvirt] [PATCH] qemu: Drop OVMF whitelist
by Michal Privoznik
As discussed on the upstream list, it's better not to make this
kind of predictions in libvirt. It may happen that qemu learns
how to enable OVMF on other architectures too and we shouldn't
try to chase that.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_capabilities.c | 9 +++------
src/qemu/qemu_command.c | 10 ----------
2 files changed, 3 insertions(+), 16 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 4bd8a4d..56bd2d5 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -3628,7 +3628,6 @@ virQEMUCapsGetDefaultMachine(virQEMUCapsPtr qemuCaps)
static int
virQEMUCapsFillDomainLoaderCaps(virQEMUCapsPtr qemuCaps,
virDomainCapsLoaderPtr capsLoader,
- virArch arch,
char **loader,
size_t nloader)
{
@@ -3656,8 +3655,7 @@ virQEMUCapsFillDomainLoaderCaps(virQEMUCapsPtr qemuCaps,
VIR_DOMAIN_CAPS_ENUM_SET(capsLoader->type,
VIR_DOMAIN_LOADER_TYPE_ROM);
- if (arch == VIR_ARCH_X86_64 &&
- virQEMUCapsGet(qemuCaps, QEMU_CAPS_DRIVE) &&
+ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DRIVE) &&
virQEMUCapsGet(qemuCaps, QEMU_CAPS_DRIVE_FORMAT))
VIR_DOMAIN_CAPS_ENUM_SET(capsLoader->type,
VIR_DOMAIN_LOADER_TYPE_PFLASH);
@@ -3674,14 +3672,13 @@ virQEMUCapsFillDomainLoaderCaps(virQEMUCapsPtr qemuCaps,
static int
virQEMUCapsFillDomainOSCaps(virQEMUCapsPtr qemuCaps,
virDomainCapsOSPtr os,
- virArch arch,
char **loader,
size_t nloader)
{
virDomainCapsLoaderPtr capsLoader = &os->loader;
os->device.supported = true;
- if (virQEMUCapsFillDomainLoaderCaps(qemuCaps, capsLoader, arch,
+ if (virQEMUCapsFillDomainLoaderCaps(qemuCaps, capsLoader,
loader, nloader) < 0)
return -1;
return 0;
@@ -3777,7 +3774,7 @@ virQEMUCapsFillDomainCaps(virDomainCapsPtr domCaps,
domCaps->maxvcpus = maxvcpus;
- if (virQEMUCapsFillDomainOSCaps(qemuCaps, os, domCaps->arch,
+ if (virQEMUCapsFillDomainOSCaps(qemuCaps, os,
loader, nloader) < 0 ||
virQEMUCapsFillDomainDeviceDiskCaps(qemuCaps, disk) < 0 ||
virQEMUCapsFillDomainDeviceHostdevCaps(qemuCaps, hostdev) < 0)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 3d62d11..8ed7934 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -7748,16 +7748,6 @@ qemuBuildDomainLoaderCommandLine(virCommandPtr cmd,
break;
case VIR_DOMAIN_LOADER_TYPE_PFLASH:
- /* UEFI is supported only for x86_64 currently */
- if (def->os.arch != VIR_ARCH_X86_64 &&
- def->os.arch != VIR_ARCH_ARMV7L &&
- def->os.arch != VIR_ARCH_AARCH64) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("pflash is not supported for %s guest architecture"),
- virArchToString(def->os.arch));
- goto cleanup;
- }
-
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DRIVE)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("this QEMU binary doesn't support -drive"));
--
2.0.4
9 years, 12 months
[libvirt] [PATCH] conf: Don't redefine virDomainTPMDefPtr
by Martin Kletzander
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
Notes:
Pushed as a build-breaker.
src/conf/domain_conf.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 4ef2300..439f3c0 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1185,8 +1185,6 @@ typedef enum {
# define VIR_DOMAIN_TPM_DEFAULT_DEVICE "/dev/tpm0"
-typedef struct _virDomainTPMDef virDomainTPMDef;
-typedef virDomainTPMDef *virDomainTPMDefPtr;
struct _virDomainTPMDef {
virDomainTPMBackendType type;
virDomainDeviceInfo info;
--
2.1.3
9 years, 12 months