[libvirt] [PATCH] Convert qemu command line flags to 64-bit int
by Daniel P. Berrange
The QEMU flags are commonly stored as a signed or unsigned int,
allowing only 31 flags. This limit is rather close, so to aid
future patches, change it to a 64-bit int
* src/qemu/qemu_conf.c, src/qemu/qemu_conf.h, src/qemu/qemu_driver.c,
tests/qemuargv2xmltest.c, tests/qemuhelptest.c, tests/qemuxml2argvtest.c:
Use 'unsigned long long' for QEMU flags
---
src/qemu/qemu_conf.c | 28 ++++++++++++++--------------
src/qemu/qemu_conf.h | 14 +++++++-------
src/qemu/qemu_driver.c | 12 ++++++------
tests/qemuargv2xmltest.c | 2 +-
tests/qemuhelptest.c | 13 +++++++------
tests/qemuxml2argvtest.c | 7 ++++---
6 files changed, 39 insertions(+), 37 deletions(-)
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 257b4a4..e3769c8 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -1108,12 +1108,12 @@ virCapsPtr qemudCapsInit(virCapsPtr old_caps) {
return NULL;
}
-static unsigned int qemudComputeCmdFlags(const char *help,
- unsigned int version,
- unsigned int is_kvm,
- unsigned int kvm_version)
+static unsigned long long qemudComputeCmdFlags(const char *help,
+ unsigned int version,
+ unsigned int is_kvm,
+ unsigned int kvm_version)
{
- unsigned int flags = 0;
+ unsigned long long flags = 0;
if (strstr(help, "-no-kqemu"))
flags |= QEMUD_CMD_FLAG_KQEMU;
@@ -1236,7 +1236,7 @@ static unsigned int qemudComputeCmdFlags(const char *help,
#define SKIP_BLANKS(p) do { while ((*(p) == ' ') || (*(p) == '\t')) (p)++; } while (0)
int qemudParseHelpStr(const char *help,
- unsigned int *flags,
+ unsigned long long *flags,
unsigned int *version,
unsigned int *is_kvm,
unsigned int *kvm_version)
@@ -1316,14 +1316,14 @@ fail:
int qemudExtractVersionInfo(const char *qemu,
unsigned int *retversion,
- unsigned int *retflags) {
+ unsigned long long *retflags) {
const char *const qemuarg[] = { qemu, "-help", NULL };
const char *const qemuenv[] = { "LC_ALL=C", NULL };
pid_t child;
int newstdout = -1;
int ret = -1, status;
unsigned int version, is_kvm, kvm_version;
- unsigned int flags = 0;
+ unsigned long long flags = 0;
if (retflags)
*retflags = 0;
@@ -1425,7 +1425,7 @@ int
qemudNetworkIfaceConnect(virConnectPtr conn,
struct qemud_driver *driver,
virDomainNetDefPtr net,
- int qemuCmdFlags)
+ unsigned long long qemuCmdFlags)
{
char *brname = NULL;
int err;
@@ -1637,7 +1637,7 @@ no_memory:
int
-qemuAssignDeviceDiskAlias(virDomainDiskDefPtr def, int qemuCmdFlags)
+qemuAssignDeviceDiskAlias(virDomainDiskDefPtr def, unsigned long long qemuCmdFlags)
{
if (qemuCmdFlags & QEMUD_CMD_FLAG_DRIVE) {
if (qemuCmdFlags & QEMUD_CMD_FLAG_DEVICE)
@@ -1720,7 +1720,7 @@ qemuAssignDeviceControllerAlias(virDomainControllerDefPtr controller)
static int
-qemuAssignDeviceAliases(virDomainDefPtr def, int qemuCmdFlags)
+qemuAssignDeviceAliases(virDomainDefPtr def, unsigned long long qemuCmdFlags)
{
int i;
@@ -2189,7 +2189,7 @@ qemuSafeSerialParamValue(virConnectPtr conn,
char *
qemuBuildDriveStr(virDomainDiskDefPtr disk,
int bootable,
- int qemuCmdFlags)
+ unsigned long long qemuCmdFlags)
{
virBuffer opt = VIR_BUFFER_INITIALIZER;
const char *bus = virDomainDiskQEMUBusTypeToString(disk->bus);
@@ -3017,7 +3017,7 @@ no_memory:
static char *
qemuBuildSmpArgStr(const virDomainDefPtr def,
- int qemuCmdFlags)
+ unsigned long long qemuCmdFlags)
{
virBuffer buf = VIR_BUFFER_INITIALIZER;
@@ -3057,7 +3057,7 @@ int qemudBuildCommandLine(virConnectPtr conn,
virDomainDefPtr def,
virDomainChrDefPtr monitor_chr,
int monitor_json,
- unsigned int qemuCmdFlags,
+ unsigned long long qemuCmdFlags,
const char ***retargv,
const char ***retenv,
int **tapfds,
diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h
index 5525b6c..f6397b7 100644
--- a/src/qemu/qemu_conf.h
+++ b/src/qemu/qemu_conf.h
@@ -170,10 +170,10 @@ virCapsPtr qemudCapsInit (virCapsPtr old_caps);
int qemudExtractVersion (struct qemud_driver *driver);
int qemudExtractVersionInfo (const char *qemu,
unsigned int *version,
- unsigned int *flags);
+ unsigned long long *qemuCmdFlags);
int qemudParseHelpStr (const char *str,
- unsigned int *flags,
+ unsigned long long *qemuCmdFlags,
unsigned int *version,
unsigned int *is_kvm,
unsigned int *kvm_version);
@@ -183,7 +183,7 @@ int qemudBuildCommandLine (virConnectPtr conn,
virDomainDefPtr def,
virDomainChrDefPtr monitor_chr,
int monitor_json,
- unsigned int qemuCmdFlags,
+ unsigned long long qemuCmdFlags,
const char ***retargv,
const char ***retenv,
int **tapfds,
@@ -205,12 +205,12 @@ char * qemuBuildNicStr(virConnectPtr conn,
/* Current, best practice */
char * qemuBuildNicDevStr(virDomainNetDefPtr net,
- int qemuCmdFlags);
+ int vlan);
/* Both legacy & current support */
char *qemuBuildDriveStr(virDomainDiskDefPtr disk,
int bootable,
- int qemuCmdFlags);
+ unsigned long long qemuCmdFlags);
/* Current, best practice */
char * qemuBuildDriveDevStr(virConnectPtr conn,
@@ -244,7 +244,7 @@ char * qemuBuildUSBHostdevDevStr(virDomainHostdevDefPtr dev);
int qemudNetworkIfaceConnect (virConnectPtr conn,
struct qemud_driver *driver,
virDomainNetDefPtr net,
- int qemuCmdFlags);
+ unsigned long long qemuCmdFlags);
int qemudProbeMachineTypes (const char *binary,
virCapsGuestMachinePtr **machines,
@@ -283,7 +283,7 @@ int qemuAssignDevicePCISlots(virDomainDefPtr def, qemuDomainPCIAddressSetPtr ad
int qemuDomainNetVLAN(virDomainNetDefPtr def);
int qemuAssignDeviceNetAlias(virDomainDefPtr def, virDomainNetDefPtr net, int idx);
-int qemuAssignDeviceDiskAlias(virDomainDiskDefPtr def, int qemuCmdFlags);
+int qemuAssignDeviceDiskAlias(virDomainDiskDefPtr def, unsigned long long qemuCmdFlags);
int qemuAssignDeviceHostdevAlias(virDomainDefPtr def, virDomainHostdevDefPtr net, int idx);
int qemuAssignDeviceControllerAlias(virDomainControllerDefPtr controller);
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 4374291..54d33cd 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -2520,7 +2520,7 @@ static int qemudStartVMDaemon(virConnectPtr conn,
struct stat sb;
int *tapfds = NULL;
int ntapfds = 0;
- unsigned int qemuCmdFlags;
+ unsigned long long qemuCmdFlags;
fd_set keepfd;
const char *emulator;
pid_t child;
@@ -4707,7 +4707,7 @@ static char *qemuDomainXMLToNative(virConnectPtr conn,
virDomainDefPtr def = NULL;
virDomainChrDef monConfig;
const char *emulator;
- unsigned int qemuCmdFlags;
+ unsigned long long qemuCmdFlags;
struct stat sb;
const char **retargv = NULL;
const char **retenv = NULL;
@@ -5586,7 +5586,7 @@ static int qemudDomainAttachNetDevice(virConnectPtr conn,
struct qemud_driver *driver,
virDomainObjPtr vm,
virDomainNetDefPtr net,
- unsigned int qemuCmdFlags)
+ unsigned long long qemuCmdFlags)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
char *tapfd_name = NULL;
@@ -5901,7 +5901,7 @@ static int qemudDomainAttachDevice(virDomainPtr dom,
struct qemud_driver *driver = dom->conn->privateData;
virDomainObjPtr vm;
virDomainDeviceDefPtr dev = NULL;
- unsigned int qemuCmdFlags;
+ unsigned long long qemuCmdFlags;
virCgroupPtr cgroup = NULL;
int ret = -1;
@@ -7437,7 +7437,7 @@ qemudDomainMigratePrepareTunnel(virConnectPtr dconn,
int ret = -1;
int internalret;
char *unixfile = NULL;
- unsigned int qemuCmdFlags;
+ unsigned long long qemuCmdFlags;
struct qemuStreamMigFile *qemust = NULL;
qemuDriverLock(driver);
@@ -7884,7 +7884,7 @@ static int doTunnelMigrate(virDomainPtr dom,
virStreamPtr st = NULL;
char *unixfile = NULL;
int internalret;
- unsigned int qemuCmdFlags;
+ unsigned long long qemuCmdFlags;
int status;
unsigned long long transferred, remaining, total;
diff --git a/tests/qemuargv2xmltest.c b/tests/qemuargv2xmltest.c
index 1f1914b..c125a34 100644
--- a/tests/qemuargv2xmltest.c
+++ b/tests/qemuargv2xmltest.c
@@ -75,7 +75,7 @@ static int testCompareXMLToArgvFiles(const char *xml,
struct testInfo {
const char *name;
- int extraFlags;
+ unsigned long long extraFlags;
const char *migrateFrom;
};
diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c
index 34a6048..0f2b509 100644
--- a/tests/qemuhelptest.c
+++ b/tests/qemuhelptest.c
@@ -12,10 +12,10 @@
struct testInfo {
const char *name;
- unsigned flags;
- unsigned version;
- unsigned is_kvm;
- unsigned kvm_version;
+ unsigned long long flags;
+ unsigned int version;
+ unsigned int is_kvm;
+ unsigned int kvm_version;
};
static char *progname;
@@ -41,7 +41,8 @@ static int testHelpStrParsing(const void *data)
char path[PATH_MAX];
char helpStr[MAX_HELP_OUTPUT_SIZE];
char *help = &(helpStr[0]);
- unsigned flags, version, is_kvm, kvm_version;
+ unsigned int version, is_kvm, kvm_version;
+ unsigned long long flags;
snprintf(path, PATH_MAX, "%s/qemuhelpdata/%s", abs_srcdir, info->name);
@@ -52,7 +53,7 @@ static int testHelpStrParsing(const void *data)
return -1;
if (flags != info->flags) {
- fprintf(stderr, "Computed flags do not match: got 0x%x, expected 0x%x\n",
+ fprintf(stderr, "Computed flags do not match: got 0x%llx, expected 0x%llx\n",
flags, info->flags);
if (getenv("VIR_TEST_DEBUG"))
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 67dc47e..f4908b8 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -24,7 +24,7 @@ static struct qemud_driver driver;
static int testCompareXMLToArgvFiles(const char *xml,
const char *cmd,
- int extraFlags,
+ unsigned long long extraFlags,
const char *migrateFrom) {
char argvData[MAX_FILE];
char *expectargv = &(argvData[0]);
@@ -32,7 +32,8 @@ static int testCompareXMLToArgvFiles(const char *xml,
const char **argv = NULL;
const char **qenv = NULL;
const char **tmp = NULL;
- int ret = -1, len, flags;
+ int ret = -1, len;
+ unsigned long long flags;
virDomainDefPtr vmdef = NULL;
virDomainChrDef monitor_chr;
@@ -142,7 +143,7 @@ static int testCompareXMLToArgvFiles(const char *xml,
struct testInfo {
const char *name;
- int extraFlags;
+ unsigned long long extraFlags;
const char *migrateFrom;
};
--
1.6.6
14 years, 9 months
[libvirt] [PATCH] Fix security driver configuration
by Daniel P. Berrange
The security driver was mistakenly initialized before the QEMU
config file was loaded. This prevents it being turned off again.
The capabilities XML was also getting the wrong security driver
name, due to the stacked driver arrangement.
* src/qemu/qemu_driver.c: Fix initialization order and capabilities
model name
---
src/qemu/qemu_driver.c | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 54d33cd..cac5b8a 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -933,7 +933,7 @@ qemudSecurityInit(struct qemud_driver *qemud_drv)
static virCapsPtr
qemuCreateCapabilities(virCapsPtr oldcaps,
- virSecurityDriverPtr secDriver)
+ struct qemud_driver *driver)
{
virCapsPtr caps;
@@ -951,11 +951,11 @@ qemuCreateCapabilities(virCapsPtr oldcaps,
/* Security driver data */
- if (secDriver) {
+ if (driver->securityPrimaryDriver) {
const char *doi, *model;
- doi = virSecurityDriverGetDOI(secDriver);
- model = virSecurityDriverGetModel(secDriver);
+ doi = virSecurityDriverGetDOI(driver->securityPrimaryDriver);
+ model = virSecurityDriverGetModel(driver->securityPrimaryDriver);
if (!(caps->host.secModel.model = strdup(model)))
goto no_memory;
@@ -1098,20 +1098,20 @@ qemudStartup(int privileged) {
virStrerror(-rc, buf, sizeof(buf)));
}
+ if (qemudLoadDriverConfig(qemu_driver, driverConf) < 0) {
+ goto error;
+ }
+
if (qemudSecurityInit(qemu_driver) < 0)
goto error;
if ((qemu_driver->caps = qemuCreateCapabilities(NULL,
- qemu_driver->securityDriver)) == NULL)
+ qemu_driver)) == NULL)
goto error;
if ((qemu_driver->activePciHostdevs = pciDeviceListNew()) == NULL)
goto error;
- if (qemudLoadDriverConfig(qemu_driver, driverConf) < 0) {
- goto error;
- }
-
if (privileged) {
if (chown(qemu_driver->libDir, qemu_driver->user, qemu_driver->group) < 0) {
virReportSystemError(errno,
@@ -3065,7 +3065,7 @@ static char *qemudGetCapabilities(virConnectPtr conn) {
qemuDriverLock(driver);
if ((caps = qemuCreateCapabilities(qemu_driver->caps,
- qemu_driver->securityDriver)) == NULL) {
+ qemu_driver)) == NULL) {
virCapabilitiesFree(caps);
goto cleanup;
}
--
1.6.6
14 years, 9 months
[libvirt] PATCH: Depend on libcgroup & turn on cgconfig initscript
by Daniel P. Berrange
Since libvirt uses cgroups for various aspects of guest tuning, we need to
make sure that the host is configured with them enabled out of the box.
The libcgroup maintainer has now provided a suitable default config that
mounts them all in /cgroup. So libvirt simply needs to depend on libcgroup
RPM, and turn on the 'cgconfig' initscript at install time if QEMU or LXC
is enabled.
diff -u -r1.81 libvirt.spec
--- libvirt.spec 3 Feb 2010 17:54:54 -0000 1.81
+++ libvirt.spec 9 Feb 2010 12:49:25 -0000
@@ -61,6 +61,7 @@
%define with_udev 0%{!?_without_udev:0}
%define with_hal 0%{!?_without_hal:0}
%define with_yajl 0%{!?_without_yajl:0}
+%define with_cgconfig 0%{!?_without_cgconfig:0}
# Non-server/HV driver defaults which are always enabled
%define with_python 0%{!?_without_python:1}
@@ -147,6 +148,13 @@
%define with_yajl 0%{!?_without_yajl:%{server_drivers}}
%endif
+# Pull in cgroups config system
+%if 0%{?fedora} >= 12 || 0%{?rhel} >= 6
+%if %{with_qemu} || %{with_lxc}
+%define with_cgconfig 0%{!?_without_cgconfig:1}
+%endif
+%endif
+
# Force QEMU to run as non-root
%if 0%{?fedora} >= 12 || 0%{?rhel} >= 6
%define qemu_user qemu
@@ -244,6 +252,9 @@
# For multipath support
Requires: device-mapper
%endif
+%if %{with_cgconfig}
+Requires: libcgroup
+%endif
%if %{with_xen}
BuildRequires: xen-devel
%endif
@@ -634,6 +645,12 @@
fi
%endif
+%if %{with_cgconfig}
+if [ "$1" = "1" ]; then
+/sbin/chkconfig cgconfig on
+fi
+%endif
+
/sbin/chkconfig --add libvirtd
if [ "$1" -ge "1" ]; then
/sbin/service libvirtd condrestart > /dev/null 2>&1
--
|: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
14 years, 9 months
[libvirt] [PATCH] escape strings serialized in XML
by Daniel Veillard
A large part of the serialization code in src/conf/node_device_conf.c
forgot that rule, this led to
https://bugzilla.redhat.com/show_bug.cgi?id=547045
Escape strings serialized in XML
* src/conf/node_device_conf.c: string saved into XML should be escaped
with the use of virBufferEscapeString()
diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c
index 4e8a492..69f42a9 100644
--- a/src/conf/node_device_conf.c
+++ b/src/conf/node_device_conf.c
@@ -372,19 +372,21 @@ char *virNodeDeviceDefFormat(virConnectPtr conn,
virBufferVSprintf(&buf, " <protocol>%d</protocol>\n",
data->usb_if.protocol);
if (data->usb_if.description)
- virBufferVSprintf(&buf, " <description>%s</description>\n",
+ virBufferEscapeString(&buf,
+ " <description>%s</description>\n",
data->usb_if.description);
break;
case VIR_NODE_DEV_CAP_NET:
- virBufferVSprintf(&buf, " <interface>%s</interface>\n",
+ virBufferEscapeString(&buf, " <interface>%s</interface>\n",
data->net.ifname);
if (data->net.address)
- virBufferVSprintf(&buf, " <address>%s</address>\n",
+ virBufferEscapeString(&buf, " <address>%s</address>\n",
data->net.address);
if (data->net.subtype != VIR_NODE_DEV_CAP_NET_LAST) {
const char *subtyp =
virNodeDevNetCapTypeToString(data->net.subtype);
- virBufferVSprintf(&buf, " <capability type='%s'/>\n", subtyp);
+ virBufferEscapeString(&buf, " <capability type='%s'/>\n",
+ subtyp);
}
break;
case VIR_NODE_DEV_CAP_SCSI_HOST:
@@ -392,10 +394,10 @@ char *virNodeDeviceDefFormat(virConnectPtr conn,
data->scsi_host.host);
if (data->scsi_host.flags & VIR_NODE_DEV_CAP_FLAG_HBA_FC_HOST) {
virBufferAddLit(&buf, " <capability type='fc_host'>\n");
- virBufferVSprintf(&buf,
- " <wwnn>%s</wwnn>\n", data->scsi_host.wwnn);
- virBufferVSprintf(&buf,
- " <wwpn>%s</wwpn>\n", data->scsi_host.wwpn);
+ virBufferEscapeString(&buf, " <wwnn>%s</wwnn>\n",
+ data->scsi_host.wwnn);
+ virBufferEscapeString(&buf, " <wwpn>%s</wwpn>\n",
+ data->scsi_host.wwpn);
virBufferAddLit(&buf, " </capability>\n");
}
if (data->scsi_host.flags & VIR_NODE_DEV_CAP_FLAG_HBA_VPORT_OPS) {
@@ -405,8 +407,8 @@ char *virNodeDeviceDefFormat(virConnectPtr conn,
break;
case VIR_NODE_DEV_CAP_SCSI_TARGET:
- virBufferVSprintf(&buf, " <target>%s</target>\n",
- data->scsi_target.name);
+ virBufferEscapeString(&buf, " <target>%s</target>\n",
+ data->scsi_target.name);
break;
case VIR_NODE_DEV_CAP_SCSI:
@@ -416,23 +418,23 @@ char *virNodeDeviceDefFormat(virConnectPtr conn,
data->scsi.target);
virBufferVSprintf(&buf, " <lun>%d</lun>\n", data->scsi.lun);
if (data->scsi.type)
- virBufferVSprintf(&buf, " <type>%s</type>\n",
- data->scsi.type);
+ virBufferEscapeString(&buf, " <type>%s</type>\n",
+ data->scsi.type);
break;
case VIR_NODE_DEV_CAP_STORAGE:
- virBufferVSprintf(&buf, " <block>%s</block>\n",
+ virBufferEscapeString(&buf, " <block>%s</block>\n",
data->storage.block);
if (data->storage.bus)
- virBufferVSprintf(&buf, " <bus>%s</bus>\n",
+ virBufferEscapeString(&buf, " <bus>%s</bus>\n",
data->storage.bus);
if (data->storage.drive_type)
- virBufferVSprintf(&buf, " <drive_type>%s</drive_type>\n",
+ virBufferEscapeString(&buf, " <drive_type>%s</drive_type>\n",
data->storage.drive_type);
if (data->storage.model)
- virBufferVSprintf(&buf, " <model>%s</model>\n",
+ virBufferEscapeString(&buf, " <model>%s</model>\n",
data->storage.model);
if (data->storage.vendor)
- virBufferVSprintf(&buf, " <vendor>%s</vendor>\n",
+ virBufferEscapeString(&buf, " <vendor>%s</vendor>\n",
data->storage.vendor);
if (data->storage.serial)
virBufferVSprintf(&buf, " <serial>%s</serial>\n",
--
Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
daniel(a)veillard.com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
14 years, 9 months
[libvirt] [PATCH 0/9] virDomain{Attach,Detach}DeviceFlags patches
by Jim Fehlig
This set implements two new APIs, virDomainAttachDeviceFlags and
virDomainDetachDeviceFlags as discussed here
https://www.redhat.com/archives/libvir-list/2009-December/msg00124.html
Introduce two new APIs
virDomainAttachDeviceFlags(virDomainPtr dom, const char *xml,
unsigned flags)
virDomainDetachDeviceFlags(virDomainPtr dom, const char *xml,
unsigned flags)
with flags being one or more from VIR_DOMAIN_DEVICE_MODIFY_CURRENT,
VIR_DOMAIN_DEVICE_MODIFY_LIVE, VIR_DOMAIN_DEVICE_MODIFY_CONFIG.
If caller specifies CURRENT (default), add or remove the device
depending on the current state of domain. E.g. if domain is active add
or remove the device to/from live domain, if it is inactive change the
persistent config. If caller specifies LIVE, only change the active
domain. If caller specifies CONFIG, only change persistent config -
even if the domain is active. If caller specifies both LIVE and CONFIG,
then change both.
If a driver can not satisfy the exact requested flags it must return
an error. E.g if user specified LIVE but the driver can only change
live and persisted config, the driver must fail the request.
The existing virDomain{Attach,Detach}Device is now explicitly restricted
to active domains and is equivalent to
virDomain{Attach,Detach}DeviceFlags(LIVE).
Finally, virsh {attach,detach}-{disk,interface,device} has been modified
to add a --persistent flag in order to set the appropriate flags when
calling the new APIs.
Jim Fehlig (9):
Restrict virDomain{Attach,Detach}Device to active domains
Public API
Internal API
Public API Implementation
Wire protocol format
Remote driver
Server side dispatcher
domain{Attach,Detach}DeviceFlags handler for drivers
Modify virsh commands
daemon/remote.c | 53 ++++++++++++++++++
include/libvirt/libvirt.h.in | 13 +++++
src/driver.h | 10 ++++
src/esx/esx_driver.c | 2 +
src/libvirt.c | 120 ++++++++++++++++++++++++++++++++++++++----
src/libvirt_public.syms | 6 ++
src/lxc/lxc_driver.c | 2 +
src/opennebula/one_driver.c | 2 +
src/openvz/openvz_driver.c | 2 +
src/phyp/phyp_driver.c | 2 +
src/qemu/qemu_driver.c | 26 +++++++++
src/remote/remote_driver.c | 54 +++++++++++++++++++
src/remote/remote_protocol.x | 17 ++++++-
src/test/test_driver.c | 2 +
src/uml/uml_driver.c | 2 +
src/vbox/vbox_tmpl.c | 24 ++++++++
src/xen/proxy_internal.c | 4 +-
src/xen/xen_driver.c | 42 +++++++++++++--
src/xen/xen_driver.h | 4 +-
src/xen/xen_hypervisor.c | 4 +-
src/xen/xen_inotify.c | 4 +-
src/xen/xend_internal.c | 98 ++++++++++++++++++++++++++++------
src/xen/xm_internal.c | 30 +++++++----
src/xen/xs_internal.c | 4 +-
tools/virsh.c | 55 +++++++++++++++++--
25 files changed, 523 insertions(+), 59 deletions(-)
14 years, 9 months
[libvirt] [PATCH] Create raw storage files with O_DSYNC
by Jiri Denemark
When creating preallocated large raw files opening them with O_DSYNC
prevents long delays in reading because cache pages can be immediately
reused without writing them on a disk first.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/storage/storage_backend.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c
index e79294a..8aab9ab 100644
--- a/src/storage/storage_backend.c
+++ b/src/storage/storage_backend.c
@@ -301,7 +301,7 @@ virStorageBackendCreateRaw(virConnectPtr conn,
goto cleanup;
}
- if ((fd = open(vol->target.path, O_RDWR | O_EXCL)) < 0) {
+ if ((fd = open(vol->target.path, O_RDWR | O_EXCL | O_DSYNC)) < 0) {
virReportSystemError(conn, errno,
_("cannot open new path '%s'"),
vol->target.path);
--
1.6.6.1
14 years, 9 months
[libvirt] ANNOUNCE: New releases virt-manager 0.8.3 and virtinst 0.500.2
by Cole Robinson
I'm happy to announce two new releases:
virt-manager 0.8.3: virt-manager is a desktop application for managing
KVM and Xen virtual machines via libvirt.
virtinst 0.500.2: virtinst is a collection of command line tools for
provisioning libvirt virtual machines, including virt-install and
virt-clone.
The releases can be downloaded from:
http://virt-manager.org/download.html
The direct download links are:
http://virt-manager.org/download/sources/virt-manager/virt-manager-0.8.3....
http://virt-manager.org/download/sources/virtinst/virtinst-0.500.2.tar.gz
The virt-manager release includes:
- New ability to manage network interfaces: start, stop, and view
existing interfaces. Provision new bridge, bond, and vlan devices.
- New option to 'customize VM before install', which allows adjusting
most VM options from the install wizard.
The virtinst release includes:
- virt-install: --autostart option for setting domain autostart flag
- virt-install: Allow specifying --host-device with lsusb and lspci
format (0x1234:0x5678 for USB, etc)
- virtinst: New 'Interface' module for building libvirt interface XML
Thanks to everyone who has contributed to this release through testing,
bug reporting, submitting patches, and otherwise sending in feedback!
Thanks,
Cole
14 years, 9 months