[libvirt] [PATCH 0/2] Use correct syntax for thin/sparse pool creation
by John Ferlan
https://bugzilla.redhat.com/show_bug.cgi?id=1166592
More recent versions of LVM have resulted in the inability to recognize
a newly created thin logical volume using libvirt. Not sure exactly which
lvm release resulted in the change, but it's some time between 2.02.106 and
2.02.113 or lvm library version 1.02.85 and 1.02.92.
The short story is libvirt was not really creating thin logical volumes,
instead libvirt was creating thin snapshot logical volumes. More recent
changes in LVM seem to now differentiate the two and the way libvirt was
creating it's logical volumes "now defaulted" to the thin logical volume,
which libvirt was not able to parse properly.
The commit message for patch 1 has the gory details - figured it was best
to keep it in the commit message rather than be lost to some cover letter.
The second patch adds the ability to get the allocation and capacity for
logical volumes from a volResize callback. This will be important for
the thin logical volumes in order to determine the capacity which is stored
in the thin logical volume pool
John Ferlan (2):
logical: Use correct syntax for thin/sparse pool creation
logical: Introduce virStorageBackendLogicalRefreshVol
src/storage/storage_backend_logical.c | 216 +++++++++++++++++++++++++++++++---
src/util/virstoragefile.h | 1 +
2 files changed, 199 insertions(+), 18 deletions(-)
--
1.9.3
9 years, 11 months
[libvirt] [PATCH 0/2] Refactor safezero and virStorageFileResize
by John Ferlan
Originally included as part of a series to fix a problem with file creation
and resize within NFS storage pools that ended up being an issue somewhere
lower in the stack of posix_fallocate or the setting of the block size in
the meta data. The following two patches extract out the refactoring of
safezero and reworking virStorageFileResize to utilize safezero instead.
Original series and review comments for comparison:
http://www.redhat.com/archives/libvir-list/2014-August/msg00491.html
I figured rather than lose any of the code and there is some value in
utilizing the same code in order to handle a similar function that I'd
repost as a separate series.
John Ferlan (2):
virfile: Refactor safezero
virstoragefile: Have virStorageFileResize use safezero
src/locking/lock_driver_sanlock.c | 4 +--
src/storage/storage_backend.c | 2 +-
src/util/virfile.c | 63 +++++++++++++++++++++++++++++++++------
src/util/virfile.h | 2 +-
src/util/virstoragefile.c | 29 ++++++------------
5 files changed, 67 insertions(+), 33 deletions(-)
--
1.9.3
9 years, 11 months
[libvirt] [PATCH v2] storage: unify permission formatting
by Martin Kletzander
Volume and pool formatting functions took different approaches to
unspecified uids/gids. When unknown, it is always parsed as -1, but one
of the functions formatted it as unsigned int (wrong) and one as
int (better). Due to that, our two of our XML files from tests cannot
be parsed on 32-bit machines.
RNG schema needs to be modified as well, but because both
storagepool.rng and storagevol.rng need same schema for permission
element, save some space by moving it to storagecommon.rng.
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
Notes:
v2:
- Added test case vol-gluster-dir-neg-uid that shows how 4294967295 is
correctly read as '-1' even on 64bit machines
docs/schemas/storagecommon.rng | 29 +++++++++++++++++++++
docs/schemas/storagepool.rng | 30 +---------------------
docs/schemas/storagevol.rng | 23 -----------------
src/conf/storage_conf.c | 9 +++----
.../vol-gluster-dir-neg-uid.xml} | 0
...gluster-dir.xml => vol-gluster-dir-neg-uid.xml} | 4 +--
tests/storagevolxml2xmlout/vol-gluster-dir.xml | 4 +--
tests/storagevolxml2xmlout/vol-sheepdog.xml | 4 +--
tests/storagevolxml2xmltest.c | 1 +
9 files changed, 41 insertions(+), 63 deletions(-)
copy tests/{storagevolxml2xmlout/vol-gluster-dir.xml => storagevolxml2xmlin/vol-gluster-dir-neg-uid.xml} (100%)
copy tests/storagevolxml2xmlout/{vol-gluster-dir.xml => vol-gluster-dir-neg-uid.xml} (83%)
diff --git a/docs/schemas/storagecommon.rng b/docs/schemas/storagecommon.rng
index 06b2f81..629505f 100644
--- a/docs/schemas/storagecommon.rng
+++ b/docs/schemas/storagecommon.rng
@@ -93,4 +93,33 @@
<notAllowed/>
</define>
+ <define name='permissions'>
+ <optional>
+ <element name='permissions'>
+ <interleave>
+ <element name='mode'>
+ <ref name='octalMode'/>
+ </element>
+ <element name='owner'>
+ <choice>
+ <ref name='unsignedInt'/>
+ <value>-1</value>
+ </choice>
+ </element>
+ <element name='group'>
+ <choice>
+ <ref name='unsignedInt'/>
+ <value>-1</value>
+ </choice>
+ </element>
+ <optional>
+ <element name='label'>
+ <text/>
+ </element>
+ </optional>
+ </interleave>
+ </element>
+ </optional>
+ </define>
+
</grammar>
diff --git a/docs/schemas/storagepool.rng b/docs/schemas/storagepool.rng
index 0f05c5c..db6ff49 100644
--- a/docs/schemas/storagepool.rng
+++ b/docs/schemas/storagepool.rng
@@ -3,6 +3,7 @@
<grammar xmlns="http://relaxng.org/ns/structure/1.0"
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<include href='basictypes.rng'/>
+ <include href='storagecommon.rng'/>
<start>
<ref name='pool'/>
</start>
@@ -224,35 +225,6 @@
</interleave>
</define>
- <define name='permissions'>
- <optional>
- <element name='permissions'>
- <interleave>
- <element name='mode'>
- <ref name='octalMode'/>
- </element>
- <element name='owner'>
- <choice>
- <ref name='unsignedInt'/>
- <value>-1</value>
- </choice>
- </element>
- <element name='group'>
- <choice>
- <ref name='unsignedInt'/>
- <value>-1</value>
- </choice>
- </element>
- <optional>
- <element name='label'>
- <text/>
- </element>
- </optional>
- </interleave>
- </element>
- </optional>
- </define>
-
<define name='target'>
<element name='target'>
<interleave>
diff --git a/docs/schemas/storagevol.rng b/docs/schemas/storagevol.rng
index 1b2d4cc..7450547 100644
--- a/docs/schemas/storagevol.rng
+++ b/docs/schemas/storagevol.rng
@@ -59,29 +59,6 @@
</interleave>
</define>
- <define name='permissions'>
- <optional>
- <element name='permissions'>
- <interleave>
- <element name='mode'>
- <ref name='octalMode'/>
- </element>
- <element name='owner'>
- <ref name='unsignedInt'/>
- </element>
- <element name='group'>
- <ref name='unsignedInt'/>
- </element>
- <optional>
- <element name='label'>
- <text/>
- </element>
- </optional>
- </interleave>
- </element>
- </optional>
- </define>
-
<define name='timestamps'>
<optional>
<element name='timestamps'>
diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c
index 3987470..e1be064 100644
--- a/src/conf/storage_conf.c
+++ b/src/conf/storage_conf.c
@@ -1203,7 +1203,6 @@ virStoragePoolDefFormat(virStoragePoolDefPtr def)
(int) def->target.perms.uid);
virBufferAsprintf(&buf, "<group>%d</group>\n",
(int) def->target.perms.gid);
-
virBufferEscapeString(&buf, "<label>%s</label>\n",
def->target.perms.label);
@@ -1527,10 +1526,10 @@ virStorageVolTargetDefFormat(virStorageVolOptionsPtr options,
virBufferAsprintf(buf, "<mode>0%o</mode>\n",
def->perms->mode);
- virBufferAsprintf(buf, "<owner>%u</owner>\n",
- (unsigned int) def->perms->uid);
- virBufferAsprintf(buf, "<group>%u</group>\n",
- (unsigned int) def->perms->gid);
+ virBufferAsprintf(buf, "<owner>%d</owner>\n",
+ (int) def->perms->uid);
+ virBufferAsprintf(buf, "<group>%d</group>\n",
+ (int) def->perms->gid);
virBufferEscapeString(buf, "<label>%s</label>\n",
diff --git a/tests/storagevolxml2xmlout/vol-gluster-dir.xml b/tests/storagevolxml2xmlin/vol-gluster-dir-neg-uid.xml
similarity index 100%
copy from tests/storagevolxml2xmlout/vol-gluster-dir.xml
copy to tests/storagevolxml2xmlin/vol-gluster-dir-neg-uid.xml
diff --git a/tests/storagevolxml2xmlout/vol-gluster-dir.xml b/tests/storagevolxml2xmlout/vol-gluster-dir-neg-uid.xml
similarity index 83%
copy from tests/storagevolxml2xmlout/vol-gluster-dir.xml
copy to tests/storagevolxml2xmlout/vol-gluster-dir-neg-uid.xml
index f188ceb..538b31d 100644
--- a/tests/storagevolxml2xmlout/vol-gluster-dir.xml
+++ b/tests/storagevolxml2xmlout/vol-gluster-dir-neg-uid.xml
@@ -10,8 +10,8 @@
<format type='dir'/>
<permissions>
<mode>0600</mode>
- <owner>4294967295</owner>
- <group>4294967295</group>
+ <owner>-1</owner>
+ <group>-1</group>
</permissions>
</target>
</volume>
diff --git a/tests/storagevolxml2xmlout/vol-gluster-dir.xml b/tests/storagevolxml2xmlout/vol-gluster-dir.xml
index f188ceb..538b31d 100644
--- a/tests/storagevolxml2xmlout/vol-gluster-dir.xml
+++ b/tests/storagevolxml2xmlout/vol-gluster-dir.xml
@@ -10,8 +10,8 @@
<format type='dir'/>
<permissions>
<mode>0600</mode>
- <owner>4294967295</owner>
- <group>4294967295</group>
+ <owner>-1</owner>
+ <group>-1</group>
</permissions>
</target>
</volume>
diff --git a/tests/storagevolxml2xmlout/vol-sheepdog.xml b/tests/storagevolxml2xmlout/vol-sheepdog.xml
index e08e36c..0a1f32c 100644
--- a/tests/storagevolxml2xmlout/vol-sheepdog.xml
+++ b/tests/storagevolxml2xmlout/vol-sheepdog.xml
@@ -9,8 +9,8 @@
<format type='unknown'/>
<permissions>
<mode>0600</mode>
- <owner>4294967295</owner>
- <group>4294967295</group>
+ <owner>-1</owner>
+ <group>-1</group>
</permissions>
</target>
</volume>
diff --git a/tests/storagevolxml2xmltest.c b/tests/storagevolxml2xmltest.c
index 234a2f1..cf4d401 100644
--- a/tests/storagevolxml2xmltest.c
+++ b/tests/storagevolxml2xmltest.c
@@ -122,6 +122,7 @@ mymain(void)
DO_TEST("pool-logical", "vol-logical-backing");
DO_TEST("pool-sheepdog", "vol-sheepdog");
DO_TEST("pool-gluster", "vol-gluster-dir");
+ DO_TEST("pool-gluster", "vol-gluster-dir-neg-uid");
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
--
2.2.0
9 years, 11 months
[libvirt] [PATCH v4] automatic create tap device with network type ethernet
by Vasiliy Tolstov
If user not specify network type ethernet, assume that user
needs simple tap device created with libvirt.
This patch does not need to run external script to create tap device or
add root to qemu process. Also libvirt runs script after device creating,
if user provide it.
Difference with v3 that script runs only if it provided.
Signed-off-by: Vasiliy Tolstov <v.tolstov(a)selfip.ru>
---
src/qemu/qemu_command.c | 119 +++++++++++++++++++++++++++++++++++-------------
src/qemu/qemu_hotplug.c | 10 +---
src/qemu/qemu_process.c | 4 ++
3 files changed, 93 insertions(+), 40 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 1831323..78614d5 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -276,6 +276,40 @@ static int
qemuCreateInBridgePortWithHelper(virQEMUDriverConfigPtr cfg,
return *tapfd < 0 ? -1 : 0;
}
+/**
+ * qemuExecuteEthernetScript:
+ * @ifname: the interface name
+ * @script: the script name
+
+ * This function executes script for new tap device created by libvirt.
+ *
+ * Returns 0 in case of success or -1 on failure
+ */
+static int qemuExecuteEthernetScript(const char *ifname, const char *script)
+{
+ virCommandPtr cmd;
+ int ret;
+
+ cmd = virCommandNew(script);
+ virCommandAddArgFormat(cmd, "%s", ifname);
+ virCommandClearCaps(cmd);
+#ifdef CAP_NET_ADMIN
+ virCommandAllowCap(cmd, CAP_NET_ADMIN);
+#endif
+ virCommandAddEnvPassCommon(cmd);
+
+ if (virCommandRun(cmd, NULL) < 0) {
+ ret = -1;
+ } else {
+ ret = 0;
+ }
+
+ cleanup:
+ virCommandFree(cmd);
+ return ret;
+}
+
+
int
qemuNetworkIfaceConnect(virDomainDefPtr def,
virConnectPtr conn,
@@ -313,7 +347,7 @@ qemuNetworkIfaceConnect(virDomainDefPtr def,
} else if (actualType == VIR_DOMAIN_NET_TYPE_BRIDGE) {
if (VIR_STRDUP(brname, virDomainNetGetActualBridgeName(net)) < 0)
return ret;
- } else {
+ } else if (actualType != VIR_DOMAIN_NET_TYPE_ETHERNET) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Network type %d is not supported"),
virDomainNetGetActualType(net));
@@ -335,30 +369,44 @@ qemuNetworkIfaceConnect(virDomainDefPtr def,
tap_create_flags |= VIR_NETDEV_TAP_CREATE_VNET_HDR;
}
- if (cfg->privileged) {
- if (virNetDevTapCreateInBridgePort(brname, &net->ifname, &net->mac,
- def->uuid, tunpath, tapfd,
*tapfdSize,
-
virDomainNetGetActualVirtPortProfile(net),
- virDomainNetGetActualVlan(net),
- tap_create_flags) < 0) {
+ if (actualType == VIR_DOMAIN_NET_TYPE_ETHERNET) {
+ if (virNetDevTapCreate(&net->ifname, tunpath, tapfd, *tapfdSize,
+ tap_create_flags) < 0) {
virDomainAuditNetDevice(def, net, tunpath, false);
goto cleanup;
}
- } else {
- if (qemuCreateInBridgePortWithHelper(cfg, brname,
- &net->ifname,
- tapfd, tap_create_flags) < 0) {
- virDomainAuditNetDevice(def, net, tunpath, false);
+ if (net->script) {
+ if (qemuExecuteEthernetScript(net->ifname, net->script) < 0)
goto cleanup;
}
- /* qemuCreateInBridgePortWithHelper can only create a single FD */
- if (*tapfdSize > 1) {
- VIR_WARN("Ignoring multiqueue network request");
- *tapfdSize = 1;
+ if (virNetDevSetOnline(net->ifname, !!(tap_create_flags &
VIR_NETDEV_TAP_CREATE_IFUP)) < 0)
+ goto cleanup;
+ } else {
+ if (cfg->privileged) {
+ if (virNetDevTapCreateInBridgePort(brname, &net->ifname, &net->mac,
+ def->uuid, tunpath,
tapfd, *tapfdSize,
+
virDomainNetGetActualVirtPortProfile(net),
+ virDomainNetGetActualVlan(net),
+ tap_create_flags) < 0) {
+ virDomainAuditNetDevice(def, net, tunpath, false);
+ goto cleanup;
+ }
+ } else {
+ if (qemuCreateInBridgePortWithHelper(cfg, brname,
+ &net->ifname,
+ tapfd,
tap_create_flags) < 0) {
+ virDomainAuditNetDevice(def, net, tunpath, false);
+ goto cleanup;
+ }
+ /* qemuCreateInBridgePortWithHelper can only create a single FD */
+ if (*tapfdSize > 1) {
+ VIR_WARN("Ignoring multiqueue network request");
+ *tapfdSize = 1;
+ }
}
- }
- virDomainAuditNetDevice(def, net, tunpath, true);
+ virDomainAuditNetDevice(def, net, tunpath, true);
+ }
if (cfg->macFilter &&
ebtablesAddForwardAllowIn(driver->ebtables,
@@ -4534,18 +4582,23 @@ qemuBuildHostNetStr(virDomainNetDefPtr net,
break;
case VIR_DOMAIN_NET_TYPE_ETHERNET:
- virBufferAddLit(&buf, "tap");
- if (net->ifname) {
- virBufferAsprintf(&buf, "%cifname=%s", type_sep, net->ifname);
- type_sep = ',';
- }
- if (net->script) {
- virBufferAsprintf(&buf, "%cscript=%s", type_sep,
- net->script);
- type_sep = ',';
- }
- is_tap = true;
- break;
+ virBufferAddLit(&buf, "tap");
+ type_sep = ',';
+ /* for one tapfd 'fd=' shall be used,
+ * for more than one 'fds=' is the right choice */
+ if (tapfdSize == 1) {
+ virBufferAsprintf(&buf, "%cfd=%s", type_sep, tapfd[0]);
+ } else {
+ virBufferAsprintf(&buf, "%cfds=", type_sep);
+ for (i = 0; i < tapfdSize; i++) {
+ if (i)
+ virBufferAddChar(&buf, ':');
+ virBufferAdd(&buf, tapfd[i], -1);
+ }
+ }
+ type_sep = ',';
+ is_tap = true;
+ break;
case VIR_DOMAIN_NET_TYPE_CLIENT:
virBufferAsprintf(&buf, "socket%cconnect=%s:%d",
@@ -7366,7 +7419,8 @@ qemuBuildInterfaceCommandLine(virCommandPtr cmd,
/* Currently nothing besides TAP devices supports multiqueue. */
if (net->driver.virtio.queues > 0 &&
!(actualType == VIR_DOMAIN_NET_TYPE_NETWORK ||
- actualType == VIR_DOMAIN_NET_TYPE_BRIDGE)) {
+ actualType == VIR_DOMAIN_NET_TYPE_BRIDGE ||
+ actualType == VIR_DOMAIN_NET_TYPE_ETHERNET)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Multiqueue network is not supported for: %s"),
virDomainNetTypeToString(actualType));
@@ -7374,7 +7428,8 @@ qemuBuildInterfaceCommandLine(virCommandPtr cmd,
}
if (actualType == VIR_DOMAIN_NET_TYPE_NETWORK ||
- actualType == VIR_DOMAIN_NET_TYPE_BRIDGE) {
+ actualType == VIR_DOMAIN_NET_TYPE_BRIDGE ||
+ actualType == VIR_DOMAIN_NET_TYPE_ETHERNET) {
tapfdSize = net->driver.virtio.queues;
if (!tapfdSize)
tapfdSize = 1;
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 9467d7d..1175259 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -908,7 +908,8 @@ int qemuDomainAttachNetDevice(virConnectPtr conn,
}
if (actualType == VIR_DOMAIN_NET_TYPE_BRIDGE ||
- actualType == VIR_DOMAIN_NET_TYPE_NETWORK) {
+ actualType == VIR_DOMAIN_NET_TYPE_NETWORK ||
+ actualType == VIR_DOMAIN_NET_TYPE_ETHERNET) {
tapfdSize = vhostfdSize = net->driver.virtio.queues;
if (!tapfdSize)
tapfdSize = vhostfdSize = 1;
@@ -939,13 +940,6 @@ int qemuDomainAttachNetDevice(virConnectPtr conn,
iface_connected = true;
if (qemuOpenVhostNet(vm->def, net, priv->qemuCaps, vhostfd,
&vhostfdSize) < 0)
goto cleanup;
- } else if (actualType == VIR_DOMAIN_NET_TYPE_ETHERNET) {
- vhostfdSize = 1;
- if (VIR_ALLOC(vhostfd) < 0)
- goto cleanup;
- *vhostfd = -1;
- if (qemuOpenVhostNet(vm->def, net, priv->qemuCaps, vhostfd,
&vhostfdSize) < 0)
- goto cleanup;
}
/* Set Bandwidth */
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index a14b6f7..0dbf7fb 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -5064,6 +5064,10 @@ void qemuProcessStop(virQEMUDriverPtr driver,
cfg->stateDir));
VIR_FREE(net->ifname);
break;
+ case VIR_DOMAIN_NET_TYPE_ETHERNET:
+ ignore_value(virNetDevTapDelete(net->ifname, net->backend.tap));
+ VIR_FREE(net->ifname);
+ break;
case VIR_DOMAIN_NET_TYPE_BRIDGE:
case VIR_DOMAIN_NET_TYPE_NETWORK:
#ifdef VIR_NETDEV_TAP_REQUIRE_MANUAL_CLEANUP
--
2.1.3
9 years, 11 months
[libvirt] [libvirt-python][PATCH] Bump version to 1.2.12 for new dev cycle
by Michal Privoznik
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
setup.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/setup.py b/setup.py
index c69fa15..507e156 100755
--- a/setup.py
+++ b/setup.py
@@ -309,7 +309,7 @@ class my_clean(clean):
_c_modules, _py_modules = get_module_lists()
setup(name = 'libvirt-python',
- version = '1.2.11',
+ version = '1.2.12',
url = 'http://www.libvirt.org',
maintainer = 'Libvirt Maintainers',
maintainer_email = 'libvir-list(a)redhat.com',
--
2.0.4
9 years, 11 months
[libvirt] [PATCH V2] libxl: Set path to console on domain startup.
by Anthony PERARD
The path to the pty of a Xen PV console is set only in
virDomainOpenConsole. But this is done too late. A call to
virDomainGetXMLDesc done before OpenConsole will not have the path to
the pty, but a call after OpenConsole will.
e.g. of the current issue.
Starting a domain with '<console type="pty"/>'
Then:
virDomainGetXMLDesc():
<devices>
<console type='pty'>
<target type='xen' port='0'/>
</console>
</devices>
virDomainOpenConsole()
virDomainGetXMLDesc():
<devices>
<console type='pty' tty='/dev/pts/30'>
<source path='/dev/pts/30'/>
<target type='xen' port='0'/>
</console>
</devices>
The patch intend to have the TTY path on the first call of GetXMLDesc.
This is done by setting up the path at domain start up instead of in
OpenConsole.
https://bugzilla.redhat.com/show_bug.cgi?id=1170743
Signed-off-by: Anthony PERARD <anthony.perard(a)citrix.com>
---
Change in V2:
Adding bug report link.
Reword the last part of the patch description.
Cleanup the code.
Use VIR_FREE before VIR_STRDUP.
Remove the code from OpenConsole as it is now a duplicate.
---
src/libxl/libxl_domain.c | 20 ++++++++++++++++++++
src/libxl/libxl_driver.c | 15 ---------------
2 files changed, 20 insertions(+), 15 deletions(-)
diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
index 9c62291..325de79 100644
--- a/src/libxl/libxl_domain.c
+++ b/src/libxl/libxl_domain.c
@@ -1290,6 +1290,26 @@ libxlDomainStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
if (libxlDomainSetVcpuAffinities(driver, vm) < 0)
goto cleanup_dom;
+ if (vm->def->nconsoles) {
+ virDomainChrDefPtr chr = vm->def->consoles[0];
+ if (chr && chr->source.type == VIR_DOMAIN_CHR_TYPE_PTY) {
+ libxl_console_type console_type;
+ char *console = NULL;
+
+ console_type =
+ (chr->targetType == VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL ?
+ LIBXL_CONSOLE_TYPE_SERIAL : LIBXL_CONSOLE_TYPE_PV);
+ ret = libxl_console_get_tty(priv->ctx, vm->def->id,
+ chr->target.port, console_type,
+ &console);
+ if (!ret) {
+ VIR_FREE(chr->source.data.file.path);
+ ignore_value(VIR_STRDUP(chr->source.data.file.path, console));
+ }
+ VIR_FREE(console);
+ }
+ }
+
if (!start_paused) {
libxl_domain_unpause(priv->ctx, domid);
virDomainObjSetState(vm, VIR_DOMAIN_RUNNING, VIR_DOMAIN_RUNNING_BOOTED);
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index 53c87ce..e79afac 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -3957,10 +3957,8 @@ libxlDomainOpenConsole(virDomainPtr dom,
{
virDomainObjPtr vm = NULL;
int ret = -1;
- libxl_console_type console_type;
virDomainChrDefPtr chr = NULL;
libxlDomainObjPrivatePtr priv;
- char *console = NULL;
virCheckFlags(VIR_DOMAIN_CONSOLE_FORCE, -1);
@@ -4002,18 +4000,6 @@ libxlDomainOpenConsole(virDomainPtr dom,
goto cleanup;
}
- console_type =
- (chr->targetType == VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL ?
- LIBXL_CONSOLE_TYPE_SERIAL : LIBXL_CONSOLE_TYPE_PV);
-
- ret = libxl_console_get_tty(priv->ctx, vm->def->id, chr->target.port,
- console_type, &console);
- if (ret)
- goto cleanup;
-
- if (VIR_STRDUP(chr->source.data.file.path, console) < 0)
- goto cleanup;
-
/* handle mutually exclusive access to console devices */
ret = virChrdevOpen(priv->devs,
&chr->source,
@@ -4027,7 +4013,6 @@ libxlDomainOpenConsole(virDomainPtr dom,
}
cleanup:
- VIR_FREE(console);
if (vm)
virObjectUnlock(vm);
return ret;
--
Anthony PERARD
9 years, 11 months
[libvirt] [PATCH] qemu: fix use a nonexist address in qemuDomainAttachDeviceConfig
by Luyao Huang
We free them before, then use it. This make we always do
virDomainDefAddImplicitControllers when attach a disk.
Signed-off-by: Luyao Huang <lhuang(a)redhat.com>
---
src/qemu/qemu_driver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index df3ba6d..a9afa5d 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -7223,10 +7223,10 @@ qemuDomainAttachDeviceConfig(virQEMUCapsPtr qemuCaps,
if (virDomainDiskInsert(vmdef, disk))
return -1;
/* vmdef has the pointer. Generic codes for vmdef will do all jobs */
- dev->data.disk = NULL;
if (disk->bus != VIR_DOMAIN_DISK_BUS_VIRTIO)
if (virDomainDefAddImplicitControllers(vmdef) < 0)
return -1;
+ dev->data.disk = NULL;
if (qemuDomainAssignAddresses(vmdef, qemuCaps, NULL) < 0)
return -1;
break;
--
1.8.3.1
9 years, 11 months
[libvirt] [PATCH] spec: Disable -Werror in Fedora RPM builds
by Daniel P. Berrange
Since we switched to using GIT to apply patches in the RPM spec,
we automagically also turned on -Werror, since the .git directory
now exists. We don't want this on in Fedora, since changing
header files often lead to new warnings being issued. Explicitly
turn off -Werror for non-RHEL platforms, instead of relying on
the defaults
---
libvirt.spec.in | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index 264c06f..edf2df8 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -357,6 +357,8 @@
# changes in reported warnings
%if 0%{?rhel}
%define enable_werror --enable-werror
+else
+ %define enable_werror --disable-werror
%endif
--
2.1.0
9 years, 11 months
[libvirt] [PATCH v3 0/3] parallels: a set of fixes for nova
by Dmitry Guryanov
Hello,
This 3 patches fix different things, used by nova.
Dmitry Guryanov (3):
parallels: support NULL virDomainVideoAccelDefPtr
parallels: set format for real disk devices
parallels: fix usage of disk->info.addr.drive structure
src/parallels/parallels_sdk.c | 34 ++++++++++++++++++++++++++++++----
1 file changed, 30 insertions(+), 4 deletions(-)
--
2.1.0
9 years, 11 months
[libvirt] ANNOUNCE: libvirt-glib release 0.2.0
by Daniel P. Berrange
I am pleased to announce that a new release of the libvirt-glib package,
version 0.2.0, is now available from
ftp://libvirt.org/libvirt/glib/
The packages are GPG signed with
Key fingerprint: DAF3 A6FD B26B 6291 2D0E 8E3F BE86 EBB4 1510 4FDF (4096R)
Changes in this release:
- Support keyboard input device config
- Annotate some unused parameters
- Add support for new graphics attach API
libvirt-glib comprises three distinct libraries:
- libvirt-glib - Integrate with the GLib event loop and error handling
- libvirt-gconfig - Representation of libvirt XML documents as GObjects
- libvirt-gobject - Mapping of libvirt APIs into the GObject type system
NB: While libvirt aims to be API/ABI stable forever, with libvirt-glib
we are not currently guaranteeing that libvirt-glib libraries are
permanently API/ABI stable. That said we do not expect to break the
API/ABI for the forseeable future and will always strive avoid it.
Follow up comments about libvirt-glib should be directed to the regular
libvir-list(a)redhat.com development list.
Thanks to all the people involved in contributing to this release.
Regards,
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
9 years, 11 months