[libvirt] [v3] gobject: Add wrapper virDomainSetTime()
by Zeeshan Ali (Khattak)
---
libvirt-gobject/libvirt-gobject-domain.c | 134 +++++++++++++++++++++++++++++++
libvirt-gobject/libvirt-gobject-domain.h | 15 +++-
libvirt-gobject/libvirt-gobject.sym | 9 +++
3 files changed, 157 insertions(+), 1 deletion(-)
diff --git a/libvirt-gobject/libvirt-gobject-domain.c b/libvirt-gobject/libvirt-gobject-domain.c
index 34eb7ca..cb8096b 100644
--- a/libvirt-gobject/libvirt-gobject-domain.c
+++ b/libvirt-gobject/libvirt-gobject-domain.c
@@ -1886,3 +1886,137 @@ gboolean gvir_domain_get_has_current_snapshot(GVirDomain *dom,
return TRUE;
}
+
+/**
+ * gvir_domain_set_time:
+ * @dom: the domain
+ * @date_time: (allow-none)(transfer none): the time to set as #GDateTime.
+ * @flags: Unused, pass 0.
+ * @error: (allow-none): Place-holder for error or %NULL
+ *
+ * This function tries to set guest time to the given value. The passed
+ * time must in UTC.
+ *
+ * If @date_time is %NULL, the time is reset using the domain's RTC.
+ *
+ * Please note that some hypervisors may require guest agent to be configured
+ * and running in order for this function to work.
+ *
+ * Returns: %TRUE on success, %FALSE otherwise.
+ */
+gboolean gvir_domain_set_time(GVirDomain *dom,
+ GDateTime *date_time,
+ guint flags G_GNUC_UNUSED,
+ GError **err)
+{
+ int ret;
+ GTimeVal tv;
+ glong seconds;
+ glong nseconds;
+ guint settime_flags;
+
+ g_return_val_if_fail(GVIR_IS_DOMAIN(dom), FALSE);
+ g_return_val_if_fail(err == NULL || *err == NULL, FALSE);
+ g_return_val_if_fail(flags == 0, FALSE);
+
+ if (date_time != NULL) {
+ if (!g_date_time_to_timeval(date_time, &tv)) {
+ g_set_error_literal(err, GVIR_DOMAIN_ERROR,
+ 0,
+ "Failed to parse given time argument");
+ return FALSE;
+ }
+
+ seconds = tv.tv_sec;
+ nseconds = tv.tv_usec * 1000;
+ settime_flags = 0;
+ } else {
+ seconds = 0;
+ nseconds = 0;
+ settime_flags = VIR_DOMAIN_TIME_SYNC;
+ }
+
+ ret = virDomainSetTime(dom->priv->handle, seconds, nseconds, settime_flags);
+ if (ret < 0) {
+ gvir_set_error_literal(err, GVIR_DOMAIN_ERROR,
+ 0,
+ "Unable to set domain time");
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+static void
+gvir_domain_set_time_helper(GTask *task,
+ gpointer object,
+ gpointer task_data,
+ GCancellable *cancellable G_GNUC_UNUSED)
+{
+ GVirDomain *dom = GVIR_DOMAIN(object);
+ GDateTime *date_time = (GDateTime *) task_data;
+ GError *err = NULL;
+
+ if (!gvir_domain_set_time(dom, date_time, 0, &err))
+ g_task_return_error(task, err);
+ else
+ g_task_return_boolean(task, TRUE);
+}
+
+/**
+ * gvir_domain_set_time_async:
+ * @dom: the domain
+ * @date_time: (allow-none)(transfer none): the time to set as #GDateTime.
+ * @flags: bitwise-OR of #GVirDomainSetTimeFlags.
+ * @cancellable: (allow-none)(transfer none): cancellation object
+ * @callback: (scope async): completion callback
+ * @user_data: (closure): opaque data for callback
+ *
+ * Asynchronous variant of #gvir_domain_set_time.
+ */
+void gvir_domain_set_time_async(GVirDomain *dom,
+ GDateTime *date_time,
+ guint flags G_GNUC_UNUSED,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ GTask *task;
+
+ g_return_if_fail(GVIR_IS_DOMAIN(dom));
+ g_return_if_fail((cancellable == NULL) || G_IS_CANCELLABLE(cancellable));
+ g_return_if_fail(flags == 0);
+
+ task = g_task_new(G_OBJECT(dom),
+ cancellable,
+ callback,
+ user_data);
+ if (date_time != NULL)
+ g_task_set_task_data(task,
+ g_date_time_ref(date_time),
+ (GDestroyNotify)g_date_time_unref);
+ g_task_run_in_thread(task, gvir_domain_set_time_helper);
+
+ g_object_unref(task);
+}
+
+/**
+ * gvir_domain_set_time_finish:
+ * @dom: the domain
+ * @result: (transfer none): async method result
+ * @err: Place-holder for possible errors
+ *
+ * Finishes the operation started by #gvir_domain_set_time_async.
+ *
+ * Returns: %TRUE on success, %FALSE otherwise.
+ */
+gboolean gvir_domain_set_time_finish(GVirDomain *dom,
+ GAsyncResult *result,
+ GError **err)
+{
+ g_return_val_if_fail(GVIR_IS_DOMAIN(dom), FALSE);
+ g_return_val_if_fail(g_task_is_valid(result, G_OBJECT(dom)), FALSE);
+ g_return_val_if_fail(err == NULL || *err == NULL, FALSE);
+
+ return g_task_propagate_boolean(G_TASK(result), err);
+}
diff --git a/libvirt-gobject/libvirt-gobject-domain.h b/libvirt-gobject/libvirt-gobject-domain.h
index 4fe381e..099cde3 100644
--- a/libvirt-gobject/libvirt-gobject-domain.h
+++ b/libvirt-gobject/libvirt-gobject-domain.h
@@ -215,7 +215,6 @@ typedef enum {
GVIR_DOMAIN_SNAPSHOT_LIST_EXTERNAL = VIR_DOMAIN_SNAPSHOT_LIST_EXTERNAL
} GVirDomainSnapshotListFlags;
-
typedef struct _GVirDomainInfo GVirDomainInfo;
struct _GVirDomainInfo
{
@@ -401,6 +400,20 @@ gboolean gvir_domain_get_has_current_snapshot(GVirDomain *dom,
gboolean *has_current_snapshot,
GError **error);
+gboolean gvir_domain_set_time(GVirDomain *dom,
+ GDateTime *date_time,
+ guint flags,
+ GError **err);
+void gvir_domain_set_time_async(GVirDomain *dom,
+ GDateTime *date_time,
+ guint flags,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+gboolean gvir_domain_set_time_finish(GVirDomain *dom,
+ GAsyncResult *result,
+ GError **err);
+
G_END_DECLS
#endif /* __LIBVIRT_GOBJECT_DOMAIN_H__ */
diff --git a/libvirt-gobject/libvirt-gobject.sym b/libvirt-gobject/libvirt-gobject.sym
index ca89a45..cbfaa71 100644
--- a/libvirt-gobject/libvirt-gobject.sym
+++ b/libvirt-gobject/libvirt-gobject.sym
@@ -304,4 +304,13 @@ LIBVIRT_GOBJECT_0.2.2 {
gvir_network_get_dhcp_leases;
} LIBVIRT_GOBJECT_0.2.1;
+LIBVIRT_GOBJECT_0.2.3 {
+ global:
+ gvir_domain_set_time_flags_get_type;
+
+ gvir_domain_set_time;
+ gvir_domain_set_time_async;
+ gvir_domain_set_time_finish;
+} LIBVIRT_GOBJECT_0.2.2;
+
# .... define new API here using predicted next version number ....
--
2.5.0
9 years, 1 month
[libvirt] [PATCH] vz: implementation of boot device order
by Mikhail Feoktistov
This patch implements functionality of boot device order
based on boot element from os section in XML.
Now we support boot from CDROM and HDD.
If we have several devices of the same type (for example hdd0 and hdd1),
than we mark the first one as bootable.
---
src/vz/vz_sdk.c | 111 +++++++++++++++++++++++++++++++++++++++++---------------
1 file changed, 81 insertions(+), 30 deletions(-)
diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c
index 750133d..bebd3b8 100644
--- a/src/vz/vz_sdk.c
+++ b/src/vz/vz_sdk.c
@@ -2198,6 +2198,78 @@ prlsdkAddDeviceToBootList(PRL_HANDLE sdkdom,
return -1;
}
+static int
+prlsdkSetBootDevices(PRL_HANDLE sdkdom,
+ virDomainDefPtr def)
+{
+ size_t i;
+ PRL_RESULT pret;
+ PRL_HANDLE devList = PRL_INVALID_HANDLE;
+ PRL_HANDLE dev = PRL_INVALID_HANDLE;
+ PRL_DEVICE_TYPE currentDevType, bootDevType;
+ PRL_UINT32 devIndex, devCount, j;
+ PRL_UINT32 bootSequence = 0;
+ bool rootMount = false;
+
+ pret = PrlVmCfg_GetAllDevices(sdkdom, &devList);
+ prlsdkCheckRetGoto(pret, error);
+
+ pret = PrlHndlList_GetItemsCount(devList, &devCount);
+ prlsdkCheckRetGoto(pret, error);
+
+ for (i = 0; i < def->os.nBootDevs; i++) {
+ switch (def->os.bootDevs[i]) {
+ case VIR_DOMAIN_BOOT_CDROM:
+ bootDevType = PDE_OPTICAL_DISK;
+ break;
+ case VIR_DOMAIN_BOOT_DISK:
+ bootDevType = PDE_HARD_DISK;
+ break;
+ default:
+ continue;
+ }
+
+ for (j = 0; j < devCount; j++) {
+ pret = PrlHndlList_GetItem(devList, j, &dev);
+ prlsdkCheckRetGoto(pret, error);
+
+ pret = PrlVmDev_GetType(dev, ¤tDevType);
+ prlsdkCheckRetGoto(pret, error);
+
+ if (currentDevType == bootDevType) {
+ pret = PrlVmDev_GetIndex(dev, &devIndex);
+ prlsdkCheckRetGoto(pret, error);
+
+ if (prlsdkAddDeviceToBootList(sdkdom, devIndex, currentDevType, bootSequence) < 0)
+ goto error;
+ bootSequence++;
+
+ if (IS_CT(def) && !rootMount) {
+ /* If we add physical device as a boot disk to container
+ we have to specify mount point for it */
+ pret = PrlVmDevHd_SetMountPoint(dev, "/");
+ prlsdkCheckRetGoto(pret, error);
+ rootMount = true;
+ }
+ }
+ PrlHandle_Free(dev);
+ dev = PRL_INVALID_HANDLE;
+ }
+ }
+
+ PrlHandle_Free(devList);
+ return 0;
+
+ error:
+ if (dev != PRL_INVALID_HANDLE)
+ PrlHandle_Free(dev);
+
+ if (devList != PRL_INVALID_HANDLE)
+ PrlHandle_Free(devList);
+
+ return -1;
+}
+
static int prlsdkCheckGraphicsUnsupportedParams(virDomainDefPtr def)
{
virDomainGraphicsDefPtr gr;
@@ -3145,9 +3217,7 @@ static int prlsdkDelDisk(PRL_HANDLE sdkdom, int idx)
}
static int prlsdkAddDisk(PRL_HANDLE sdkdom,
- virDomainDiskDefPtr disk,
- bool bootDisk,
- bool isCt)
+ virDomainDiskDefPtr disk)
{
PRL_RESULT pret;
PRL_HANDLE sdkdisk = PRL_INVALID_HANDLE;
@@ -3156,7 +3226,6 @@ static int prlsdkAddDisk(PRL_HANDLE sdkdom,
PRL_MASS_STORAGE_INTERFACE_TYPE sdkbus;
int idx;
virDomainDeviceDriveAddressPtr drive;
- PRL_UINT32 devIndex;
PRL_DEVICE_TYPE devType;
char *dst = NULL;
@@ -3302,21 +3371,6 @@ static int prlsdkAddDisk(PRL_HANDLE sdkdom,
goto cleanup;
}
- if (bootDisk) {
- pret = PrlVmDev_GetIndex(sdkdisk, &devIndex);
- prlsdkCheckRetGoto(pret, cleanup);
-
- if (prlsdkAddDeviceToBootList(sdkdom, devIndex, devType, 0) < 0)
- goto cleanup;
-
- /* If we add physical device as a boot disk to container
- * we have to specify mount point for it */
- if (isCt) {
- pret = PrlVmDevHd_SetMountPoint(sdkdisk, "/");
- prlsdkCheckRetGoto(pret, cleanup);
- }
- }
-
return 0;
cleanup:
PrlHandle_Free(sdkdisk);
@@ -3335,7 +3389,7 @@ prlsdkAttachVolume(virDomainObjPtr dom, virDomainDiskDefPtr disk)
if (PRL_FAILED(waitJob(job)))
goto cleanup;
- ret = prlsdkAddDisk(privdom->sdkdom, disk, false, IS_CT(dom->def));
+ ret = prlsdkAddDisk(privdom->sdkdom, disk);
if (ret == 0) {
job = PrlVm_CommitEx(privdom->sdkdom, PVCF_DETACH_HDD_BUNDLE);
if (PRL_FAILED(waitJob(job))) {
@@ -3472,7 +3526,7 @@ prlsdkDoApplyConfig(virConnectPtr conn,
PRL_RESULT pret;
size_t i;
char uuidstr[VIR_UUID_STRING_BUFLEN + 2];
- bool needBoot = true;
+ bool rootfsFound = false;
char *mask = NULL;
if (prlsdkCheckUnsupportedParams(sdkdom, def) < 0)
@@ -3552,21 +3606,18 @@ prlsdkDoApplyConfig(virConnectPtr conn,
for (i = 0; i < def->nfss; i++) {
if (STREQ(def->fss[i]->dst, "/"))
- needBoot = false;
+ rootfsFound = true;
if (prlsdkAddFS(sdkdom, def->fss[i]) < 0)
goto error;
}
for (i = 0; i < def->ndisks; i++) {
- bool bootDisk = false;
-
- if (needBoot &&
- def->disks[i]->device == VIR_DOMAIN_DISK_DEVICE_DISK) {
+ if (prlsdkAddDisk(sdkdom, def->disks[i]) < 0)
+ goto error;
+ }
- needBoot = false;
- bootDisk = true;
- }
- if (prlsdkAddDisk(sdkdom, def->disks[i], bootDisk, IS_CT(def)) < 0)
+ if (!rootfsFound) {
+ if (prlsdkSetBootDevices(sdkdom, def) < 0)
goto error;
}
--
1.8.3.1
9 years, 1 month
[libvirt] [PATCH] qemu: handle more machines with a single builtin IDE controller
by Guido Günther
like I440FX by moving the condition into qemuDomainMachineHasBuiltinIDE
and adding more machines.
Reference: http://bugs.debian.org/805189
---
src/qemu/qemu_command.c | 26 ++++++++++++++------------
src/qemu/qemu_domain.c | 10 ++++++++++
src/qemu/qemu_domain.h | 1 +
3 files changed, 25 insertions(+), 12 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index ef5ef93..4d00fd9 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -1054,11 +1054,12 @@ qemuAssignDeviceControllerAlias(virDomainDefPtr domainDef,
*/
return virAsprintf(&controller->info.alias, "pci.%d", controller->idx);
} else if (controller->type == VIR_DOMAIN_CONTROLLER_TYPE_IDE) {
- /* for any machine based on I440FX, the first (and currently
- * only) IDE controller is an integrated controller hardcoded
- * with id "ide"
+ /* for any machine based on e.g. I440FX or G3Beige, the
+ * first (and currently only) IDE controller is an integrated
+ * controller hardcoded with id "ide"
*/
- if (qemuDomainMachineIsI440FX(domainDef) && controller->idx == 0)
+ if (qemuDomainMachineHasBuiltinIDE(domainDef) &&
+ controller->idx == 0)
return VIR_STRDUP(controller->info.alias, "ide");
} else if (controller->type == VIR_DOMAIN_CONTROLLER_TYPE_SATA) {
/* for any Q35 machine, the first SATA controller is the
@@ -4914,14 +4915,15 @@ qemuBuildControllerDevStr(virDomainDefPtr domainDef,
break;
case VIR_DOMAIN_CONTROLLER_TYPE_IDE:
- /* Since we currently only support the integrated IDE controller
- * on 440fx, if we ever get to here, it's because some other
- * machinetype had an IDE controller specified, or a 440fx had
- * multiple ide controllers.
+ /* Since we currently only support the integrated IDE
+ * controller on various boards, if we ever get to here, it's
+ * because some other machinetype had an IDE controller
+ * specified, or one with a single IDE contraller had multiple
+ * ide controllers specified.
*/
- if (qemuDomainMachineIsI440FX(domainDef))
+ if (qemuDomainMachineHasBuiltinIDE(domainDef))
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("Only a single IDE controller is unsupported "
+ _("Only a single IDE controller is supported "
"for this machine type"));
else
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
@@ -9900,9 +9902,9 @@ qemuBuildCommandLine(virConnectPtr conn,
cont->idx == 0 && qemuDomainMachineIsQ35(def))
continue;
- /* first IDE controller on i440fx machines is implicit */
+ /* first IDE controller is implicit on various machines */
if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_IDE &&
- cont->idx == 0 && qemuDomainMachineIsI440FX(def))
+ cont->idx == 0 && qemuDomainMachineHasBuiltinIDE(def))
continue;
if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_USB &&
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 0861bfd..18513f9 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -3724,6 +3724,16 @@ qemuDomainDefValidateMemoryHotplug(const virDomainDef *def,
}
+bool
+qemuDomainMachineHasBuiltinIDE(const virDomainDef *def)
+{
+ return qemuDomainMachineIsI440FX(def) ||
+ STREQ(def->os.machine, "malta") ||
+ STREQ(def->os.machine, "sun4u") ||
+ STREQ(def->os.machine, "g3beige");
+}
+
+
/**
* qemuDomainUpdateCurrentMemorySize:
*
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index 8b6b1a3..271dce9 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -479,6 +479,7 @@ bool qemuDomainMachineIsQ35(const virDomainDef *def);
bool qemuDomainMachineIsI440FX(const virDomainDef *def);
bool qemuDomainMachineNeedsFDC(const virDomainDef *def);
bool qemuDomainMachineIsS390CCW(const virDomainDef *def);
+bool qemuDomainMachineHasBuiltinIDE(const virDomainDef *def);
int qemuDomainUpdateCurrentMemorySize(virQEMUDriverPtr driver,
virDomainObjPtr vm);
--
2.6.2
9 years, 1 month
[libvirt] [PATCH 0/3] qemu: Fix machines with built in IDE
by Guido Günther
Hi,
eadd757ccee0e72156a5345e6c25477aa057a9f1 introduced an error for machines with
an unsupported IDE controller but missed some machine types. The attached
three pathes fix this.
Reference: http://bugs.debian.org/805189
Guido Günther (3):
qemu: PPCs G3Beige has a default IDE controller
qemu: sparc64s sun4u has a default IDE controller
qemu: MIPS{,64} malta has a default IDE controller
src/qemu/qemu_command.c | 34 ++++++++++++++++++++++++----------
src/qemu/qemu_domain.c | 21 +++++++++++++++++++++
src/qemu/qemu_domain.h | 3 +++
3 files changed, 48 insertions(+), 10 deletions(-)
--
2.6.2
9 years, 1 month
[libvirt] adding tests to qemu_driver
by noxdafox
Greetings,
I was investigating on an issue in which QEMU's dynamic ownership was
not properly working when calling qemuDomainCoreDumpWithFormat().
The core of the issue seems to be the qemuOpenFileAs() function which
does not handle the dynamic ownership. This might affect other libvirt's
features within as well.
The function is quite complicated and I was thinking about refactoring
it a bit in order to simplify the logic allowing to fix the dynamic
ownership handling as well.
In order to refactor it, I was planning to write tests in order to cover
all its use cases before actually changing the code.
The issue is that all the functions within the qemu_driver.c module are
static. I could indeed include the module itself in my tests but I'm not
sure whether this is acceptable.
Furthermore I'd like to have some clarification about the NFS related
code. It seems that some effort has been put in order to tackle
something I'm not aware of. Could someone briefly explain how to
reproduce NFS failing scenarios?
Thank you.
9 years, 1 month
[libvirt] ANNOUNCE: ruby-libvirt 0.6.0
by Chris Lalancette
All,
I'm pleased to release ruby-libvirt 0.6.0. ruby-libvirt is a ruby
wrapper around the libvirt API. The changelog between 0.5.2 and 0.6.0
is:
* Fix possible buffer overflow
* Fix storage volume creation error messages
* Add additional storage pool defines
* Implement Network dhcp_leases method
* Implement Connect node_alloc_pages method
* Implement Domain time method
* Implement Connect domain_capabilities method
* Implement Domain core_dump_with_format method
* Implement Domain fs_freeze method
* Implement Domain fs_info method
* Implement Connect node_free_pages method
Version 0.6.0 is available from http://libvirt.org/ruby:
Tarball: http://libvirt.org/ruby/download/ruby-libvirt-0.5.2.tgz
Gem: http://libvirt.org/ruby/download/ruby-libvirt-0.5.2.gem
It is also available from rubygems.org; to get the latest version, run:
$ gem install ruby-libvirt
Packages for it are also built for Fedora, and will be released shortly.
As usual, if you run into questions, problems, or bugs, please feel free to
mail me (clalancette gmail com) and the libvirt mailing list.
Thanks to those who contributed to this release.
9 years, 1 month
[libvirt] [PATCH] Allow building lxc without virt-login-shell
by Cédric Bosdonnat
Add a configure option to disable virt-login-shell build even if lxc is
enabled.
---
configure.ac | 14 ++++++++++++++
tools/Makefile.am | 12 ++++++------
2 files changed, 20 insertions(+), 6 deletions(-)
diff --git a/configure.ac b/configure.ac
index f481c50..c766351 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1074,6 +1074,19 @@ if test "$with_lxc" = "yes" ; then
fi
AM_CONDITIONAL([WITH_LXC], [test "$with_lxc" = "yes"])
+AC_ARG_WITH([login_shell],
+ [AS_HELP_STRING([--with-login-shell],
+ [build virt-login-shell @<:@default=yes@:>@])])
+m4_divert_text([DEFAULTS], [with_login_shell=yes])
+
+if test "$with_lxc" != "yes" ; then
+ with_login_shell="no"
+fi
+if test "$with_login_shell" ; then
+ AC_DEFINE_UNQUOTED([WITH_LOGIN_SHELL], 1, [whether virt-login-shell is built])
+fi
+AM_CONDITIONAL([WITH_LOGIN_SHELL], [test "$with_login_shell" = "yes"])
+
dnl
dnl Checks for the Parallels driver
dnl
@@ -2974,6 +2987,7 @@ AC_MSG_NOTICE([ Init script: $with_init_script])
AC_MSG_NOTICE([Char device locks: $with_chrdev_lock_files])
AC_MSG_NOTICE([ Default Editor: $DEFAULT_EDITOR])
AC_MSG_NOTICE([ Loader/NVRAM: $with_loader_nvram])
+AC_MSG_NOTICE([ virt-login-shell: $with_login_shell])
AC_MSG_NOTICE([])
AC_MSG_NOTICE([Developer Tools])
AC_MSG_NOTICE([])
diff --git a/tools/Makefile.am b/tools/Makefile.am
index d5638d9..d005035 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -71,12 +71,12 @@ sbin_SCRIPTS = virt-sanlock-cleanup
DISTCLEANFILES += virt-sanlock-cleanup
endif WITH_SANLOCK
-if WITH_LXC
+if WITH_LOGIN_SHELL
conf_DATA += virt-login-shell.conf
bin_PROGRAMS += virt-login-shell
-else ! WITH_LXC
+else ! WITH_LOGIN_SHELL
EXTRA_DIST += virt-login-shell.conf
-endif ! WITH_LXC
+endif ! WITH_LOGIN_SHELL
dist_man1_MANS = \
@@ -84,11 +84,11 @@ dist_man1_MANS = \
virt-pki-validate.1 \
virt-xml-validate.1 \
virsh.1
-if WITH_LXC
+if WITH_LOGIN_SHELL
dist_man1_MANS += virt-login-shell.1
-else ! WITH_LXC
+else ! WITH_LOGIN_SHELL
EXTRA_DIST += virt-login-shell.1
-endif ! WITH_LXC
+endif ! WITH_LOGIN_SHELL
if WITH_SANLOCK
dist_man8_MANS = virt-sanlock-cleanup.8
endif WITH_SANLOCK
--
2.1.4
9 years, 1 month
[libvirt] [PATCH 0/2] Address more nfs root-squash issues
by John Ferlan
Fix a couple of more issues with an NFS root-squash environment. The
details are in the commit messages and bugzilla comments.
NB: While using virFileOpenAs in the virStorageBackendVolOpen path and
checking for EACESS/EPERM afterwards may seem a bit counter intuitive,
but those will be returned if the virFileOpenAs code doesn't attempt to
open in the forked environment.
John Ferlan (2):
storage: Really fix setting mode for backend exec in NFS root-squash
env
storage: Change virStorageBackendVolOpen to use virFileOpenAs
src/storage/storage_backend.c | 37 +++++++++++++++++++++++++++++++++----
1 file changed, 33 insertions(+), 4 deletions(-)
--
2.5.0
9 years, 1 month
[libvirt] [PATCH] Use correct pci addresses during device-detach
by Nitesh_Konkar
From: Nitesh_Konkar <niteshkonkar(a)in.ibm.com>
The attach-device on live and persistent copies can be done independently.
Thus devices can end up having different pci addresses in live and persistent
copies. The detach device should try to detach the device from their respective
addresses instead of using the same from live/persistent.
Signed-off-by:nitkon12@linux.vnet.ibm.com
---
src/driver-nodedev.h | 1 +
src/qemu/qemu_driver.c | 25 ++++++++++---------------
2 files changed, 11 insertions(+), 15 deletions(-)
diff --git a/src/driver-nodedev.h b/src/driver-nodedev.h
index e846612..dea79bd 100644
--- a/src/driver-nodedev.h
+++ b/src/driver-nodedev.h
@@ -59,6 +59,7 @@ typedef char *
typedef char *
(*virDrvNodeDeviceGetParent)(virNodeDevicePtr dev);
+
typedef int
(*virDrvNodeDeviceNumOfCaps)(virNodeDevicePtr dev);
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index f133b45..6fd58c2 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -8708,23 +8708,12 @@ static int qemuDomainDetachDeviceFlags(virDomainPtr dom, const char *xml,
!(flags & VIR_DOMAIN_AFFECT_LIVE))
parse_flags |= VIR_DOMAIN_DEF_PARSE_INACTIVE;
- dev = dev_copy = virDomainDeviceDefParse(xml, vm->def,
+ dev_copy = virDomainDeviceDefParse(xml, vm->def,
caps, driver->xmlopt,
parse_flags);
- if (dev == NULL)
+ if (dev_copy == NULL)
goto endjob;
- if (flags & VIR_DOMAIN_AFFECT_CONFIG &&
- flags & VIR_DOMAIN_AFFECT_LIVE) {
- /* If we are affecting both CONFIG and LIVE
- * create a deep copy of device as adding
- * to CONFIG takes one instance.
- */
- dev_copy = virDomainDeviceDefCopy(dev, vm->def, caps, driver->xmlopt);
- if (!dev_copy)
- goto endjob;
- }
-
if (priv->qemuCaps)
qemuCaps = virObjectRef(priv->qemuCaps);
else if (!(qemuCaps = virQEMUCapsCacheLookup(driver->qemuCapsCache, vm->def->emulator)))
@@ -8736,6 +8725,13 @@ static int qemuDomainDetachDeviceFlags(virDomainPtr dom, const char *xml,
if (!vmdef)
goto endjob;
+ dev = virDomainDeviceDefParse(xml, vmdef,
+ caps, driver->xmlopt,
+ parse_flags);
+ if (!dev)
+ goto endjob;
+
+
if (virDomainDefCompatibleDevice(vmdef, dev,
VIR_DOMAIN_DEVICE_ACTION_DETACH) < 0)
goto endjob;
@@ -8777,8 +8773,7 @@ static int qemuDomainDetachDeviceFlags(virDomainPtr dom, const char *xml,
cleanup:
virObjectUnref(qemuCaps);
virDomainDefFree(vmdef);
- if (dev != dev_copy)
- virDomainDeviceDefFree(dev_copy);
+ virDomainDeviceDefFree(dev_copy);
virDomainDeviceDefFree(dev);
virDomainObjEndAPI(&vm);
virObjectUnref(caps);
--
2.4.0
9 years, 1 month