[libvirt] [PATCH v2] sasl: Fix authentication when using PLAIN mechanism
by Christophe Fergeau
With some authentication mechanism (PLAIN for example), sasl_client_start()
can return SASL_OK, which translates to virNetSASLSessionClientStart()
returning VIR_NET_SASL_COMPLETE.
cyrus-sasl documentation is a bit vague as to what to do in such situation,
but upstream clarified this a bit in
http://asg.andrew.cmu.edu/archive/message.php?mailbox=archive.cyrus-sasl&...
When we got VIR_NET_SASL_COMPLETE after virNetSASLSessionClientStart() and
if the remote also tells us that authentication is complete, then we should
end the authentication procedure rather than forcing a call to
virNetSASLSessionClientStep(). Without this patch, when trying to use SASL
PLAIN, I get:
error :authentication failed : Failed to step SASL negotiation: -1
(SASL(-1): generic failure: Unable to find a callback: 32775)
This patch is based on a spice-gtk patch by Dietmar Maurer.
---
Changes since v1:
- adjust comment before the for(;;) code block
- add comment before the if (complete && ...) test as this is what is done
for these tests in this block.
src/remote/remote_driver.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index 7181949..38da119 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -4122,9 +4122,16 @@ remoteAuthSASL(virConnectPtr conn, struct private_data *priv,
complete, serverinlen, serverin);
/* Loop-the-loop...
- * Even if the server has completed, the client must *always* do at least one step
- * in this loop to verify the server isn't lying about something. Mutual auth */
+ * Even if the server has completed, the client must loop until sasl_client_start() or
+ * sasl_client_step() return SASL_OK to verify the server isn't lying
+ * about something. Mutual auth
+ * */
for (;;) {
+ /* Previous server call showed completion & sasl_client_start()
+ * told us we are locally complete too */
+ if (complete && err == VIR_NET_SASL_COMPLETE)
+ break;
+
restep:
if ((err = virNetSASLSessionClientStep(sasl,
serverin,
--
1.8.4.2
11 years, 1 month
[libvirt] [PATCH] m4: use -Wl,-pie instead of -pie for clang
by Ryota Ozaki
clang doesn't support -pie option (as of clang 3.3):
clang: error: argument unused during compilation:
'-pie' [-Werror,-Wunused-command-line-argument]
We have to use -Wl,-pie instead.
(ref. https://bugs.ruby-lang.org/issues/5697)
The new code checks -pie first, and if it fails, checks -Wl,-pie
next. By doing so, we can handle both cases.
The patch is tested on Mac OS X 10.8.5 and Fedora 19.
Signed-off-by: Ryota Ozaki <ozaki.ryota(a)gmail.com>
---
m4/virt-compile-pie.m4 | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/m4/virt-compile-pie.m4 b/m4/virt-compile-pie.m4
index cceb495..11cf0af 100644
--- a/m4/virt-compile-pie.m4
+++ b/m4/virt-compile-pie.m4
@@ -27,7 +27,14 @@ AC_DEFUN([LIBVIRT_COMPILE_PIE],[
*)
gl_COMPILER_OPTION_IF([-fPIE -DPIE], [
PIE_CFLAGS="-fPIE -DPIE"
- PIE_LDFLAGS="-pie"
+ gl_COMPILER_OPTION_IF(["-pie"], [
+ PIE_LDFLAGS="-pie"
+ ], [
+ dnl clang requires -Wl,-pie instead of -pie
+ gl_COMPILER_OPTION_IF(["-Wl,-pie"], [
+ PIE_LDFLAGS="-Wl,-pie"
+ ])
+ ])
])
esac
AC_SUBST([PIE_CFLAGS])
--
1.8.4
11 years, 1 month
[libvirt] [PATCH] sasl: Fix authentication when using PLAIN mechanism
by Christophe Fergeau
With some authentication mechanism (PLAIN for example), sasl_client_start()
can return SASL_OK, which translates to virNetSASLSessionClientStart()
returning VIR_NET_SASL_COMPLETE.
cyrus-sasl documentation is a bit vague as to what to do in such situation,
but upstream clarified this a bit in
http://asg.andrew.cmu.edu/archive/message.php?mailbox=archive.cyrus-sasl&...
When we got VIR_NET_SASL_COMPLETE after virNetSASLSessionClientStart() and
if the remote also tells us that authentication is complete, then we should
end the authentication procedure rather than forcing a call to
virNetSASLSessionClientStep(). Without this patch, when trying to use SASL
PLAIN, I get:
error :authentication failed : Failed to step SASL negotiation: -1
(SASL(-1): generic failure: Unable to find a callback: 32775)
This patch is based on a spice-gtk patch by Dietmar Maurer.
---
src/remote/remote_driver.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index 7181949..e15eeaf 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -4125,6 +4125,9 @@ remoteAuthSASL(virConnectPtr conn, struct private_data *priv,
* Even if the server has completed, the client must *always* do at least one step
* in this loop to verify the server isn't lying about something. Mutual auth */
for (;;) {
+ if (complete && err == VIR_NET_SASL_COMPLETE)
+ break;
+
restep:
if ((err = virNetSASLSessionClientStep(sasl,
serverin,
--
1.8.4.2
11 years, 1 month
[libvirt] [PATCH] build: Don't fail on '< ' or '> ' with old xmllint
by Martin Kletzander
Older xmllint version don't allow such characters in datatype anyURI.
In order not to change too much, I'm suggesting making a choice of
anyURI or 'absPathName' which should be fine (checked with upstream
and that old xmllint, both work fine).
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
Notes:
Pushed as a build-breaker
docs/schemas/storagevol.rng | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/docs/schemas/storagevol.rng b/docs/schemas/storagevol.rng
index 8bc5907..5da8e1f 100644
--- a/docs/schemas/storagevol.rng
+++ b/docs/schemas/storagevol.rng
@@ -105,7 +105,10 @@
<element name='target'>
<optional>
<element name='path'>
- <data type='anyURI'/>
+ <choice>
+ <data type='anyURI'/>
+ <ref name='absFilePath'/>
+ </choice>
</element>
</optional>
<ref name='format'/>
--
1.8.4.3
11 years, 1 month
[libvirt] [PATCH] storage: use valid XML for awkward volume names
by Eric Blake
$ touch /var/lib/libvirt/images/'a<b>c'
$ virsh pool-refresh default
$ virsh vol-dumpxml 'a<b>c' default | head -n2
<volume>
<name>a<b>c</name>
Oops. That's not valid XML. And when we fix the XML
generation, it fails RelaxNG validation.
I'm also tired of seeing <key>(null)</key> in the example
output for volume xml; while we used NULLSTR() to avoid
a NULL deref rather than relying on glibc's printf
extension behavior, it's even better if we avoid the issue
in the first place.
Note that this patch allows pretty much any volume name
that can appear in a directory (excluding . and .. because
those are special), but does nothing to change the current
(unenforced) RelaxNG claim that pool names will consist
only of letters, numbers, _, -, and +. Tightening the C
code to match RelaxNG patterns and/or relaxing the grammar
to match the C code for pool names is a task for another
day (but remember, we DID recently tighten C code for
domain names to exclude a leading '.').
* src/conf/storage_conf.c (virStoragePoolSourceFormat)
(virStoragePoolDefFormat, virStorageVolTargetDefFormat)
(virStorageVolDefFormat): Escape user-controlled strings.
(virStorageVolDefParseXML): Parse key, for use in unit tests.
* docs/schemas/basictypes.rng (volName): Relax definition.
* tests/storagepoolxml2xmltest.c (mymain): Test it.
* tests/storagevolxml2xmltest.c (mymain): Likewise.
* tests/storagepoolxml2xmlin/pool-dir-naming.xml: New file.
* tests/storagepoolxml2xmlout/pool-dir-naming.xml: Likewise.
* tests/storagevolxml2xmlin/vol-file-naming.xml: Likewise.
* tests/storagevolxml2xmlout/vol-file-naming.xml: Likewise.
* tests/storagevolxml2xmlout/vol-*.xml: Fix fallout.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
docs/schemas/basictypes.rng | 9 ++-
src/conf/storage_conf.c | 72 ++++++++++------------
tests/storagepoolxml2xmlin/pool-dir-naming.xml | 18 ++++++
tests/storagepoolxml2xmlout/pool-dir-naming.xml | 18 ++++++
tests/storagepoolxml2xmltest.c | 1 +
tests/storagevolxml2xmlin/vol-file-backing.xml | 1 +
tests/storagevolxml2xmlin/vol-file-naming.xml | 20 ++++++
tests/storagevolxml2xmlout/vol-file-backing.xml | 2 +-
tests/storagevolxml2xmlout/vol-file-naming.xml | 17 +++++
tests/storagevolxml2xmlout/vol-file.xml | 1 -
tests/storagevolxml2xmlout/vol-logical-backing.xml | 2 +-
tests/storagevolxml2xmlout/vol-logical.xml | 2 +-
tests/storagevolxml2xmlout/vol-partition.xml | 2 +-
tests/storagevolxml2xmlout/vol-qcow2-0.10-lazy.xml | 2 +-
tests/storagevolxml2xmlout/vol-qcow2-1.1.xml | 2 +-
tests/storagevolxml2xmlout/vol-qcow2-lazy.xml | 2 +-
tests/storagevolxml2xmlout/vol-qcow2-nobacking.xml | 2 +-
tests/storagevolxml2xmlout/vol-qcow2.xml | 2 +-
tests/storagevolxml2xmlout/vol-sheepdog.xml | 1 -
tests/storagevolxml2xmltest.c | 1 +
20 files changed, 125 insertions(+), 52 deletions(-)
create mode 100644 tests/storagepoolxml2xmlin/pool-dir-naming.xml
create mode 100644 tests/storagepoolxml2xmlout/pool-dir-naming.xml
create mode 100644 tests/storagevolxml2xmlin/vol-file-naming.xml
create mode 100644 tests/storagevolxml2xmlout/vol-file-naming.xml
diff --git a/docs/schemas/basictypes.rng b/docs/schemas/basictypes.rng
index 7fbfa53..268bc5a 100644
--- a/docs/schemas/basictypes.rng
+++ b/docs/schemas/basictypes.rng
@@ -291,8 +291,15 @@
</define>
<define name='volName'>
+ <!-- directory pools allow almost any file name as a volume name -->
<data type='string'>
- <param name="pattern">[a-zA-Z0-9_\+\-\.]+</param>
+ <param name="pattern">[^/]+</param>
+ <except>
+ <choice>
+ <value>.</value>
+ <value>..</value>
+ </choice>
+ </except>
</data>
</define>
diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c
index 33e4caf..8b378c2 100644
--- a/src/conf/storage_conf.c
+++ b/src/conf/storage_conf.c
@@ -1056,7 +1056,8 @@ virStoragePoolSourceFormat(virBufferPtr buf,
virBufferAddLit(buf, " <source>\n");
if ((options->flags & VIR_STORAGE_POOL_SOURCE_HOST) && src->nhost) {
for (i = 0; i < src->nhost; i++) {
- virBufferAsprintf(buf, " <host name='%s'", src->hosts[i].name);
+ virBufferEscapeString(buf, " <host name='%s'",
+ src->hosts[i].name);
if (src->hosts[i].port)
virBufferAsprintf(buf, " port='%d'", src->hosts[i].port);
virBufferAddLit(buf, "/>\n");
@@ -1067,8 +1068,8 @@ virStoragePoolSourceFormat(virBufferPtr buf,
src->ndevice) {
for (i = 0; i < src->ndevice; i++) {
if (src->devices[i].nfreeExtent) {
- virBufferAsprintf(buf, " <device path='%s'>\n",
- src->devices[i].path);
+ virBufferEscapeString(buf, " <device path='%s'>\n",
+ src->devices[i].path);
for (j = 0; j < src->devices[i].nfreeExtent; j++) {
virBufferAsprintf(buf, " <freeExtent start='%llu' end='%llu'/>\n",
src->devices[i].freeExtents[j].start,
@@ -1076,15 +1077,14 @@ virStoragePoolSourceFormat(virBufferPtr buf,
}
virBufferAddLit(buf, " </device>\n");
} else {
- virBufferAsprintf(buf, " <device path='%s'/>\n",
- src->devices[i].path);
+ virBufferEscapeString(buf, " <device path='%s'/>\n",
+ src->devices[i].path);
}
}
}
- if ((options->flags & VIR_STORAGE_POOL_SOURCE_DIR) &&
- src->dir)
- virBufferAsprintf(buf, " <dir path='%s'/>\n", src->dir);
+ if (options->flags & VIR_STORAGE_POOL_SOURCE_DIR)
+ virBufferEscapeString(buf, " <dir path='%s'/>\n", src->dir);
if ((options->flags & VIR_STORAGE_POOL_SOURCE_ADAPTER)) {
if (src->adapter.type == VIR_STORAGE_POOL_SOURCE_ADAPTER_TYPE_FC_HOST ||
@@ -1104,9 +1104,8 @@ virStoragePoolSourceFormat(virBufferPtr buf,
}
}
- if ((options->flags & VIR_STORAGE_POOL_SOURCE_NAME) &&
- src->name)
- virBufferAsprintf(buf, " <name>%s</name>\n", src->name);
+ if (options->flags & VIR_STORAGE_POOL_SOURCE_NAME)
+ virBufferEscapeString(buf, " <name>%s</name>\n", src->name);
if ((options->flags & VIR_STORAGE_POOL_SOURCE_INITIATOR_IQN) &&
src->initiator.iqn) {
@@ -1129,11 +1128,12 @@ virStoragePoolSourceFormat(virBufferPtr buf,
if (src->authType == VIR_STORAGE_POOL_AUTH_CHAP ||
src->authType == VIR_STORAGE_POOL_AUTH_CEPHX) {
- virBufferAsprintf(buf, " <auth type='%s' username='%s'>\n",
- virStoragePoolAuthTypeTypeToString(src->authType),
- (src->authType == VIR_STORAGE_POOL_AUTH_CHAP ?
- src->auth.chap.username :
- src->auth.cephx.username));
+ virBufferAsprintf(buf, " <auth type='%s' ",
+ virStoragePoolAuthTypeTypeToString(src->authType));
+ virBufferEscapeString(buf, "username='%s'>\n",
+ (src->authType == VIR_STORAGE_POOL_AUTH_CHAP ?
+ src->auth.chap.username :
+ src->auth.cephx.username));
virBufferAddLit(buf, " <secret");
if (src->auth.cephx.secret.uuidUsable) {
@@ -1149,13 +1149,8 @@ virStoragePoolSourceFormat(virBufferPtr buf,
virBufferAddLit(buf, " </auth>\n");
}
- if (src->vendor != NULL) {
- virBufferEscapeString(buf, " <vendor name='%s'/>\n", src->vendor);
- }
-
- if (src->product != NULL) {
- virBufferEscapeString(buf, " <product name='%s'/>\n", src->product);
- }
+ virBufferEscapeString(buf, " <vendor name='%s'/>\n", src->vendor);
+ virBufferEscapeString(buf, " <product name='%s'/>\n", src->product);
virBufferAddLit(buf, " </source>\n");
@@ -1182,7 +1177,7 @@ virStoragePoolDefFormat(virStoragePoolDefPtr def)
goto cleanup;
}
virBufferAsprintf(&buf, "<pool type='%s'>\n", type);
- virBufferAsprintf(&buf, " <name>%s</name>\n", def->name);
+ virBufferEscapeString(&buf, " <name>%s</name>\n", def->name);
virUUIDFormat(def->uuid, uuid);
virBufferAsprintf(&buf, " <uuid>%s</uuid>\n", uuid);
@@ -1203,8 +1198,7 @@ virStoragePoolDefFormat(virStoragePoolDefPtr def)
def->type != VIR_STORAGE_POOL_SHEEPDOG) {
virBufferAddLit(&buf, " <target>\n");
- if (def->target.path)
- virBufferAsprintf(&buf, " <path>%s</path>\n", def->target.path);
+ virBufferEscapeString(&buf, " <path>%s</path>\n", def->target.path);
virBufferAddLit(&buf, " <permissions>\n");
virBufferAsprintf(&buf, " <mode>0%o</mode>\n",
@@ -1214,9 +1208,8 @@ virStoragePoolDefFormat(virStoragePoolDefPtr def)
virBufferAsprintf(&buf, " <group>%d</group>\n",
(int) def->target.perms.gid);
- if (def->target.perms.label)
- virBufferAsprintf(&buf, " <label>%s</label>\n",
- def->target.perms.label);
+ virBufferEscapeString(&buf, " <label>%s</label>\n",
+ def->target.perms.label);
virBufferAddLit(&buf, " </permissions>\n");
virBufferAddLit(&buf, " </target>\n");
@@ -1282,8 +1275,8 @@ virStorageVolDefParseXML(virStoragePoolDefPtr pool,
goto error;
}
- /* Auto-generated so deliberately ignore */
- /* ret->key = virXPathString("string(./key)", ctxt); */
+ /* Normally generated by pool refresh, but useful for unit tests */
+ ret->key = virXPathString("string(./key)", ctxt);
capacity = virXPathString("string(./capacity)", ctxt);
unit = virXPathString("string(./capacity/@unit)", ctxt);
@@ -1485,11 +1478,11 @@ static int
virStorageVolTargetDefFormat(virStorageVolOptionsPtr options,
virBufferPtr buf,
virStorageVolTargetPtr def,
- const char *type) {
+ const char *type)
+{
virBufferAsprintf(buf, " <%s>\n", type);
- if (def->path)
- virBufferAsprintf(buf, " <path>%s</path>\n", def->path);
+ virBufferEscapeString(buf, " <path>%s</path>\n", def->path);
if (options->formatToString) {
const char *format = (options->formatToString)(def->format);
@@ -1511,8 +1504,7 @@ virStorageVolTargetDefFormat(virStorageVolOptionsPtr options,
(unsigned int) def->perms.gid);
- if (def->perms.label)
- virBufferAsprintf(buf, " <label>%s</label>\n",
+ virBufferEscapeString(buf, " <label>%s</label>\n",
def->perms.label);
virBufferAddLit(buf, " </permissions>\n");
@@ -1572,8 +1564,8 @@ virStorageVolDefFormat(virStoragePoolDefPtr pool,
return NULL;
virBufferAddLit(&buf, "<volume>\n");
- virBufferAsprintf(&buf, " <name>%s</name>\n", def->name);
- virBufferAsprintf(&buf, " <key>%s</key>\n", NULLSTR(def->key));
+ virBufferEscapeString(&buf, " <name>%s</name>\n", def->name);
+ virBufferEscapeString(&buf, " <key>%s</key>\n", def->key);
virBufferAddLit(&buf, " <source>\n");
if (def->source.nextent) {
@@ -1585,8 +1577,8 @@ virStorageVolDefFormat(virStoragePoolDefPtr pool,
if (thispath != NULL)
virBufferAddLit(&buf, " </device>\n");
- virBufferAsprintf(&buf, " <device path='%s'>\n",
- def->source.extents[i].path);
+ virBufferEscapeString(&buf, " <device path='%s'>\n",
+ def->source.extents[i].path);
}
virBufferAsprintf(&buf,
diff --git a/tests/storagepoolxml2xmlin/pool-dir-naming.xml b/tests/storagepoolxml2xmlin/pool-dir-naming.xml
new file mode 100644
index 0000000..aa043be
--- /dev/null
+++ b/tests/storagepoolxml2xmlin/pool-dir-naming.xml
@@ -0,0 +1,18 @@
+<pool type='dir'>
+ <name>virtimages</name>
+ <uuid>70a7eb15-6c34-ee9c-bf57-69e8e5ff3fb2</uuid>
+ <capacity>0</capacity>
+ <allocation>0</allocation>
+ <available>0</available>
+ <source>
+ </source>
+ <target>
+ <path>///var/////lib/libvirt/<images>//</path>
+ <permissions>
+ <mode>0700</mode>
+ <owner>-1</owner>
+ <group>-1</group>
+ <label>some_label_t</label>
+ </permissions>
+ </target>
+</pool>
diff --git a/tests/storagepoolxml2xmlout/pool-dir-naming.xml b/tests/storagepoolxml2xmlout/pool-dir-naming.xml
new file mode 100644
index 0000000..536f58c
--- /dev/null
+++ b/tests/storagepoolxml2xmlout/pool-dir-naming.xml
@@ -0,0 +1,18 @@
+<pool type='dir'>
+ <name>virtimages</name>
+ <uuid>70a7eb15-6c34-ee9c-bf57-69e8e5ff3fb2</uuid>
+ <capacity unit='bytes'>0</capacity>
+ <allocation unit='bytes'>0</allocation>
+ <available unit='bytes'>0</available>
+ <source>
+ </source>
+ <target>
+ <path>/var/lib/libvirt/<images></path>
+ <permissions>
+ <mode>0700</mode>
+ <owner>-1</owner>
+ <group>-1</group>
+ <label>some_label_t</label>
+ </permissions>
+ </target>
+</pool>
diff --git a/tests/storagepoolxml2xmltest.c b/tests/storagepoolxml2xmltest.c
index 743e1cb..a81cf99 100644
--- a/tests/storagepoolxml2xmltest.c
+++ b/tests/storagepoolxml2xmltest.c
@@ -85,6 +85,7 @@ mymain(void)
ret = -1
DO_TEST("pool-dir");
+ DO_TEST("pool-dir-naming");
DO_TEST("pool-fs");
DO_TEST("pool-logical");
DO_TEST("pool-logical-nopath");
diff --git a/tests/storagevolxml2xmlin/vol-file-backing.xml b/tests/storagevolxml2xmlin/vol-file-backing.xml
index d23349e..73e7f28 100644
--- a/tests/storagevolxml2xmlin/vol-file-backing.xml
+++ b/tests/storagevolxml2xmlin/vol-file-backing.xml
@@ -1,5 +1,6 @@
<volume>
<name>sparse.img</name>
+ <key>/var/lib/libvirt/images/sparse.img</key>
<source/>
<capacity unit='GB'>10</capacity>
<allocation unit='MiB'>0</allocation>
diff --git a/tests/storagevolxml2xmlin/vol-file-naming.xml b/tests/storagevolxml2xmlin/vol-file-naming.xml
new file mode 100644
index 0000000..9a33e2b
--- /dev/null
+++ b/tests/storagevolxml2xmlin/vol-file-naming.xml
@@ -0,0 +1,20 @@
+<volume>
+ <name><sparse>.img</name>
+ <source/>
+ <capacity unit="TiB">1</capacity>
+ <allocation unit="bytes">0</allocation>
+ <target>
+ <path>/var/lib/libvirt/images/<sparse>.img</path>
+ <permissions>
+ <mode>0</mode>
+ <owner>0744</owner>
+ <group>0</group>
+ <label>virt_image_t</label>
+ </permissions>
+ <timestamps>
+ <atime>1341933637.273190990</atime>
+ <mtime>1341930622.047245868</mtime>
+ <ctime>1341930622.047245868</ctime>
+ </timestamps>
+ </target>
+</volume>
diff --git a/tests/storagevolxml2xmlout/vol-file-backing.xml b/tests/storagevolxml2xmlout/vol-file-backing.xml
index c0f152e..8d2fb57 100644
--- a/tests/storagevolxml2xmlout/vol-file-backing.xml
+++ b/tests/storagevolxml2xmlout/vol-file-backing.xml
@@ -1,6 +1,6 @@
<volume>
<name>sparse.img</name>
- <key>(null)</key>
+ <key>/var/lib/libvirt/images/sparse.img</key>
<source>
</source>
<capacity unit='bytes'>10000000000</capacity>
diff --git a/tests/storagevolxml2xmlout/vol-file-naming.xml b/tests/storagevolxml2xmlout/vol-file-naming.xml
new file mode 100644
index 0000000..7022b02
--- /dev/null
+++ b/tests/storagevolxml2xmlout/vol-file-naming.xml
@@ -0,0 +1,17 @@
+<volume>
+ <name><sparse>.img</name>
+ <source>
+ </source>
+ <capacity unit='bytes'>1099511627776</capacity>
+ <allocation unit='bytes'>0</allocation>
+ <target>
+ <path>/var/lib/libvirt/images/<sparse>.img</path>
+ <format type='raw'/>
+ <permissions>
+ <mode>00</mode>
+ <owner>744</owner>
+ <group>0</group>
+ <label>virt_image_t</label>
+ </permissions>
+ </target>
+</volume>
diff --git a/tests/storagevolxml2xmlout/vol-file.xml b/tests/storagevolxml2xmlout/vol-file.xml
index a3d6473..b97dd50 100644
--- a/tests/storagevolxml2xmlout/vol-file.xml
+++ b/tests/storagevolxml2xmlout/vol-file.xml
@@ -1,6 +1,5 @@
<volume>
<name>sparse.img</name>
- <key>(null)</key>
<source>
</source>
<capacity unit='bytes'>1099511627776</capacity>
diff --git a/tests/storagevolxml2xmlout/vol-logical-backing.xml b/tests/storagevolxml2xmlout/vol-logical-backing.xml
index 6b010e3..bf34b08 100644
--- a/tests/storagevolxml2xmlout/vol-logical-backing.xml
+++ b/tests/storagevolxml2xmlout/vol-logical-backing.xml
@@ -1,6 +1,6 @@
<volume>
<name>Swap</name>
- <key>(null)</key>
+ <key>r4xkCv-MQhr-WKIT-R66x-Epn2-e8hG-1Z5gY0</key>
<source>
</source>
<capacity unit='bytes'>2080374784</capacity>
diff --git a/tests/storagevolxml2xmlout/vol-logical.xml b/tests/storagevolxml2xmlout/vol-logical.xml
index 7bf309e..e9b4e4b 100644
--- a/tests/storagevolxml2xmlout/vol-logical.xml
+++ b/tests/storagevolxml2xmlout/vol-logical.xml
@@ -1,6 +1,6 @@
<volume>
<name>Swap</name>
- <key>(null)</key>
+ <key>r4xkCv-MQhr-WKIT-R66x-Epn2-e8hG-1Z5gY0</key>
<source>
</source>
<capacity unit='bytes'>2080374784</capacity>
diff --git a/tests/storagevolxml2xmlout/vol-partition.xml b/tests/storagevolxml2xmlout/vol-partition.xml
index 271964f..9be1cf1 100644
--- a/tests/storagevolxml2xmlout/vol-partition.xml
+++ b/tests/storagevolxml2xmlout/vol-partition.xml
@@ -1,6 +1,6 @@
<volume>
<name>sda1</name>
- <key>(null)</key>
+ <key>/dev/sda1</key>
<source>
</source>
<capacity unit='bytes'>106896384</capacity>
diff --git a/tests/storagevolxml2xmlout/vol-qcow2-0.10-lazy.xml b/tests/storagevolxml2xmlout/vol-qcow2-0.10-lazy.xml
index a7b5fed..fd3d606 100644
--- a/tests/storagevolxml2xmlout/vol-qcow2-0.10-lazy.xml
+++ b/tests/storagevolxml2xmlout/vol-qcow2-0.10-lazy.xml
@@ -1,6 +1,6 @@
<volume>
<name>OtherDemo.img</name>
- <key>(null)</key>
+ <key>/var/lib/libvirt/images/OtherDemo.img</key>
<source>
</source>
<capacity unit='bytes'>5368709120</capacity>
diff --git a/tests/storagevolxml2xmlout/vol-qcow2-1.1.xml b/tests/storagevolxml2xmlout/vol-qcow2-1.1.xml
index b7df8a6..99fb5ac 100644
--- a/tests/storagevolxml2xmlout/vol-qcow2-1.1.xml
+++ b/tests/storagevolxml2xmlout/vol-qcow2-1.1.xml
@@ -1,6 +1,6 @@
<volume>
<name>OtherDemo.img</name>
- <key>(null)</key>
+ <key>/var/lib/libvirt/images/OtherDemo.img</key>
<source>
</source>
<capacity unit='bytes'>5368709120</capacity>
diff --git a/tests/storagevolxml2xmlout/vol-qcow2-lazy.xml b/tests/storagevolxml2xmlout/vol-qcow2-lazy.xml
index 92b7875..3708ea7 100644
--- a/tests/storagevolxml2xmlout/vol-qcow2-lazy.xml
+++ b/tests/storagevolxml2xmlout/vol-qcow2-lazy.xml
@@ -1,6 +1,6 @@
<volume>
<name>OtherDemo.img</name>
- <key>(null)</key>
+ <key>/var/lib/libvirt/images/OtherDemo.img</key>
<source>
</source>
<capacity unit='bytes'>5368709120</capacity>
diff --git a/tests/storagevolxml2xmlout/vol-qcow2-nobacking.xml b/tests/storagevolxml2xmlout/vol-qcow2-nobacking.xml
index e2da702..f6a2e21 100644
--- a/tests/storagevolxml2xmlout/vol-qcow2-nobacking.xml
+++ b/tests/storagevolxml2xmlout/vol-qcow2-nobacking.xml
@@ -1,6 +1,6 @@
<volume>
<name>OtherDemo.img</name>
- <key>(null)</key>
+ <key>/var/lib/libvirt/images/OtherDemo.img</key>
<source>
</source>
<capacity unit='bytes'>5368709120</capacity>
diff --git a/tests/storagevolxml2xmlout/vol-qcow2.xml b/tests/storagevolxml2xmlout/vol-qcow2.xml
index f931a62..b9adcb4 100644
--- a/tests/storagevolxml2xmlout/vol-qcow2.xml
+++ b/tests/storagevolxml2xmlout/vol-qcow2.xml
@@ -1,6 +1,6 @@
<volume>
<name>OtherDemo.img</name>
- <key>(null)</key>
+ <key>/var/lib/libvirt/images/OtherDemo.img</key>
<source>
</source>
<capacity unit='bytes'>5368709120</capacity>
diff --git a/tests/storagevolxml2xmlout/vol-sheepdog.xml b/tests/storagevolxml2xmlout/vol-sheepdog.xml
index 2f19af8..bd5d6d8 100644
--- a/tests/storagevolxml2xmlout/vol-sheepdog.xml
+++ b/tests/storagevolxml2xmlout/vol-sheepdog.xml
@@ -1,6 +1,5 @@
<volume>
<name>test2</name>
- <key>(null)</key>
<source>
</source>
<capacity unit='bytes'>1024</capacity>
diff --git a/tests/storagevolxml2xmltest.c b/tests/storagevolxml2xmltest.c
index 1fd01f1..e1db465 100644
--- a/tests/storagevolxml2xmltest.c
+++ b/tests/storagevolxml2xmltest.c
@@ -110,6 +110,7 @@ mymain(void)
while (0);
DO_TEST("pool-dir", "vol-file");
+ DO_TEST("pool-dir", "vol-file-naming");
DO_TEST("pool-dir", "vol-file-backing");
DO_TEST("pool-dir", "vol-qcow2");
DO_TEST("pool-dir", "vol-qcow2-1.1");
--
1.8.3.1
11 years, 1 month
[libvirt] [PATCH] virDomainReboot: Document that migration might be unsafe
by Michal Privoznik
https://bugzilla.redhat.com/show_bug.cgi?id=744967
If a domain is rebooting and a migrate API is called meanwhile we would
have to transfer the fakeReboot attribute to the destination in order to
prevent domain doing plain shutdown over there. We shouldn't try to do
anything clever about it other than documenting this as known
limitation.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/libvirt.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/libvirt.c b/src/libvirt.c
index ae05300..c4c6d5c 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -3434,6 +3434,11 @@ error:
* To use guest agent (VIR_DOMAIN_REBOOT_GUEST_AGENT) the domain XML
* must have <channel> configured.
*
+ * Due to a implementation limitations in some drivers (the qemu driver,
+ * for instance) it is not advised to migrate or save a guest that is
+ * rebooting as a result of this API. Migrating such guest can lead to a
+ * plain shutdown on the destination.
+ *
* Returns 0 in case of success and -1 in case of failure.
*/
int
--
1.8.4.4
11 years, 1 month
Re: [libvirt] [PATCH v3] virsh domxml-from-native to treat SCSI as the bus type for pseries by default
by Shivaprasad bhat
This is supposedly the v3 of the patch.
Jan, Cole, I have added the test case as suggested. Kindly review.
Thanks,
Shiva
On Fri, Nov 22, 2013 at 1:36 AM, Shivaprasad G Bhat <
sbhat(a)linux.vnet.ibm.com> wrote:
> From: Shivaprasad G Bhat <shivaprasadbhat(a)gmail.com>
>
> The bus type IDE being enum Zero, the bus type on pseries system appears
> as IDE for all the -hda/-cdrom and for disk drives with if="none" type.
> Pseries platform needs this to appear as SCSI instead of IDE. The ide being
> not supported, the explicit requests for ide devices will return an error.
>
> Signed-off-by: Shivaprasad G Bhat <sbhat(a)linux.vnet.ibm.com>
> ---
> src/qemu/qemu_command.c | 66
> +++++++++++++++++++-
> tests/qemuargv2xmltest.c | 1
> .../qemuxml2argv-pseries-disk.args | 5 ++
> .../qemuxml2argvdata/qemuxml2argv-pseries-disk.xml | 40 ++++++++++++
> 4 files changed, 108 insertions(+), 4 deletions(-)
> create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-disk.args
> create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-disk.xml
>
> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> index 8dc7e43..21b5108 100644
> --- a/src/qemu/qemu_command.c
> +++ b/src/qemu/qemu_command.c
> @@ -10032,6 +10032,7 @@ error:
> static virDomainDiskDefPtr
> qemuParseCommandLineDisk(virDomainXMLOptionPtr xmlopt,
> const char *val,
> + virDomainDefPtr dom,
> int nvirtiodisk,
> bool old_style_ceph_args)
> {
> @@ -10055,7 +10056,11 @@ qemuParseCommandLineDisk(virDomainXMLOptionPtr
> xmlopt,
> if (VIR_ALLOC(def) < 0)
> goto cleanup;
>
> - def->bus = VIR_DOMAIN_DISK_BUS_IDE;
> + if (((dom->os.arch == VIR_ARCH_PPC64) &&
> + dom->os.machine && STREQ(dom->os.machine, "pseries")))
> + def->bus = VIR_DOMAIN_DISK_BUS_SCSI;
> + else
> + def->bus = VIR_DOMAIN_DISK_BUS_IDE;
> def->device = VIR_DOMAIN_DISK_DEVICE_DISK;
> def->type = VIR_DOMAIN_DISK_TYPE_FILE;
>
> @@ -10140,9 +10145,15 @@ qemuParseCommandLineDisk(virDomainXMLOptionPtr
> xmlopt,
> def->type = VIR_DOMAIN_DISK_TYPE_FILE;
> }
> } else if (STREQ(keywords[i], "if")) {
> - if (STREQ(values[i], "ide"))
> + if (STREQ(values[i], "ide")) {
> def->bus = VIR_DOMAIN_DISK_BUS_IDE;
> - else if (STREQ(values[i], "scsi"))
> + if (((dom->os.arch == VIR_ARCH_PPC64) &&
> + dom->os.machine && STREQ(dom->os.machine,
> "pseries"))) {
> + virReportError(VIR_ERR_INTERNAL_ERROR,
> + _("pseries systems do not support ide
> devices '%s'"), val);
> + goto error;
> + }
> + } else if (STREQ(values[i], "scsi"))
> def->bus = VIR_DOMAIN_DISK_BUS_SCSI;
> else if (STREQ(values[i], "virtio"))
> def->bus = VIR_DOMAIN_DISK_BUS_VIRTIO;
> @@ -11368,6 +11379,9 @@ qemuParseCommandLine(virCapsPtr qemuCaps,
> disk->type = VIR_DOMAIN_DISK_TYPE_FILE;
> if (STREQ(arg, "-cdrom")) {
> disk->device = VIR_DOMAIN_DISK_DEVICE_CDROM;
> + if (((def->os.arch == VIR_ARCH_PPC64) &&
> + def->os.machine && STREQ(def->os.machine, "pseries")))
> + disk->bus = VIR_DOMAIN_DISK_BUS_SCSI;
> if (VIR_STRDUP(disk->dst, "hdc") < 0)
> goto error;
> disk->readonly = true;
> @@ -11381,6 +11395,9 @@ qemuParseCommandLine(virCapsPtr qemuCaps,
> disk->bus = VIR_DOMAIN_DISK_BUS_IDE;
> else
> disk->bus = VIR_DOMAIN_DISK_BUS_SCSI;
> + if (((def->os.arch == VIR_ARCH_PPC64) &&
> + def->os.machine && STREQ(def->os.machine,
> "pseries")))
> + disk->bus = VIR_DOMAIN_DISK_BUS_SCSI;
> }
> if (VIR_STRDUP(disk->dst, arg + 1) < 0)
> goto error;
> @@ -11672,7 +11689,7 @@ qemuParseCommandLine(virCapsPtr qemuCaps,
> }
> } else if (STREQ(arg, "-drive")) {
> WANT_VALUE();
> - if (!(disk = qemuParseCommandLineDisk(xmlopt, val,
> + if (!(disk = qemuParseCommandLineDisk(xmlopt, val, def,
> nvirtiodisk,
> ceph_args != NULL)))
> goto error;
> @@ -11858,6 +11875,47 @@ qemuParseCommandLine(virCapsPtr qemuCaps,
> }
> } else if (STREQ(arg, "-S")) {
> /* ignore, always added by libvirt */
> + } else if (STREQ(arg, "-device")) {
> + /* something we can't fully parse. Check if supported and
> + * add it to the qemu namespace
> + * cmdline/environment advanced options and hope for the best
> + */
> + bool unsupported = false;
> + WANT_VALUE()
> +
> + if ((def->os.arch == VIR_ARCH_PPC64) &&
> + def->os.machine && STREQ(def->os.machine, "pseries")) {
> + int nkws;
> + char **kws;
> + char **vals;
> + size_t j;
> +
> + if (!qemuParseKeywords(val, &kws, &vals, &nkws, 1)) {
> + for (j = 0; j < nkws; j++) {
> + if (STREQLEN(kws[j], "ide", 3) ||
> + (STREQ(kws[j], "if") && vals[j] &&
> + STREQ(vals[j], "ide"))) {
> + virReportError(VIR_ERR_INTERNAL_ERROR,
> + _("pseries systems do not
> support ide devices '%s'"), val);
> + unsupported = true;
> + break;
> + }
> + }
> + for (j = 0; j < nkws; j++) {
> + VIR_FREE(kws[j]);
> + VIR_FREE(vals[j]);
> + }
> + VIR_FREE(kws);
> + VIR_FREE(vals);
> + }
> + }
> +
> + if (unsupported || VIR_REALLOC_N(cmd->args, cmd->num_args+2)
> < 0)
> + goto error;
> + if (VIR_STRDUP(cmd->args[cmd->num_args++], arg) < 0)
> + goto error;
> + if (VIR_STRDUP(cmd->args[cmd->num_args++], val) < 0)
> + goto error;
> } else {
> /* something we can't yet parse. Add it to the qemu namespace
> * cmdline/environment advanced options and hope for the best
> diff --git a/tests/qemuargv2xmltest.c b/tests/qemuargv2xmltest.c
> index 6dd8bb0..0bf4c37 100644
> --- a/tests/qemuargv2xmltest.c
> +++ b/tests/qemuargv2xmltest.c
> @@ -249,6 +249,7 @@ mymain(void)
> DO_TEST("hyperv");
>
> DO_TEST("pseries-nvram");
> + DO_TEST("pseries-disk");
>
> DO_TEST("nosharepages");
>
> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-disk.args
> b/tests/qemuxml2argvdata/qemuxml2argv-pseries-disk.args
> new file mode 100644
> index 0000000..5fc0938
> --- /dev/null
> +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-disk.args
> @@ -0,0 +1,5 @@
> +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test
> QEMU_AUDIO_DRV=none \
> +/usr/bin/qemu-system-ppc64 \
> +-S -M pseries -m 512 -smp 1 \
> +-no-acpi -boot c -usb \
> +-boot c -hda /dev/HostVG/QEMUGuest1 -cdrom /root/boot.iso
> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-disk.xml
> b/tests/qemuxml2argvdata/qemuxml2argv-pseries-disk.xml
> new file mode 100644
> index 0000000..dbbd6aa
> --- /dev/null
> +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-disk.xml
> @@ -0,0 +1,40 @@
> +<domain type='qemu'>
> + <name>QEMUGuest1</name>
> + <uuid>87eedafe-eedc-4336-8130-ed9fe5dc90c8</uuid>
> + <memory unit='KiB'>524288</memory>
> + <currentMemory unit='KiB'>524288</currentMemory>
> + <vcpu placement='static'>1</vcpu>
> + <os>
> + <type arch='ppc64' machine='pseries'>hvm</type>
> + <boot dev='hd'/>
> + </os>
> + <clock offset='utc'/>
> + <on_poweroff>destroy</on_poweroff>
> + <on_reboot>restart</on_reboot>
> + <on_crash>destroy</on_crash>
> + <devices>
> + <emulator>/usr/bin/qemu-system-ppc64</emulator>
> + <disk type='block' device='disk'>
> + <driver name='qemu' type='raw'/>
> + <source dev='/dev/HostVG/QEMUGuest1'/>
> + <target dev='hda' bus='scsi'/>
> + <address type='drive' controller='0' bus='0' target='0' unit='0'/>
> + </disk>
> + <disk type='file' device='cdrom'>
> + <driver name='qemu' type='raw'/>
> + <source file='/root/boot.iso'/>
> + <target dev='hdc' bus='scsi'/>
> + <readonly/>
> + <address type='drive' controller='0' bus='0' target='0' unit='2'/>
> + </disk>
> + <controller type='usb' index='0'/>
> + <controller type='scsi' index='0'/>
> + <controller type='pci' index='0' model='pci-root'/>
> + <input type='mouse' bus='ps2'/>
> + <graphics type='sdl'/>
> + <video>
> + <model type='cirrus' vram='9216' heads='1'/>
> + </video>
> + <memballoon model='virtio'/>
> + </devices>
> +</domain>
>
> --
> libvir-list mailing list
> libvir-list(a)redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list
>
11 years, 1 month
[libvirt] [libvirt-python PATCHv2 00/44] Split Python bindings into its own repo
by Doug Goldstein
This patch series is a follow up to:
https://www.redhat.com/archives/libvir-list/2013-November/msg00416.html
https://www.redhat.com/archives/libvir-list/2013-November/msg00620.html
It includes all of Dan's patches and builds on his work and incorporates
all reviews from Eric.
The goal is to split the Python bindings out into their own git repo.
These patches do not apply to current libvirt.git. You must follow
Dan's steps for creating the new repo and initialize it based on
the history of the current python/ subdirectory.
Assuming your current checkout of libvirt is in a directory 'libvirt',
then
$ git clone libvirt libvirt-python
$ cd libvirt-python
$ git filter-branch --subdirectory-filter python --tag-name-filter cat -- --all
$ git for-each-ref --format="%(refname)" refs/original/ | xargs -n 1 git update-ref -d
$ git reflog expire --expire=now --all
$ git gc --prune=now
You should now have a repo that's a couple of MB in size, showing only the
files from python/ dir, in the root.
The tags have been re-written to show content from the python/ directory.
All the GPG signatures from tags are removed, since they are invalid
after rewriting history. This was previously agreed to be the right
way to handle this.
The build system uses python distutils instead of autoconf/automake.
It still uses the code generator as before though, pulling the XML
files from /usr/share/libvirt/api (or whever you installed libvirt,
as indicated by pkg-config).
created a simple autobuild.sh to do an end-to-end build, including
the RPM generation. Or you can just do
python setup.py build ('make' equiv)
python setup.py test ('make check' equiv)
python setup.py rpm ('make rpm' equiv)
python setup.py clean ('make clean' equiv)
Historically libvirt python only worked with the exact matching libvirt
binary. Before releasing this, I think we need to make it possible to
compile libvirt-python against any recent-ish libvirt version.
This shouldn't actually be too hard - the generator will take care of
most of it. All we need do is fix up the -override.c files to make
use of version checks to hide APIs not present in older libvirt.
The RPM is designed to be drop in compatible/identical to/with the
existing libvirt-python RPM, so users should notice no difference
in any way when upgrading.
If you don't want to try the filter-branch steps yourself, you can
clone this complete series + repo from:
git clone https://github.com/cardoe/libvirt-python.git
Notice how the history is intact right back to the first commit of the
python bindings.
NOTE: We need to pull in the following directories and this does not do
that.
* examples/python
* examples/domain-events/events-python
Daniel P. Berrange (14):
Remove obsolete Makefile.am
Update generator for new code layout
Update header file includes
Import STREQ macro from libvirt
Add decl of MIN macro
Import gnulib's xalloc_oversized macro
Import gnulib's ignore_value macro
Import code annotation macros from libvirt
Import VIR_ALLOC / VIR_ALLOC_N / VIR_REALLOC_N functions
Remove use of virStrcpyStatic
Import VIR_FORCE_CLOSE macro from libvirt
Add build/ to python module path for sanitytest.py
Add execute permission for sanitytest.py
Setup distutils build system
Doug Goldstein (30):
Import LIBVIR_CHECK_VERSION macro from libvirt
Import some virTypedParams* APIs from libvirt
Add missing attributes to setup.py
Break generator.py to be called per module
Create array of modules to be built
Don't build LXC module when building less than 1.0.2
virDomainSnapshotListChildrenNames API appeared in 0.9.7
virDomain{Get,Set}BlockIoTune APIs appeared in 0.9.8
virDomain{Get,Set}InterfaceParameters APIs appeared in 0.9.9
virDomain{Get,Set}NumaParameters APIs appeared in 0.9.9
virDomainGetCPUStats API appeared in 0.9.10
virDomainGetDiskErrors API appeared in 0.9.10
virDomainListAllSnapshots API appeared in 0.9.13
virConnectListAllDomains API appeared in 0.9.13
virDomainSnapshotListAllChildren API appeared in 0.9.13
virConnect{Unr,R}egisterCloseCallback API appeared in 0.10.0
virDomainPinEmulator and virDomainGetEmulatorPinInfo APIs appeared in
0.10.0
virConnectListAll* APIs appeared in 0.10.2
virNode{Get,Set}MemoryParameters API appeared in 0.10.2
virStoragePoolListAllVolumes API appeared in 0.10.2
VIR_DOMAIN_EVENT_ID_PMSUSPEND_DISK appeared in 1.0.0
virNodeGetCPUMap API appeared in 1.0.0
virTypedParams* API appeared in 1.0.2
virDomainGetJobStats API appeared in 1.0.3
virDomainMigrateGetCompressionCache API appeared in 1.0.3
virDomainMigrate3 and virDomainMigrateToURI3 appeared in 1.1.0
virDomainCreateXMLWithFiles and virDomainCreateWithFiles APIs appeared
in 1.1.1
VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED appeared in 1.1.1
virConnectGetCPUModelNames API appeared in 1.1.3
Simplify out of memory error case
.gitignore | 4 +
AUTHORS.in | 12 ++
COPYING | 339 ++++++++++++++++++++++++++++++++
COPYING.LESSER | 502 ++++++++++++++++++++++++++++++++++++++++++++++++
MANIFEST.in | 27 +++
Makefile.am | 173 -----------------
NEWS | 9 +
autobuild.sh | 24 +++
generator.py | 79 +++-----
libvirt-lxc-override.c | 9 +-
libvirt-override.c | 240 ++++++++++++++++-------
libvirt-python.spec.in | 34 ++++
libvirt-qemu-override.c | 8 +-
libvirt-utils.c | 181 +++++++++++++++++
libvirt-utils.h | 209 ++++++++++++++++++++
sanitytest.py | 4 +
setup.py | 291 ++++++++++++++++++++++++++++
typewrappers.c | 5 +-
18 files changed, 1846 insertions(+), 304 deletions(-)
create mode 100644 .gitignore
create mode 100644 AUTHORS.in
create mode 100644 COPYING
create mode 100644 COPYING.LESSER
create mode 100644 MANIFEST.in
delete mode 100644 Makefile.am
create mode 100644 NEWS
create mode 100755 autobuild.sh
create mode 100644 libvirt-python.spec.in
create mode 100644 libvirt-utils.c
create mode 100644 libvirt-utils.h
mode change 100644 => 100755 sanitytest.py
create mode 100644 setup.py
--
1.8.3.2
11 years, 1 month
[libvirt] [PATCH] qemuMigrationIsAllowed: Forbid migration of rebooting domain
by Michal Privoznik
https://bugzilla.redhat.com/show_bug.cgi?id=744967
If a domain is rebooting and a migrate API is called meanwhile we would
have to transfer the fakeReboot attribute to the destination in order to
prevent domain doing plain shutdown over there. What about forbidding
this silly corner case instead? Same goes for saving a domain to a file.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_migration.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index e87ea85..6dffbb1 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -1399,6 +1399,14 @@ qemuMigrationIsAllowed(virQEMUDriverPtr driver, virDomainObjPtr vm,
size_t i;
if (vm) {
+ qemuDomainObjPrivatePtr priv = vm->privateData;
+
+ if (priv->fakeReboot) {
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("domain is rebooting"));
+ return false;
+ }
+
if (qemuProcessAutoDestroyActive(driver, vm)) {
virReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("domain is marked for auto destroy"));
--
1.8.4.4
11 years, 1 month
[libvirt] [libvirt-sandbox] GVirSandboxConfigNetwork: Fix small finalize() leak
by Christophe Fergeau
The content of the 'addrs' and 'routes' lists is freed, but the list
themselves were not g_list_free()'ed
---
libvirt-sandbox/libvirt-sandbox-config-network.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libvirt-sandbox/libvirt-sandbox-config-network.c b/libvirt-sandbox/libvirt-sandbox-config-network.c
index 555a360..eb6a569 100644
--- a/libvirt-sandbox/libvirt-sandbox-config-network.c
+++ b/libvirt-sandbox/libvirt-sandbox-config-network.c
@@ -131,7 +131,9 @@ static void gvir_sandbox_config_network_finalize(GObject *object)
g_free(priv->source);
g_free(priv->mac);
g_list_foreach(priv->addrs, (GFunc)g_object_unref, NULL);
+ g_list_free(priv->addrs);
g_list_foreach(priv->routes, (GFunc)g_object_unref, NULL);
+ g_list_free(priv->routes);
G_OBJECT_CLASS(gvir_sandbox_config_network_parent_class)->finalize(object);
}
--
1.8.4.2
11 years, 1 month