[libvirt] [PATCH] Add libvirt-daemon-vbox & libvirt-daemon-driver-vbox RPMs
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
Now the VirtualBox driver is a loadable module, it needs
to live in its own sub-RPM
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
libvirt.spec.in | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 51 insertions(+)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index bd889f3..298d96b 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -376,6 +376,9 @@ Requires: libvirt-daemon-driver-uml = %{version}-%{release}
%if %{with_xen}
Requires: libvirt-daemon-driver-xen = %{version}-%{release}
%endif
+ %if %{with_vbox}
+Requires: libvirt-daemon-driver-vbox = %{version}-%{release}
+ %endif
Requires: libvirt-daemon-driver-interface = %{version}-%{release}
Requires: libvirt-daemon-driver-secret = %{version}-%{release}
@@ -880,6 +883,19 @@ Xen
%endif
+ %if %{with_vbox}
+%package daemon-driver-vbox
+Summary: VirtualBox driver plugin for the libvirtd daemon
+Group: Development/Libraries
+Requires: libvirt-daemon = %{version}-%{release}
+
+%description daemon-driver-vbox
+The vbox driver plugin for the libvirtd daemon, providing
+an implementation of the hypervisor driver APIs using
+VirtualBox
+ %endif
+
+
%if %{with_libxl}
%package daemon-driver-libxl
Summary: Libxl driver plugin for the libvirtd daemon
@@ -1012,6 +1028,30 @@ Requires: xen
Server side daemon and driver required to manage the virtualization
capabilities of XEN
%endif
+
+ %if %{with_vbox}
+%package daemon-vbox
+Summary: Server side daemon & driver required to run VirtualBoxguests
+Group: Development/Libraries
+
+Requires: libvirt-daemon = %{version}-%{release}
+ %if %{with_driver_modules}
+ %if %{with_vbox}
+Requires: libvirt-daemon-driver-vbox = %{version}-%{release}
+ %endif
+Requires: libvirt-daemon-driver-interface = %{version}-%{release}
+Requires: libvirt-daemon-driver-network = %{version}-%{release}
+Requires: libvirt-daemon-driver-nodedev = %{version}-%{release}
+Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
+Requires: libvirt-daemon-driver-secret = %{version}-%{release}
+Requires: libvirt-daemon-driver-storage = %{version}-%{release}
+ %endif
+Requires: vbox
+
+%description daemon-vbox
+Server side daemon and driver required to manage the virtualization
+capabilities of VirtualBox
+ %endif
%endif # %{with_libvirtd}
%package client
@@ -1869,6 +1909,12 @@ fi
%defattr(-, root, root)
%{_libdir}/%{name}/connection-driver/libvirt_driver_libxl.so
%endif
+
+ %if %{with_vbox}
+%files daemon-driver-vbox
+%defattr(-, root, root)
+%{_libdir}/%{name}/connection-driver/libvirt_driver_vbox.so
+ %endif
%endif # %{with_driver_modules}
%if %{with_qemu_tcg}
@@ -1895,6 +1941,11 @@ fi
%files daemon-xen
%defattr(-, root, root)
%endif
+
+ %if %{with_vbox}
+%files daemon-vbox
+%defattr(-, root, root)
+ %endif
%endif # %{with_libvirtd}
%if %{with_sanlock}
--
1.8.1.4
11 years, 6 months
[libvirt] [PATCH] Define __USE_MINGW_ANSI_STDIO in config.h
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
Latest mingw64 can provide *printf functions which
support GNU format specifiers. It won't do that unless
you have defined __USE_MINGW_ANSI_STDIO though.
GNULIB's 'asprintf' module detected that mingw had
the asprintf function, but didn't define the
__USE_MINGW_ANSI_STDIO so we got left with the version
offering Win32 format specifiers, instead of GNU formats.
It could perhaps be argued that gnulib's 'asprintf'
could be defining __USE_MINGW_ANSI_STDIO for us ?
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
configure.ac | 3 +++
1 file changed, 3 insertions(+)
diff --git a/configure.ac b/configure.ac
index 3f3f11e..fe916d1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2123,6 +2123,9 @@ AC_SUBST([VERSION_SCRIPT_FLAGS])
AC_SUBST([MSCOM_LIBS])
+dnl http://sourceforge.net/apps/trac/mingw-w64/wiki/gnu%20printf
+AC_DEFINE_UNQUOTED([__USE_MINGW_ANSI_STDIO], 1, [Enable GNU style printf formatters])
+
dnl Look for windres to build a Windows icon resource.
case "$host" in
*-*-mingw* | *-*-cygwin* | *-*-msvc* )
--
1.8.2.1
11 years, 6 months
[libvirt] [PATCH] qemu: report useful error failling to destroy domain gracefully
by Guannan Ren
Resolves:https://bugzilla.redhat.com/show_bug.cgi?id=927620
#kill -STOP `pidof qemu-kvm`
#virsh destroy $guest --graceful
error: Failed to destroy domain testVM
error: An error occurred, but the cause is unknown
With --graceful, SIGTERM always is emitted to kill driver
process, but it won't success till burning out waiting time
in case of process being stopped.
But domain destroy without --graceful can work, SIGKILL will
be emitted to the stopped process after 10 secs which always
kills a process even one that is currently stopped.
So report an error after burning out waiting time in this case.
---
src/qemu/qemu_process.c | 2 +-
src/util/virprocess.c | 5 +++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 4a7c612..e5b4679 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -3930,7 +3930,7 @@ qemuProcessKill(virDomainObjPtr vm, unsigned int flags)
}
}
- if ((flags & VIR_QEMU_PROCESS_KILL_NOWAIT)) {
+ if (flags & VIR_QEMU_PROCESS_KILL_NOWAIT) {
virProcessKill(vm->pid,
(flags & VIR_QEMU_PROCESS_KILL_FORCE) ?
SIGKILL : SIGTERM);
diff --git a/src/util/virprocess.c b/src/util/virprocess.c
index 99db003..a79ed05 100644
--- a/src/util/virprocess.c
+++ b/src/util/virprocess.c
@@ -310,8 +310,9 @@ virProcessKillPainfully(pid_t pid, bool force)
usleep(200 * 1000);
}
- VIR_DEBUG("Timed out waiting after SIGKILL to process %lld",
- (long long)pid);
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ _("Failed to terminate process %lld with SIG%s"),
+ (long long)pid, signame);
cleanup:
return ret;
--
1.8.1.4
11 years, 6 months
[libvirt] [PATCH] Add missing c-ctype.h to virfile.c
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
The virfile.c file uses c_isalpha on Win32 platforms, so must
include c-ctype.h
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
src/util/virfile.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/util/virfile.c b/src/util/virfile.c
index eb88c83..4637919 100644
--- a/src/util/virfile.c
+++ b/src/util/virfile.c
@@ -59,6 +59,8 @@
#include "virstoragefile.h"
#include "virutil.h"
+#include "c-ctype.h"
+
#define VIR_FROM_THIS VIR_FROM_NONE
int virFileClose(int *fdptr, virFileCloseFlags flags)
--
1.8.1.4
11 years, 6 months
[libvirt] [PATCH] Include GNULIB mkdtemp module
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
The mkdtemp function is missing on mingw platforms. It is
used in various Linux specific places in libvirt, but
recently became used in fdstreamtest.c which is cross
platform. Thus the GNULIB mkdtemp module should be used
to proide mkdtemp.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
bootstrap.conf | 1 +
1 file changed, 1 insertion(+)
diff --git a/bootstrap.conf b/bootstrap.conf
index 6e03757..616eee1 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -73,6 +73,7 @@ maintainer-makefile
manywarnings
mkostemp
mkostemps
+mkdtemp
mktempd
net_if
netdb
--
1.8.1.4
11 years, 6 months
[libvirt] [PATCH] Set PKG_CONFIG_LIBDIR in autobuild.sh
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
If PKG_CONFIG_LIBDIR is not set when doing mingw32/64 builds,
then pkg-config may silently fallback to native versions of
libraries, with predictably bad results. Setting PKG_CONFIG_LIBDIR
forces it to only consider the mingw32/64 libraries.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
autobuild.sh | 2 ++
1 file changed, 2 insertions(+)
diff --git a/autobuild.sh b/autobuild.sh
index a8781b0..7da8cb5 100755
--- a/autobuild.sh
+++ b/autobuild.sh
@@ -69,6 +69,7 @@ fi
if test -x /usr/bin/i686-w64-mingw32-gcc ; then
make distclean
+ PKG_CONFIG_LIBDIR="/usr/i686-w64-mingw32/sys-root/mingw/lib/pkgconfig:/usr/i686-w64-mingw32/sys-root/mingw/share/pkgconfig" \
PKG_CONFIG_PATH="$AUTOBUILD_INSTALL_ROOT/i686-w64-mingw32/sys-root/mingw/lib/pkgconfig" \
CC="i686-w64-mingw32-gcc" \
../configure \
@@ -88,6 +89,7 @@ fi
if test -x /usr/bin/x86_64-w64-mingw32-gcc ; then
make distclean
+ PKG_CONFIG_LIBDIR="/usr/x86_64-w64-mingw32/sys-root/mingw/lib/pkgconfig:/usr/x86_64-w64-mingw32/sys-root/mingw/share/pkgconfig" \
PKG_CONFIG_PATH="$AUTOBUILD_INSTALL_ROOT/x86_64-w64-mingw32/sys-root/mingw/lib/pkgconfig" \
CC="x86_64-w64-mingw32-gcc" \
../configure \
--
1.8.1.4
11 years, 6 months
[libvirt] [PATCH 00/25 v4] Support scsi device passthrough via scsi-generic
by Osier Yang
This adds the support for qemu's scsi-generic device, which can be
used to passthrough scsi host device. An example of the XML:
<hostdev mode='subsystem' type='scsi' managed='no'>
<source>
<adapter name='scsi_host7'/>
<address bus='0' target='0' unit='0'/>
</source>
<address type='drive' controller='0' bus='0' target='0' unit='1'/>
</hostdev>
v3 - v4 (details in each patch):
* Rebased on top
* Support <shareable>
* Support <sgio>
* Various preparation patches for <shareable> and <sgio>
* Split 1/10 in v3 into 2 patches (<readonly> now is a single patch,
for easy reviewing, and <readonly> is a sub-element of "hostdev"
in rng schema, because it could be used by other type hostdev in
future).
* Split 4/10 in v3 into 2 patches (bootindex support now is a single
patch, for easy reviewing)
v2.5 - v3 (details in each patch):
* 1/10 and 2/10 of v2.5 are pushed
* 8/10 of v2.5 is splitted
* A better way to generate the address for scsi host device instead of
the rigid one.
* Support all scsi controllers when building the qemu command line.
* Figure out the limits of the qemu properties, and do checking
* Don't forget DAC and apparmor security backends
* Orgnize the patches in a better way.
* Fix the make check failure
Han Cheng (7):
conf: Generic XMLs for scsi hostdev
qemu: New cap flags for scsi-generic
utils: util functions for scsi hostdev
qemu: Build qemu command line for scsi host device
qemu: Introduce activeScsiHostdevs list for scsi host devices
qemu: Add hotplug support for scsi host device
qemu: Allow the scsi-generic device in cgroup
Osier Yang (18):
rng: Interleave hostdev elements
Introduce <readonly> for hostdev
qemu: Support bootindex for scsi host device
security: Manage the security label for scsi host device
qemu: Refactor helpers for USB device attachment
conf: Generate address for scsi host device automatically
conf: Introduce <shareable> for hostdev
utils: Rename scsi->path to scsi->sg_path
qemu: Rename qemu_driver->sharedDisks to qemu_driver->sharedDevices
utils: Add a helper to get the device name that sg device mapped to
qemu: Refactor the helpers to track shared scsi host device
qemu: Manage shared device entry for scsi host device
Rename virDomainDiskSGIO to virDomainDeviceSGIO
conf: Introduce sgio for hostdev
qemu: Move qemuSetUnprivSGIO into qemu_conf.c
qemu: Refactor qemuSetUnprivSGIO to support scsi host device
qemu: Set unpriv_sgio for scsi host device
qemu: Check conflicts for shared scsi host device
docs/formatdomain.html.in | 49 ++-
docs/schemas/domaincommon.rng | 86 +++-
po/POTFILES.in | 1 +
src/Makefile.am | 1 +
src/conf/domain_audit.c | 10 +
src/conf/domain_conf.c | 353 +++++++++++++++-
src/conf/domain_conf.h | 24 +-
src/libvirt_private.syms | 23 ++
src/qemu/qemu_capabilities.c | 21 +-
src/qemu/qemu_capabilities.h | 2 +
src/qemu/qemu_cgroup.c | 46 ++-
src/qemu/qemu_command.c | 146 ++++++-
src/qemu/qemu_command.h | 6 +
src/qemu/qemu_conf.c | 372 ++++++++++++-----
src/qemu/qemu_conf.h | 38 +-
src/qemu/qemu_driver.c | 25 +-
src/qemu/qemu_hostdev.c | 235 +++++++++++
src/qemu/qemu_hostdev.h | 10 +
src/qemu/qemu_hotplug.c | 210 ++++++++--
src/qemu/qemu_process.c | 64 +--
src/qemu/qemu_process.h | 1 -
src/security/security_apparmor.c | 49 ++-
src/security/security_dac.c | 76 +++-
src/security/security_selinux.c | 72 +++-
src/util/virscsi.c | 455 +++++++++++++++++++++
src/util/virscsi.h | 88 ++++
tests/qemuhelpdata/qemu-1.0-device | 10 +
tests/qemuhelpdata/qemu-1.1.0-device | 10 +
tests/qemuhelpdata/qemu-1.2.0-device | 5 +
tests/qemuhelpdata/qemu-kvm-1.2.0-device | 5 +
tests/qemuhelptest.c | 19 +-
.../qemuxml2argv-hostdev-scsi-boot.args | 9 +
.../qemuxml2argv-hostdev-scsi-boot.xml | 34 ++
.../qemuxml2argv-hostdev-scsi-lsi.args | 9 +
.../qemuxml2argv-hostdev-scsi-lsi.xml | 35 ++
.../qemuxml2argv-hostdev-scsi-readonly.args | 9 +
.../qemuxml2argv-hostdev-scsi-readonly.xml | 36 ++
.../qemuxml2argv-hostdev-scsi-sgio.xml | 35 ++
.../qemuxml2argv-hostdev-scsi-shareable.xml | 36 ++
.../qemuxml2argv-hostdev-scsi-virtio-scsi.args | 9 +
.../qemuxml2argv-hostdev-scsi-virtio-scsi.xml | 35 ++
tests/qemuxml2argvtest.c | 18 +
tests/qemuxml2xmltest.c | 6 +
43 files changed, 2469 insertions(+), 314 deletions(-)
create mode 100644 src/util/virscsi.c
create mode 100644 src/util/virscsi.h
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-boot.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-boot.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-lsi.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-lsi.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-readonly.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-readonly.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-sgio.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-shareable.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-virtio-scsi.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hostdev-scsi-virtio-scsi.xml
--
1.8.1.4
11 years, 6 months
[libvirt] [PATCH v3] qemu: Add callback struct for qemuBuildCommandLine
by Osier Yang
Since 0d70656afded, it starts to access the sysfs files to build
the qemu command line (by virSCSIDeviceGetSgName, which is to find
out the scsi generic device name by adpater:bus:target:unit), there
is no way to work around, qemu wants to see the scsi generic device
like "/dev/sg6" anyway.
And there might be other places which need to access sysfs files
when building qemu command line in future.
Instead of increasing the arguments of qemuBuildCommandLine, this
introduces a new callback for qemuBuildCommandLine, and thus tests
can register their own callbacks for sysfs test input files accessing.
* src/qemu/qemu_command.h: (New callback struct
qemuBuildCommandLineCallbacks;
extern buildCommandLineCallbacks)
* src/qemu/qemu_command.c: (wire up the callback struct)
* src/qemu/qemu_driver.c: (Use the new syntax of qemuBuildCommandLine)
* src/qemu/qemu_hotplug.c: Likewise
* src/qemu/qemu_process.c: Likewise
* tests/qemuxml2argvtest.c: (Helper testSCSIDeviceGetSgName;
callback struct testCallbacks;
Use the callback struct)
* src/tests/qemuxmlnstest.c Use the new syntax of qemuBuildCommandLine)
---
src/qemu/qemu_command.c | 28 ++++++++++++++++++++--------
src/qemu/qemu_command.h | 16 ++++++++++++++--
src/qemu/qemu_driver.c | 3 ++-
src/qemu/qemu_hotplug.c | 6 ++++--
src/qemu/qemu_process.c | 3 ++-
tests/qemuxml2argvtest.c | 21 ++++++++++++++++++++-
tests/qemuxmlnstest.c | 3 ++-
7 files changed, 64 insertions(+), 16 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 5b95c07..e775479 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -4757,18 +4757,25 @@ qemuBuildUSBHostdevUsbDevStr(virDomainHostdevDefPtr dev)
char *
qemuBuildSCSIHostdevDrvStr(virDomainHostdevDefPtr dev,
- virQEMUCapsPtr qemuCaps ATTRIBUTE_UNUSED)
+ virQEMUCapsPtr qemuCaps ATTRIBUTE_UNUSED,
+ qemuBuildCommandLineCallbacksPtr callbacks)
{
virBuffer buf = VIR_BUFFER_INITIALIZER;
char *sg = NULL;
- if (!(sg = virSCSIDeviceGetSgName(dev->source.subsys.u.scsi.adapter,
- dev->source.subsys.u.scsi.bus,
- dev->source.subsys.u.scsi.target,
- dev->source.subsys.u.scsi.unit))) {
- goto error;
+ if (!callbacks) {
+ virReportError(VIR_ERR_INVALID_ARG, "%s",
+ _("callbacks cannot be NULL"));
+ return NULL;
}
+ sg = (callbacks->qemuGetSCSIDeviceSgName)(dev->source.subsys.u.scsi.adapter,
+ dev->source.subsys.u.scsi.bus,
+ dev->source.subsys.u.scsi.target,
+ dev->source.subsys.u.scsi.unit);
+ if (!sg)
+ goto error;
+
virBufferAsprintf(&buf, "file=/dev/%s,if=none", sg);
virBufferAsprintf(&buf, ",id=%s-%s",
virDomainDeviceAddressTypeToString(dev->info->type),
@@ -6405,6 +6412,10 @@ qemuBuildGraphicsCommandLine(virQEMUDriverConfigPtr cfg,
return 0;
}
+qemuBuildCommandLineCallbacks buildCommandLineCallbacks = {
+ .qemuGetSCSIDeviceSgName = virSCSIDeviceGetSgName,
+};
+
/*
* Constructs a argv suitable for launching qemu with config defined
* for a given virtual machine.
@@ -6422,7 +6433,8 @@ qemuBuildCommandLine(virConnectPtr conn,
const char *migrateFrom,
int migrateFd,
virDomainSnapshotObjPtr snapshot,
- enum virNetDevVPortProfileOp vmop)
+ enum virNetDevVPortProfileOp vmop,
+ qemuBuildCommandLineCallbacksPtr callbacks)
{
virErrorPtr originalError = NULL;
int i, j;
@@ -8243,7 +8255,7 @@ qemuBuildCommandLine(virConnectPtr conn,
char *drvstr;
virCommandAddArg(cmd, "-drive");
- if (!(drvstr = qemuBuildSCSIHostdevDrvStr(hostdev, qemuCaps)))
+ if (!(drvstr = qemuBuildSCSIHostdevDrvStr(hostdev, qemuCaps, callbacks)))
goto error;
virCommandAddArg(cmd, drvstr);
VIR_FREE(drvstr);
diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h
index 36dfa6b..23b6af3 100644
--- a/src/qemu/qemu_command.h
+++ b/src/qemu/qemu_command.h
@@ -51,6 +51,16 @@
# define QEMU_WEBSOCKET_PORT_MIN 5700
# define QEMU_WEBSOCKET_PORT_MAX 65535
+typedef struct _qemuBuildCommandLineCallbacks qemuBuildCommandLineCallbacks;
+typedef qemuBuildCommandLineCallbacks *qemuBuildCommandLineCallbacksPtr;
+struct _qemuBuildCommandLineCallbacks {
+ char * (*qemuGetSCSIDeviceSgName) (const char *adapter,
+ unsigned int bus,
+ unsigned int target,
+ unsigned int unit);
+};
+
+extern qemuBuildCommandLineCallbacks buildCommandLineCallbacks;
virCommandPtr qemuBuildCommandLine(virConnectPtr conn,
virQEMUDriverPtr driver,
@@ -61,7 +71,8 @@ virCommandPtr qemuBuildCommandLine(virConnectPtr conn,
const char *migrateFrom,
int migrateFd,
virDomainSnapshotObjPtr current_snapshot,
- enum virNetDevVPortProfileOp vmop)
+ enum virNetDevVPortProfileOp vmop,
+ qemuBuildCommandLineCallbacksPtr callbacks)
ATTRIBUTE_NONNULL(1);
/* Generate string for arch-specific '-device' parameter */
@@ -142,7 +153,8 @@ char * qemuBuildUSBHostdevDevStr(virDomainHostdevDefPtr dev,
virQEMUCapsPtr qemuCaps);
char * qemuBuildSCSIHostdevDrvStr(virDomainHostdevDefPtr dev,
- virQEMUCapsPtr qemuCaps);
+ virQEMUCapsPtr qemuCaps,
+ qemuBuildCommandLineCallbacksPtr callbacks);
char * qemuBuildSCSIHostdevDevStr(virDomainDefPtr def,
virDomainHostdevDefPtr dev,
virQEMUCapsPtr qemuCaps);
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index b1630f8..cb46276 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -5362,7 +5362,8 @@ static char *qemuConnectDomainXMLToNative(virConnectPtr conn,
if (!(cmd = qemuBuildCommandLine(conn, driver, def,
&monConfig, monitor_json, qemuCaps,
- NULL, -1, NULL, VIR_NETDEV_VPORT_PROFILE_OP_NO_OP)))
+ NULL, -1, NULL, VIR_NETDEV_VPORT_PROFILE_OP_NO_OP,
+ &buildCommandLineCallbacks)))
goto cleanup;
ret = virCommandToString(cmd);
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index d037c9d..77d9f4f 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -1226,7 +1226,8 @@ qemuDomainAttachHostScsiDevice(virQEMUDriverPtr driver,
if (qemuAssignDeviceHostdevAlias(vm->def, hostdev, 0) < 0)
goto cleanup;
- if (!(drvstr = qemuBuildSCSIHostdevDrvStr(hostdev, priv->qemuCaps)))
+ if (!(drvstr = qemuBuildSCSIHostdevDrvStr(hostdev, priv->qemuCaps,
+ &buildCommandLineCallbacks)))
goto cleanup;
if (!(devstr = qemuBuildSCSIHostdevDevStr(vm->def, hostdev, priv->qemuCaps)))
@@ -2543,7 +2544,8 @@ qemuDomainDetachHostScsiDevice(virQEMUDriverPtr driver,
return -1;
}
- if (!(drvstr = qemuBuildSCSIHostdevDrvStr(detach, priv->qemuCaps)))
+ if (!(drvstr = qemuBuildSCSIHostdevDrvStr(detach, priv->qemuCaps,
+ &buildCommandLineCallbacks)))
goto cleanup;
if (!(devstr = qemuBuildSCSIHostdevDevStr(vm->def, detach, priv->qemuCaps)))
goto cleanup;
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index dbbb7bf..3b247a5 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -3638,7 +3638,8 @@ int qemuProcessStart(virConnectPtr conn,
VIR_DEBUG("Building emulator command line");
if (!(cmd = qemuBuildCommandLine(conn, driver, vm->def, priv->monConfig,
priv->monJSON, priv->qemuCaps,
- migrateFrom, stdin_fd, snapshot, vmop)))
+ migrateFrom, stdin_fd, snapshot, vmop,
+ &buildCommandLineCallbacks)))
goto cleanup;
/* now that we know it is about to start call the hook if present */
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index c751440..7d3e521 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -82,6 +82,24 @@ typedef enum {
FLAG_JSON = 1 << 3,
} virQemuXML2ArgvTestFlags;
+static char *
+testSCSIDeviceGetSgName(const char *adapter ATTRIBUTE_UNUSED,
+ unsigned int bus ATTRIBUTE_UNUSED,
+ unsigned int target ATTRIBUTE_UNUSED,
+ unsigned int unit ATTRIBUTE_UNUSED)
+{
+ char *sg = NULL;
+
+ if (VIR_STRDUP(sg, "sg0") < 0)
+ return NULL;
+
+ return sg;
+}
+
+static qemuBuildCommandLineCallbacks testCallbacks = {
+ .qemuGetSCSIDeviceSgName = testSCSIDeviceGetSgName,
+};
+
static int testCompareXMLToArgvFiles(const char *xml,
const char *cmdline,
virQEMUCapsPtr extraFlags,
@@ -157,7 +175,8 @@ static int testCompareXMLToArgvFiles(const char *xml,
if (!(cmd = qemuBuildCommandLine(conn, &driver, vmdef, &monitor_chr,
(flags & FLAG_JSON), extraFlags,
migrateFrom, migrateFd, NULL,
- VIR_NETDEV_VPORT_PROFILE_OP_NO_OP))) {
+ VIR_NETDEV_VPORT_PROFILE_OP_NO_OP,
+ &testCallbacks))) {
if (flags & FLAG_EXPECT_FAILURE) {
ret = 0;
if (virTestGetDebug() > 1)
diff --git a/tests/qemuxmlnstest.c b/tests/qemuxmlnstest.c
index 952b8e2..9d3d2a0 100644
--- a/tests/qemuxmlnstest.c
+++ b/tests/qemuxmlnstest.c
@@ -113,7 +113,8 @@ static int testCompareXMLToArgvFiles(const char *xml,
if (!(cmd = qemuBuildCommandLine(conn, &driver,
vmdef, &monitor_chr, json, extraFlags,
migrateFrom, migrateFd, NULL,
- VIR_NETDEV_VPORT_PROFILE_OP_NO_OP)))
+ VIR_NETDEV_VPORT_PROFILE_OP_NO_OP,
+ NULL)))
goto fail;
if (!!virGetLastError() != expectError) {
--
1.8.1.4
11 years, 6 months
[libvirt] [PATCH] test: fix VPATH fchosttest failure
by Viktor Mihajlovski
Running make check in a VPATH configured build directory fails
in fchosttest as the test data files are searched for relative to
the current working directory.
Signed-off-by: Viktor Mihajlovski <mihajlov(a)linux.vnet.ibm.com>
---
This may become obsolete with Osier's pending patches, but
it helps to get over the build failures for the moment...
tests/fchosttest.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/tests/fchosttest.c b/tests/fchosttest.c
index 035f721..ccc2df9 100644
--- a/tests/fchosttest.c
+++ b/tests/fchosttest.c
@@ -19,10 +19,13 @@
#include <config.h>
+#include "virstring.h"
#include "virutil.h"
#include "testutils.h"
-#define TEST_FC_HOST_PREFIX "./fchostdata/fc_host/"
+static char * fchost_prefix;
+
+#define TEST_FC_HOST_PREFIX fchost_prefix
#define TEST_FC_HOST_NUM 5
/* Test virIsCapableFCHost */
@@ -158,6 +161,12 @@ mymain(void)
{
int ret = 0;
+ if (virAsprintf(&fchost_prefix,"%s/%s", abs_srcdir,
+ "fchostdata/fc_host/") < 0) {
+ ret = -1;
+ goto cleanup;
+ }
+
if (virtTestRun("test1", 1, test1, NULL) < 0)
ret = -1;
if (virtTestRun("test2", 1, test2, NULL) < 0)
@@ -169,6 +178,8 @@ mymain(void)
if (virtTestRun("test5", 1, test5, NULL) < 0)
ret = -1;
+cleanup:
+ VIR_FREE(fchost_prefix);
return ret;
}
--
1.7.9.5
11 years, 6 months