[libvirt] network down lead vm been shutdown
by yue
hi,all
the connection between remote-viewer and guest is good, now unplug Network Cable, wait several minutes, then kill virt-viewer.
now guest will be shutdwn.
---winxp.log of libvirt----------
handle_dev_display_connect: connect
handle_new_display_channel: add display channel client
handle_new_display_channel: New display (client 0x7f1cbf9f6ed0) dcc 0x7f1c584db2b0 stream 0x7f1cbfd61560
handle_new_display_channel: jpeg disabled
handle_new_display_channel: zlib-over-glz disabled
listen_to_new_client_channel: NEW ID = 0
display_channel_client_wait_for_init: creating encoder with id == 0
reds_handle_read_link_done: spice channels 3 should be encrypted
reds_handle_auth_mechanism: Auth method: 1
reds_show_new_channel: channel 3:0, connected successfully, over Secure link
inputs_connect: inputs channel client create
flush_display_commands: update timeout
red_channel_client_disconnect: 0x7f1c584db2b0 (channel 0x7f1c580458d0 type 2 id 0)
display_channel_client_on_disconnect:
validate_surface: failed on 13
validate_surface: panic !worker->surfaces[surface_id].context.canvas
2013-05-02 09:00:16.717+0000: shutting down
11 years, 6 months
[libvirt] [PATCH v2 1/1][RESEND] Add NVRAM device
by Li Zhang
From: Li Zhang <zhlcindy(a)linux.vnet.ibm.com>
For pSeries guest in QEMU, NVRAM is one kind of spapr-vio device.
Users are allowed to specify spapr-vio devices'address.
But NVRAM is not supported in libvirt. So this patch is to
add NVRAM device to allow users to specify its address.
In QEMU, NVRAM device's address is specified by
"-global spapr-nvram.reg=xxxxx".
In libvirt, XML file is defined as the following:
<nvram>
<address type='spapr-vio' reg='0x3000'/>
</nvram>
Signed-off-by: Li Zhang <zhlcindy(a)linux.vnet.ibm.com>
---
* v2 -> v1:
Add NVRAM parameters parsing in qemuParseCommandLine.
src/conf/domain_conf.c | 83 ++++++++++++++++++++++++++++++++++++++++++++++-
src/conf/domain_conf.h | 10 ++++++
src/qemu/qemu_command.c | 48 +++++++++++++++++++++++++++
src/qemu/qemu_command.h | 2 ++
4 files changed, 142 insertions(+), 1 deletion(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 10f361c..8c1e8ae 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -175,7 +175,8 @@ VIR_ENUM_IMPL(virDomainDevice, VIR_DOMAIN_DEVICE_LAST,
"redirdev",
"smartcard",
"chr",
- "memballoon")
+ "memballoon",
+ "nvram")
VIR_ENUM_IMPL(virDomainDeviceAddress, VIR_DOMAIN_DEVICE_ADDRESS_TYPE_LAST,
"none",
@@ -1442,6 +1443,16 @@ void virDomainMemballoonDefFree(virDomainMemballoonDefPtr def)
VIR_FREE(def);
}
+void virDomainNVRAMDefFree(virDomainNVRAMDefPtr def)
+{
+ if (!def)
+ return;
+
+ virDomainDeviceInfoClear(&def->info);
+
+ VIR_FREE(def);
+}
+
void virDomainWatchdogDefFree(virDomainWatchdogDefPtr def)
{
if (!def)
@@ -1602,6 +1613,7 @@ void virDomainDeviceDefFree(virDomainDeviceDefPtr def)
case VIR_DOMAIN_DEVICE_SMARTCARD:
case VIR_DOMAIN_DEVICE_CHR:
case VIR_DOMAIN_DEVICE_MEMBALLOON:
+ case VIR_DOMAIN_DEVICE_NVRAM:
case VIR_DOMAIN_DEVICE_LAST:
break;
}
@@ -1791,6 +1803,7 @@ void virDomainDefFree(virDomainDefPtr def)
virDomainWatchdogDefFree(def->watchdog);
virDomainMemballoonDefFree(def->memballoon);
+ virDomainNVRAMDefFree(def->nvram);
for (i = 0; i < def->nseclabels; i++)
virSecurityLabelDefFree(def->seclabels[i]);
@@ -2342,6 +2355,12 @@ int virDomainDeviceInfoIterate(virDomainDefPtr def,
if (cb(def, &device, &def->memballoon->info, opaque) < 0)
return -1;
}
+ if (def->nvram) {
+ device.type = VIR_DOMAIN_DEVICE_NVRAM;
+ device.data.nvram = def->nvram;
+ if (cb(def, &device, &def->nvram->info, opaque) < 0)
+ return -1;
+ }
device.type = VIR_DOMAIN_DEVICE_HUB;
for (i = 0; i < def->nhubs ; i++) {
device.data.hub = def->hubs[i];
@@ -7461,6 +7480,23 @@ error:
goto cleanup;
}
+static virDomainNVRAMDefPtr
+virDomainNVRAMDefParseXML(const xmlNodePtr node,
+ unsigned int flags)
+{
+ virDomainNVRAMDefPtr def;
+
+ if (VIR_ALLOC(def) < 0) {
+ virReportOOMError();
+ return NULL;
+ }
+
+ if ( virDomainDeviceInfoParseXML(node, NULL, &def->info, flags) < 0 )
+ return NULL;
+
+ return def;
+}
+
static virSysinfoDefPtr
virSysinfoParseXML(const xmlNodePtr node,
xmlXPathContextPtr ctxt)
@@ -10572,6 +10608,32 @@ virDomainDefParseXML(virCapsPtr caps,
}
}
+ def->nvram = NULL;
+ if ((n = virXPathNodeSet("./devices/nvram", ctxt, &nodes)) < 0) {
+ goto error;
+ }
+
+ if (n > 1) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("only a single nvram device is supported"));
+ goto error;
+ }
+
+ if (n > 0) {
+ virDomainNVRAMDefPtr nvram =
+ virDomainNVRAMDefParseXML(nodes[0], flags);
+ if (!nvram)
+ goto error;
+ def->nvram = nvram;
+ VIR_FREE(nodes);
+ } else {
+ virDomainNVRAMDefPtr nvram;
+ if (VIR_ALLOC(nvram) < 0)
+ goto no_memory;
+ nvram->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE;
+ def->nvram = nvram;
+ }
+
/* analysis of the hub devices */
if ((n = virXPathNodeSet("./devices/hub", ctxt, &nodes)) < 0) {
goto error;
@@ -13547,6 +13609,21 @@ virDomainMemballoonDefFormat(virBufferPtr buf,
}
static int
+virDomainNVRAMDefFormat(virBufferPtr buf,
+ virDomainNVRAMDefPtr def,
+ unsigned int flags)
+{
+ virBufferAsprintf(buf, " <nvram>\n");
+ if (virDomainDeviceInfoIsSet(&def->info, flags))
+ if (virDomainDeviceInfoFormat(buf, &def->info, flags) < 0)
+ return -1;
+
+ virBufferAddLit(buf, " </nvram>\n");
+
+ return 0;
+}
+
+static int
virDomainSysinfoDefFormat(virBufferPtr buf,
virSysinfoDefPtr def)
{
@@ -14787,6 +14864,9 @@ virDomainDefFormatInternal(virDomainDefPtr def,
if (def->memballoon)
virDomainMemballoonDefFormat(buf, def->memballoon, flags);
+ if (def->nvram)
+ virDomainNVRAMDefFormat(buf, def->nvram, flags);
+
virBufferAddLit(buf, " </devices>\n");
virBufferAdjustIndent(buf, 2);
@@ -16061,6 +16141,7 @@ virDomainDeviceDefCopy(virCapsPtr caps,
case VIR_DOMAIN_DEVICE_SMARTCARD:
case VIR_DOMAIN_DEVICE_CHR:
case VIR_DOMAIN_DEVICE_MEMBALLOON:
+ case VIR_DOMAIN_DEVICE_NVRAM:
case VIR_DOMAIN_DEVICE_LAST:
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Copying definition of '%d' type "
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 4ffa4aa..8e5f1d8 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -108,6 +108,9 @@ typedef virDomainChrDef *virDomainChrDefPtr;
typedef struct _virDomainMemballoonDef virDomainMemballoonDef;
typedef virDomainMemballoonDef *virDomainMemballoonDefPtr;
+typedef struct _virDomainNVRAMDef virDomainNVRAMDef;
+typedef virDomainNVRAMDef *virDomainNVRAMDefPtr;
+
typedef struct _virDomainSnapshotObj virDomainSnapshotObj;
typedef virDomainSnapshotObj *virDomainSnapshotObjPtr;
@@ -133,6 +136,7 @@ typedef enum {
VIR_DOMAIN_DEVICE_SMARTCARD,
VIR_DOMAIN_DEVICE_CHR,
VIR_DOMAIN_DEVICE_MEMBALLOON,
+ VIR_DOMAIN_DEVICE_NVRAM,
VIR_DOMAIN_DEVICE_LAST
} virDomainDeviceType;
@@ -158,6 +162,7 @@ struct _virDomainDeviceDef {
virDomainSmartcardDefPtr smartcard;
virDomainChrDefPtr chr;
virDomainMemballoonDefPtr memballoon;
+ virDomainNVRAMDefPtr nvram;
} data;
};
@@ -1418,6 +1423,9 @@ struct _virDomainMemballoonDef {
virDomainDeviceInfo info;
};
+struct _virDomainNVRAMDef {
+ virDomainDeviceInfo info;
+};
enum virDomainSmbiosMode {
VIR_DOMAIN_SMBIOS_NONE,
@@ -1849,6 +1857,7 @@ struct _virDomainDef {
/* Only 1 */
virDomainWatchdogDefPtr watchdog;
virDomainMemballoonDefPtr memballoon;
+ virDomainNVRAMDefPtr nvram;
virCPUDefPtr cpu;
virSysinfoDefPtr sysinfo;
virDomainRedirFilterDefPtr redirfilter;
@@ -1951,6 +1960,7 @@ int virDomainChrSourceDefCopy(virDomainChrSourceDefPtr src,
void virDomainSoundCodecDefFree(virDomainSoundCodecDefPtr def);
void virDomainSoundDefFree(virDomainSoundDefPtr def);
void virDomainMemballoonDefFree(virDomainMemballoonDefPtr def);
+void virDomainNVRAMDefFree(virDomainNVRAMDefPtr def);
void virDomainWatchdogDefFree(virDomainWatchdogDefPtr def);
void virDomainVideoDefFree(virDomainVideoDefPtr def);
virDomainHostdevDefPtr virDomainHostdevDefAlloc(void);
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index dee493f..30694d6 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -941,6 +941,13 @@ int qemuDomainAssignSpaprVIOAddresses(virDomainDefPtr def,
goto cleanup;
}
+ if (def->os.arch == VIR_ARCH_PPC64 &&
+ STREQ(def->os.machine, "pseries"))
+ def->nvram->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO;
+ if (qemuAssignSpaprVIOAddress(def, &def->nvram->info,
+ 0x3000ul) < 0)
+ goto cleanup;
+
/* No other devices are currently supported on spapr-vio */
ret = 0;
@@ -3406,6 +3413,17 @@ error:
return NULL;
}
+char *
+qemuBuildNVRAMDevStr(virDomainNVRAMDefPtr dev)
+{
+ virBuffer buf = VIR_BUFFER_INITIALIZER;
+ if (dev->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO &&
+ dev->info.addr.spaprvio.has_reg)
+ virBufferAsprintf(&buf, "spapr-nvram.reg=0x%llx",
+ dev->info.addr.spaprvio.reg);
+
+ return virBufferContentAndReset(&buf);
+}
char *
qemuBuildUSBInputDevStr(virDomainInputDefPtr dev,
@@ -7006,6 +7024,19 @@ qemuBuildCommandLine(virConnectPtr conn,
}
}
+ if (def->nvram &&
+ def->os.arch == VIR_ARCH_PPC64 &&
+ STREQ(def->os.machine, "pseries")) {
+ char *optstr;
+ virCommandAddArg(cmd, "-global");
+ optstr = qemuBuildNVRAMDevStr(def->nvram);
+ if (!optstr)
+ goto error;
+ if (optstr)
+ virCommandAddArg(cmd, optstr);
+ VIR_FREE(optstr);
+ }
+
if (snapshot)
virCommandAddArgList(cmd, "-loadvm", snapshot->def->name, NULL);
@@ -9139,6 +9170,23 @@ virDomainDefPtr qemuParseCommandLine(virCapsPtr qemuCaps,
goto error;
}
+ } else if (STREQ(arg, "-global") &&
+ STRPREFIX(progargv[i + 1], "spapr-nvram.reg=")) {
+
+ WANT_VALUE();
+
+ if (VIR_ALLOC(def->nvram) < 0)
+ goto no_memory;
+
+ val += strlen("spapr-nvram.reg=");
+ if (virStrToLong_ull(val, NULL, 16,
+ &def->nvram->info.addr.spaprvio.reg) < 0) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("invalid value for spapr-nvram.reg :"
+ "'%s'"), val);
+ goto error;
+ }
+
} else if (STREQ(arg, "-S")) {
/* ignore, always added by libvirt */
} else {
diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h
index e4db000..7a0fe17 100644
--- a/src/qemu/qemu_command.h
+++ b/src/qemu/qemu_command.h
@@ -118,6 +118,8 @@ char * qemuBuildWatchdogDevStr(virDomainWatchdogDefPtr dev,
char * qemuBuildMemballoonDevStr(virDomainMemballoonDefPtr dev,
virQEMUCapsPtr qemuCaps);
+char * qemuBuildNVRAMDevStr(virDomainNVRAMDefPtr dev);
+
char * qemuBuildUSBInputDevStr(virDomainInputDefPtr dev,
virQEMUCapsPtr qemuCaps);
--
1.7.10.1
11 years, 6 months
[libvirt] Build failed in Jenkins: libvirt-syntax-check #944
by Jenkins CI
See <http://honk.sigxcpu.org:8001/job/libvirt-syntax-check/944/>
------------------------------------------
Started by upstream project "libvirt-build" build number 1052
Started by upstream project "libvirt-build" build number 1053
Building in workspace <http://honk.sigxcpu.org:8001/job/libvirt-syntax-check/ws/>
[workspace] $ /bin/sh -xe /tmp/hudson6389583679823866074.sh
+ make syntax-check
GEN bracket-spacing-check
GFDL_version
0.65 GFDL_version
TAB_in_indentation
0.46 TAB_in_indentation
Wundef_boolean
0.23 Wundef_boolean
avoid_attribute_unused_in_header
0.30 avoid_attribute_unused_in_header
avoid_ctype_macros
0.71 avoid_ctype_macros
avoid_if_before_free
5.60 avoid_if_before_free
avoid_strcase
0.61 avoid_strcase
avoid_write
0.41 avoid_write
bindtextdomain
0.34 bindtextdomain
cast_of_argument_to_free
0.64 cast_of_argument_to_free
cast_of_x_alloc_return_value
0.57 cast_of_x_alloc_return_value
changelog
0.25 changelog
const_long_option
0.60 const_long_option
copyright_address
0.60 copyright_address
copyright_check
0.75 copyright_check
copyright_format
1.52 copyright_format
correct_id_types
0.72 correct_id_types
error_message_period
0.45 error_message_period
error_message_warn_fatal
0.53 error_message_warn_fatal
flags_debug
1.09 flags_debug
flags_usage
1.09 flags_usage
libvirt_unmarked_diagnostics
2.19 libvirt_unmarked_diagnostics
m4_quote_check
0.28 m4_quote_check
makefile_TAB_only_indentation
0.26 makefile_TAB_only_indentation
makefile_at_at_check
0.21 makefile_at_at_check
po_check
13.10 po_check
preprocessor_indentation
cppi: src/util/virinitctl.c: line 110: not properly indented
maint.mk: incorrect preprocessor indentation
make: *** [sc_preprocessor_indentation] Error 1
Build step 'Execute shell' marked build as failure
11 years, 6 months
[libvirt] [PATCH] virInitctlRequest: Don't hardcode 384 bytes size
by Guido Günther
When MAXHOSTNAMELEN is set we have to take it's value into account.
Otherwise the build fails on kFreeBSD (FreeBSD kernel and GNU userland)
---
src/util/virinitctl.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/util/virinitctl.c b/src/util/virinitctl.c
index 1618ffa..9a3e8a3 100644
--- a/src/util/virinitctl.c
+++ b/src/util/virinitctl.c
@@ -103,7 +103,11 @@ struct virInitctlRequest {
} i;
};
-verify(sizeof(struct virInitctlRequest) == 384);
+# ifdef MAXHOSTNAMELEN
+ verify(sizeof(struct virInitctlRequest) == 320 + MAXHOSTNAMELEN);
+# else
+ verify(sizeof(struct virInitctlRequest) == 384);
+#endif
/*
* Send a message to init to change the runlevel
--
1.7.10.4
11 years, 6 months
[libvirt] [PATCH 0/3] Fix license violation of virsh when vbox is enabled
by Eric Blake
See the big hairy analysis here:
https://www.redhat.com/archives/libvir-list/2013-May/msg00030.html
I feel comfortable enough with these patches that I'm hoping to
get them into libvirt 1.0.5, while saving the bigger task of
refactoring vbox support into libvirtd out to libvirt 1.0.6.
Eric Blake (3):
build: move readline check into its own macro
build: check for libedit
build: fall back to libedit if libvirt.so is crippled
configure.ac | 54 +++++++++++++-------------------------------
libvirt.spec.in | 8 +++++++
m4/virt-edit.m4 | 26 +++++++++++++++++++++
m4/virt-readline.m4 | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++
tools/virsh.c | 21 ++++++++++++-----
5 files changed, 131 insertions(+), 43 deletions(-)
create mode 100644 m4/virt-edit.m4
create mode 100644 m4/virt-readline.m4
--
1.8.1.4
11 years, 6 months
[libvirt] License issues
by Eric Blake
tl:dr; summary:
It was pointed out to me off-list that libvirt has a licensing issue
depending on how it is configured, present since 0.6.3 (introduction of
vbox:// URI in commit 10d16508 in April 2009), and which has caused at
least libvirt itself to risk shipping non-compliant binaries (at least
virsh in Fedora 12 and later is non-compliant, thanks to GPLv3
libreadline 6.0 since mid-2009; although RHEL 6 is immune). The
licensing issue can be avoided by configuring --without-vbox, and/or
virsh can be fixed by configuring lv_use_readline=no. Meanwhile, we
have a plan of attack that would allow future releases of libvirt to
provide vbox support to GPLv3 apps, and so that virsh is no longer
legally prevented from using GPLv3 readline.
Details:
The problem stems from the fact that various files in src/vbox (such as
vbox_XPCOMCGlue.c) have an explicit LGPLv2-only license. That means
that any binary that includes code based on these files is also
LGPLv2-only. At least Fedora distributes libvirt.so with vbox support
enabled, which means ANY application that links against such a
libvirt.so must be compatible with LGPLv2-only. But there is at least
one popular license that is definitely incompatible with LGPLv2-only:
GPLv3. This means that it is impossible to use Fedora's libvirt.so in a
GPLv3 (or GPLv3+) binary, even if that binary will not be directly using
vbox:// URIs. (Note that RHEL 6 ships without vbox:// URI support, and
therefore its libvirt.so is not poisoned.)
Meanwhile, the libvirt package itself usually ships a binary that wants
to use GPLv3 code. virsh defaults to compiling against libreadline if
it is present (you can avoid it with the undocumented './configure
lv_use_readline=no', but to date we have never added a
--without-readline configure switch). Prior to 2009, libreadline 5.x
was GPLv2+; but in 2009, with the release of readline 6.0, it's license
was changed to GPLv3+. Therefore, ever since Fedora 12, virsh has been
in license violation - it links against two incompatible libraries
(libvirt.so with vbox support is LGPLv2-only, and libreadline 6.0 is
GPLv3+).
With regards to libreadline, we have a couple of sneaky backdoors: The
first is a liberal interpretation of the GPLv2 exception that allows you
to use standard system libraries regardless of their licensing - if you
can succesfully argue that libreadline is a system library (on the same
par as libc) then even though it is GPLv3, using it in a GPLv2 project
under the system library clause does not constitute a license violation.
I'm not a lawyer, but trying to use this exception feels sleazy; and
while it may hold up to scrutiny on GNU/Linux (where libreadline really
is present on all installs thanks to bash), it's harder to argue that it
will work on all other systems (BSD systems come to mind, which try hard
to provide the option of getting a running system without the need for
installing GPLv3 libraries).
The second backdoor is the existence of libedit, a BSD-licensed library
that provides the same API as (at least some versions of) libreadline.
If virsh is not using any libreadline features beyond what libedit
provides, we could link virsh against libedit instead of libreadline, at
which point virsh would no longer be using GPLv3 code, and can be
distributed under GPLv2-only as needed according to whether libvirt.so
is poisoned to be LGPLv2-only. I'm hoping to patch configure.ac to
probe for libedit, and if present, to prefer that over libreadline if
vbox is enabled. We'd also want to add a configure --with-readline=...
to give the user a documented way to choose which backend they want for
interactive virsh (libedit, libreadline, or none) rather than forcing
the decision via undocumented cache variables.
The /usr/libexec/libvirt_parthelper binary is another potential binary
that needs auditing. It exists because we need to interact with
libparted, but that library is GPLv3, and thus cannot be linked into
libvirt.so proper. By creating a separate application, our goal was to
have libvirt_parthelper be a GPLv3 app (thanks to parted) but reuse
libvirt code (exercising the "or later" clause of all libvirt LGPLv2+
code used in that binary). At the moment, ldd says that
libvirt_parthelper is not linked against libvirt.so (but rather just
statically includes other libvirt files such as "virutil.h"), so we can
argue that this binary is immune to the problem with vbox code.
Note that libvirt's intent has always been to ship LGPLv2+ code,
precisely because we want libvirt to be usable in both GPLv2 and GPLv3
projects (anyone wanting to use an LGPLv2+ library in a GPLv3 project
merely exercises their "or later" rights of LGPLv2+ to use that library
under LGPLv3). But since we are currently falling short of that goal,
we need to make a change.
Unfortunately, the copyright holder (Sun) that exerted the restrictive
LGPLv2-only license no longer exists, and it is not obvious whether
their successor Oracle is legally able to relax the license. Even if
they are, there is then the question of whether Oracle would choose to
relax the license, and how much time it would take to pursue the legal
paperwork to get a license change authorized.
But we have another possibility, by using what we have already done with
the libvirt_parthelper as our guide. That is, as long as we can isolate
poisoned licenses out of libvirt.so, and ensure that they are only
compiled into standalone binaries, those standalone binaries can have a
more restrictive license. We can go in either direction so long each
individual binary never mixes both GPLv3 and LGPLv2-only code.
Obviously, libvirt_parthelper chose to restrict things to GPLv3, but so
far, the libvirtd executable has not been poisoned in either direction.
Furthermore, since we have already gone to the efforts of creating a
libvirt_parthelper to keep GPLv3 code out of libvirtd, it seems
reasonable to assume that we can create other helper apps for any future
tasks that libvirtd may want to perform that require GPLv3 code.
Therefore, I propose that we poison libvirtd into being [L]GPLv2-only,
by linking the vbox support into libvirtd instead of in libvirt.so.
Implementation wise, this would mean that we compile the vbox driver as
an independent module (much the same as we do for qemu or lxc), and link
that module into libvirtd rather than into libvirt.so directly. In
libvirt.so, attempts to use a vbox:// URI would then be forwarded over
RPC to libvirtd, instead of directly using vbox code. vbox would then
be a remote instead of a local protocol. Since existing vbox://
connections are local, vbox users have not previously had to ensure that
the system libvirtd daemon is running. Therefore, I suspect that it
would be nicer to reuse the qemu://session code that auto-spawns a
session libvirtd, so that from the user standpoint, they can continue to
connect to vbox without having to have a libvirtd system daemon running.
The initial connection time will take slightly longer as a session
libvirtd is autospawned, but that should not be too much impact.
Qemu has announced that they are delaying their release of 1.5 in part
because of a license problem [1]. I'm wondering if we need to follow
qemu's lead and possibly delay the release of libvirt 1.0.5 if we don't
have a fix in time (at any rate, I'm certainly trying to tackle both
proposed solutions in the near future, starting with the libedit idea
first). On the other hand, the issue has been around for 4 years, so we
could argue that releasing 1.0.5 with the same problem is no worse than
what we have done in the past, and that we can wait to fix it until
1.0.6. If we do go with the delay for libvirt.so, users still have the
option of configuring --without-vbox to get a libvirt.so that is not
poisoned to be LGPLv2-only. And hopefully the libedit work is simple
enough that at least virsh can be fixed for 1.0.5, even if libvirt.so is
not fixed until 1.0.6.
[1]
qemu license issue first identified:
https://lists.gnu.org/archive/html/qemu-devel/2013-04/msg02096.html
Efforts to fix it:
https://lists.gnu.org/archive/html/qemu-devel/2013-04/msg05807.html
qemu release delay, in part because of license issue:
https://lists.gnu.org/archive/html/qemu-devel/2013-04/msg06042.html
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
11 years, 6 months
[libvirt] [PATCH] pci: autolearn name of stub driver, remove from arglist
by Laine Stump
virPCIDeviceReattach and virPCIDeviceUnbindFromStub (called by
virPCIDeviceReattach) had previously required the name of the stub
driver as input. This is unnecessary, because the name of the driver
the device is currently bound to can be found by looking at the link:
/sys/bus/pci/dddd:bb:ss.ff/driver
Instead of requiring that the name of the expected stub driver name
and only unbinding if that one name is matched, we no longer take a
driver name in the arglist for either of these
functions. virPCIDeviceUnbindFromStub just compares the name of the
currently bound driver to a list of "well known" stubs (right now
contains "pci-stub" and "vfio-pci" for qemu, and "pciback" for xen),
and only performs the unbind if it's one of those devices.
This allows virsh nodedevice-reattach to work properly across a
libvirtd restart, and fixes a couple of cases where we were
erroneously still hard-coding "pci-stub" as the drive name.
For some unknown reason, virPCIDeviceReattach had been calling
modprobe on the stub driver prior to unbinding the device. This was
problematic because we no longer know the name of the stub driver in
that function. However, it is pointless to probe for the stub driver
at that time anyway - because the device is bound to the stub driver,
we are guaranteed that it is already loaded, and so that call to
modprobe has been removed.
---
src/qemu/qemu_driver.c | 2 +-
src/qemu/qemu_hostdev.c | 4 +--
src/util/virpci.c | 66 ++++++++++++++++++++++++++++++++++---------------
src/util/virpci.h | 3 +--
src/xen/xen_driver.c | 2 +-
5 files changed, 51 insertions(+), 26 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 296efe3..9492850 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -9832,7 +9832,7 @@ qemuNodeDeviceReAttach(virNodeDevicePtr dev)
virPCIDeviceReattachInit(pci);
if (virPCIDeviceReattach(pci, driver->activePciHostdevs,
- driver->inactivePciHostdevs, "pci-stub") < 0)
+ driver->inactivePciHostdevs) < 0)
goto out;
ret = 0;
diff --git a/src/qemu/qemu_hostdev.c b/src/qemu/qemu_hostdev.c
index 4d1f39d..e4af036 100644
--- a/src/qemu/qemu_hostdev.c
+++ b/src/qemu/qemu_hostdev.c
@@ -609,7 +609,7 @@ reattachdevs:
/* NB: This doesn't actually re-bind to original driver, just
* unbinds from the stub driver
*/
- virPCIDeviceReattach(dev, driver->activePciHostdevs, NULL, NULL);
+ virPCIDeviceReattach(dev, driver->activePciHostdevs, NULL);
}
cleanup:
@@ -869,7 +869,7 @@ void qemuReattachPciDevice(virPCIDevicePtr dev, virQEMUDriverPtr driver)
}
if (virPCIDeviceReattach(dev, driver->activePciHostdevs,
- driver->inactivePciHostdevs, "pci-stub") < 0) {
+ driver->inactivePciHostdevs) < 0) {
virErrorPtr err = virGetLastError();
VIR_ERROR(_("Failed to re-attach PCI device: %s"),
err ? err->message : _("unknown error"));
diff --git a/src/util/virpci.c b/src/util/virpci.c
index 97bba74..8d0dec8 100644
--- a/src/util/virpci.c
+++ b/src/util/virpci.c
@@ -909,25 +909,61 @@ recheck:
return -1;
}
+static const char *virPCIKnownStubs[] = {
+ "pciback", /* used by xen */
+ "pci-stub", /* used by kvm legacy passthrough */
+ "vfio-pci", /* used by VFIO device assignment */
+ NULL
+};
+
static int
-virPCIDeviceUnbindFromStub(virPCIDevicePtr dev, const char *driver)
+virPCIDeviceUnbindFromStub(virPCIDevicePtr dev)
{
int result = -1;
char *drvdir = NULL;
char *path = NULL;
+ char *driver = NULL;
+ const char **stubTest;
+ bool isStub = false;
- if (virPCIDriverDir(&drvdir, driver) < 0)
+ /* If the device is currently bound to one of the "well known"
+ * stub drivers, then unbind it, otherwise ignore it.
+ */
+ if (virPCIFile(&path, dev->name, "driver") < 0)
+ goto cleanup;
+ /* path = "/sys/bus/pci/dddd:bb:ss.ff/driver" */
+ if (virFileIsLink(path) != 1) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Invalid device %s driver file %s is not a symlink"),
+ dev->name, path);
+ goto cleanup;
+ }
+ if (virFileResolveLink(path, &drvdir) < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unable to resolve device %s driver symlink %s"),
+ dev->name, path);
goto cleanup;
+ }
+ /* drvdir = "/sys/bus/pci/drivers/${drivername} */
if (!dev->unbind_from_stub)
goto remove_slot;
- /* If the device is bound to stub, unbind it.
- */
- if (virPCIFile(&path, dev->name, "driver") < 0)
- goto cleanup;
+ /* If the device isn't bound to a known stub, skip the unbind. */
+ if (!(driver = strdup(last_component(drvdir))))
+ goto remove_slot;
- if (virFileExists(drvdir) && virFileLinkPointsTo(path, drvdir)) {
+ for (stubTest = virPCIKnownStubs; *stubTest != NULL; stubTest++) {
+ if (STREQ(driver, *stubTest)) {
+ isStub = true;
+ VIR_DEBUG("Found stub driver %s", *stubTest);
+ break;
+ }
+ }
+ if (!isStub)
+ goto remove_slot;
+
+ if (virFileExists(drvdir)) {
if (virPCIDriverFile(&path, driver, "unbind") < 0) {
goto cleanup;
}
@@ -1141,7 +1177,7 @@ cleanup:
VIR_FREE(path);
if (result < 0) {
- virPCIDeviceUnbindFromStub(dev, driver);
+ virPCIDeviceUnbindFromStub(dev);
}
return result;
@@ -1183,25 +1219,15 @@ virPCIDeviceDetach(virPCIDevicePtr dev,
int
virPCIDeviceReattach(virPCIDevicePtr dev,
virPCIDeviceListPtr activeDevs,
- virPCIDeviceListPtr inactiveDevs,
- const char *driver)
+ virPCIDeviceListPtr inactiveDevs)
{
- if (!driver && dev->stubDriver)
- driver = dev->stubDriver;
-
- if (virPCIProbeStubDriver(driver) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Failed to load PCI stub module %s"), driver);
- return -1;
- }
-
if (activeDevs && virPCIDeviceListFind(activeDevs, dev)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Not reattaching active device %s"), dev->name);
return -1;
}
- if (virPCIDeviceUnbindFromStub(dev, driver) < 0)
+ if (virPCIDeviceUnbindFromStub(dev) < 0)
return -1;
/* Steal the dev from list inactiveDevs */
diff --git a/src/util/virpci.h b/src/util/virpci.h
index 3911b72..7bcadb4 100644
--- a/src/util/virpci.h
+++ b/src/util/virpci.h
@@ -54,8 +54,7 @@ int virPCIDeviceDetach(virPCIDevicePtr dev,
const char *driver);
int virPCIDeviceReattach(virPCIDevicePtr dev,
virPCIDeviceListPtr activeDevs,
- virPCIDeviceListPtr inactiveDevs,
- const char *driver);
+ virPCIDeviceListPtr inactiveDevs);
int virPCIDeviceReset(virPCIDevicePtr dev,
virPCIDeviceListPtr activeDevs,
virPCIDeviceListPtr inactiveDevs);
diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c
index 8971d4c..0642edb 100644
--- a/src/xen/xen_driver.c
+++ b/src/xen/xen_driver.c
@@ -2254,7 +2254,7 @@ xenUnifiedNodeDeviceReAttach(virNodeDevicePtr dev)
goto out;
}
- if (virPCIDeviceReattach(pci, NULL, NULL, "pciback") < 0)
+ if (virPCIDeviceReattach(pci, NULL, NULL) < 0)
goto out;
ret = 0;
--
1.7.11.7
11 years, 6 months
[libvirt] [libvirt-glib] Rename misnamed 'conn' variable everywhere
by Christophe Fergeau
Through copy and paste from libvirt-gobject-connection.c, we end
up with an instance variable named 'conn' in most of our classes
even if we are not manipulating a connection object. This commit
renames it all 'conn' occurrences in libvirt-gobject and
libvirt-gconfig with a name more consistent with the type of the
variable named 'conn'.
---
.../libvirt-gconfig-domain-interface-bridge.c | 6 ++---
.../libvirt-gconfig-domain-interface-network.c | 6 ++---
.../libvirt-gconfig-domain-interface-user.c | 6 ++---
libvirt-gconfig/libvirt-gconfig-domain-snapshot.c | 6 ++---
libvirt-gconfig/libvirt-gconfig-domain.c | 6 ++---
libvirt-gconfig/libvirt-gconfig-interface.c | 6 ++---
libvirt-gconfig/libvirt-gconfig-network-filter.c | 6 ++---
libvirt-gconfig/libvirt-gconfig-network.c | 6 ++---
libvirt-gconfig/libvirt-gconfig-node-device.c | 6 ++---
libvirt-gconfig/libvirt-gconfig-object.c | 12 +++++-----
libvirt-gconfig/libvirt-gconfig-secret.c | 6 ++---
libvirt-gconfig/libvirt-gconfig-storage-pool.c | 6 ++---
libvirt-gconfig/libvirt-gconfig-storage-vol.c | 6 ++---
libvirt-gobject/libvirt-gobject-domain-snapshot.c | 20 ++++++++---------
libvirt-gobject/libvirt-gobject-domain.c | 26 +++++++++++-----------
libvirt-gobject/libvirt-gobject-interface.c | 20 ++++++++---------
libvirt-gobject/libvirt-gobject-manager.c | 6 ++---
libvirt-gobject/libvirt-gobject-network-filter.c | 6 ++---
libvirt-gobject/libvirt-gobject-network.c | 20 ++++++++---------
libvirt-gobject/libvirt-gobject-node-device.c | 20 ++++++++---------
libvirt-gobject/libvirt-gobject-secret.c | 24 ++++++++++----------
libvirt-gobject/libvirt-gobject-storage-pool.c | 4 ++--
libvirt-gobject/libvirt-gobject-storage-vol.c | 20 ++++++++---------
23 files changed, 125 insertions(+), 125 deletions(-)
diff --git a/libvirt-gconfig/libvirt-gconfig-domain-interface-bridge.c b/libvirt-gconfig/libvirt-gconfig-domain-interface-bridge.c
index fc2f359..c942200 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain-interface-bridge.c
+++ b/libvirt-gconfig/libvirt-gconfig-domain-interface-bridge.c
@@ -45,11 +45,11 @@ static void gvir_config_domain_interface_bridge_class_init(GVirConfigDomainInter
}
-static void gvir_config_domain_interface_bridge_init(GVirConfigDomainInterfaceBridge *conn)
+static void gvir_config_domain_interface_bridge_init(GVirConfigDomainInterfaceBridge *bridge)
{
- g_debug("Init GVirConfigDomainInterfaceBridge=%p", conn);
+ g_debug("Init GVirConfigDomainInterfaceBridge=%p", bridge);
- conn->priv = GVIR_CONFIG_DOMAIN_INTERFACE_BRIDGE_GET_PRIVATE(conn);
+ bridge->priv = GVIR_CONFIG_DOMAIN_INTERFACE_BRIDGE_GET_PRIVATE(bridge);
}
diff --git a/libvirt-gconfig/libvirt-gconfig-domain-interface-network.c b/libvirt-gconfig/libvirt-gconfig-domain-interface-network.c
index a5f6270..8c0c920 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain-interface-network.c
+++ b/libvirt-gconfig/libvirt-gconfig-domain-interface-network.c
@@ -44,11 +44,11 @@ static void gvir_config_domain_interface_network_class_init(GVirConfigDomainInte
}
-static void gvir_config_domain_interface_network_init(GVirConfigDomainInterfaceNetwork *conn)
+static void gvir_config_domain_interface_network_init(GVirConfigDomainInterfaceNetwork *iface)
{
- g_debug("Init GVirConfigDomainInterfaceNetwork=%p", conn);
+ g_debug("Init GVirConfigDomainInterfaceNetwork=%p", iface);
- conn->priv = GVIR_CONFIG_DOMAIN_INTERFACE_NETWORK_GET_PRIVATE(conn);
+ iface->priv = GVIR_CONFIG_DOMAIN_INTERFACE_NETWORK_GET_PRIVATE(iface);
}
diff --git a/libvirt-gconfig/libvirt-gconfig-domain-interface-user.c b/libvirt-gconfig/libvirt-gconfig-domain-interface-user.c
index a2b7219..2f844dd 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain-interface-user.c
+++ b/libvirt-gconfig/libvirt-gconfig-domain-interface-user.c
@@ -44,11 +44,11 @@ static void gvir_config_domain_interface_user_class_init(GVirConfigDomainInterfa
}
-static void gvir_config_domain_interface_user_init(GVirConfigDomainInterfaceUser *conn)
+static void gvir_config_domain_interface_user_init(GVirConfigDomainInterfaceUser *iface)
{
- g_debug("Init GVirConfigDomainInterfaceUser=%p", conn);
+ g_debug("Init GVirConfigDomainInterfaceUser=%p", iface);
- conn->priv = GVIR_CONFIG_DOMAIN_INTERFACE_USER_GET_PRIVATE(conn);
+ iface->priv = GVIR_CONFIG_DOMAIN_INTERFACE_USER_GET_PRIVATE(iface);
}
diff --git a/libvirt-gconfig/libvirt-gconfig-domain-snapshot.c b/libvirt-gconfig/libvirt-gconfig-domain-snapshot.c
index c46a23a..3d967f1 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain-snapshot.c
+++ b/libvirt-gconfig/libvirt-gconfig-domain-snapshot.c
@@ -42,11 +42,11 @@ static void gvir_config_domain_snapshot_class_init(GVirConfigDomainSnapshotClass
}
-static void gvir_config_domain_snapshot_init(GVirConfigDomainSnapshot *conn)
+static void gvir_config_domain_snapshot_init(GVirConfigDomainSnapshot *snapshot)
{
- g_debug("Init GVirConfigDomainSnapshot=%p", conn);
+ g_debug("Init GVirConfigDomainSnapshot=%p", snapshot);
- conn->priv = GVIR_CONFIG_DOMAIN_SNAPSHOT_GET_PRIVATE(conn);
+ snapshot->priv = GVIR_CONFIG_DOMAIN_SNAPSHOT_GET_PRIVATE(snapshot);
}
diff --git a/libvirt-gconfig/libvirt-gconfig-domain.c b/libvirt-gconfig/libvirt-gconfig-domain.c
index 7ef0be8..eb97cd5 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain.c
+++ b/libvirt-gconfig/libvirt-gconfig-domain.c
@@ -188,11 +188,11 @@ static void gvir_config_domain_class_init(GVirConfigDomainClass *klass)
}
-static void gvir_config_domain_init(GVirConfigDomain *conn)
+static void gvir_config_domain_init(GVirConfigDomain *domain)
{
- g_debug("Init GVirConfigDomain=%p", conn);
+ g_debug("Init GVirConfigDomain=%p", domain);
- conn->priv = GVIR_CONFIG_DOMAIN_GET_PRIVATE(conn);
+ domain->priv = GVIR_CONFIG_DOMAIN_GET_PRIVATE(domain);
}
diff --git a/libvirt-gconfig/libvirt-gconfig-interface.c b/libvirt-gconfig/libvirt-gconfig-interface.c
index 4b63091..521455c 100644
--- a/libvirt-gconfig/libvirt-gconfig-interface.c
+++ b/libvirt-gconfig/libvirt-gconfig-interface.c
@@ -42,11 +42,11 @@ static void gvir_config_interface_class_init(GVirConfigInterfaceClass *klass)
}
-static void gvir_config_interface_init(GVirConfigInterface *conn)
+static void gvir_config_interface_init(GVirConfigInterface *iface)
{
- g_debug("Init GVirConfigInterface=%p", conn);
+ g_debug("Init GVirConfigInterface=%p", iface);
- conn->priv = GVIR_CONFIG_INTERFACE_GET_PRIVATE(conn);
+ iface->priv = GVIR_CONFIG_INTERFACE_GET_PRIVATE(iface);
}
diff --git a/libvirt-gconfig/libvirt-gconfig-network-filter.c b/libvirt-gconfig/libvirt-gconfig-network-filter.c
index 1efef7c..68c5c79 100644
--- a/libvirt-gconfig/libvirt-gconfig-network-filter.c
+++ b/libvirt-gconfig/libvirt-gconfig-network-filter.c
@@ -42,11 +42,11 @@ static void gvir_config_network_filter_class_init(GVirConfigNetworkFilterClass *
}
-static void gvir_config_network_filter_init(GVirConfigNetworkFilter *conn)
+static void gvir_config_network_filter_init(GVirConfigNetworkFilter *filter)
{
- g_debug("Init GVirConfigNetworkFilter=%p", conn);
+ g_debug("Init GVirConfigNetworkFilter=%p", filter);
- conn->priv = GVIR_CONFIG_NETWORK_FILTER_GET_PRIVATE(conn);
+ filter->priv = GVIR_CONFIG_NETWORK_FILTER_GET_PRIVATE(filter);
}
diff --git a/libvirt-gconfig/libvirt-gconfig-network.c b/libvirt-gconfig/libvirt-gconfig-network.c
index cd23aa6..e14b9c7 100644
--- a/libvirt-gconfig/libvirt-gconfig-network.c
+++ b/libvirt-gconfig/libvirt-gconfig-network.c
@@ -42,11 +42,11 @@ static void gvir_config_network_class_init(GVirConfigNetworkClass *klass)
}
-static void gvir_config_network_init(GVirConfigNetwork *conn)
+static void gvir_config_network_init(GVirConfigNetwork *network)
{
- g_debug("Init GVirConfigNetwork=%p", conn);
+ g_debug("Init GVirConfigNetwork=%p", network);
- conn->priv = GVIR_CONFIG_NETWORK_GET_PRIVATE(conn);
+ network->priv = GVIR_CONFIG_NETWORK_GET_PRIVATE(network);
}
diff --git a/libvirt-gconfig/libvirt-gconfig-node-device.c b/libvirt-gconfig/libvirt-gconfig-node-device.c
index e23cc7c..eab4aab 100644
--- a/libvirt-gconfig/libvirt-gconfig-node-device.c
+++ b/libvirt-gconfig/libvirt-gconfig-node-device.c
@@ -42,11 +42,11 @@ static void gvir_config_node_device_class_init(GVirConfigNodeDeviceClass *klass)
}
-static void gvir_config_node_device_init(GVirConfigNodeDevice *conn)
+static void gvir_config_node_device_init(GVirConfigNodeDevice *device)
{
- g_debug("Init GVirConfigNodeDevice=%p", conn);
+ g_debug("Init GVirConfigNodeDevice=%p", device);
- conn->priv = GVIR_CONFIG_NODE_DEVICE_GET_PRIVATE(conn);
+ device->priv = GVIR_CONFIG_NODE_DEVICE_GET_PRIVATE(device);
}
diff --git a/libvirt-gconfig/libvirt-gconfig-object.c b/libvirt-gconfig/libvirt-gconfig-object.c
index d6e4bd8..9e3b5f2 100644
--- a/libvirt-gconfig/libvirt-gconfig-object.c
+++ b/libvirt-gconfig/libvirt-gconfig-object.c
@@ -120,10 +120,10 @@ static void gvir_config_object_set_property(GObject *object,
static void gvir_config_object_finalize(GObject *object)
{
- GVirConfigObject *conn = GVIR_CONFIG_OBJECT(object);
- GVirConfigObjectPrivate *priv = conn->priv;
+ GVirConfigObject *gvir_object = GVIR_CONFIG_OBJECT(object);
+ GVirConfigObjectPrivate *priv = gvir_object->priv;
- g_debug("Finalize GVirConfigObject=%p", conn);
+ g_debug("Finalize GVirConfigObject=%p", gvir_object);
g_free(priv->schema);
@@ -182,11 +182,11 @@ static void gvir_config_object_class_init(GVirConfigObjectClass *klass)
}
-static void gvir_config_object_init(GVirConfigObject *conn)
+static void gvir_config_object_init(GVirConfigObject *object)
{
- g_debug("Init GVirConfigObject=%p", conn);
+ g_debug("Init GVirConfigObject=%p", object);
- conn->priv = GVIR_CONFIG_OBJECT_GET_PRIVATE(conn);
+ object->priv = GVIR_CONFIG_OBJECT_GET_PRIVATE(object);
}
void gvir_config_object_validate(GVirConfigObject *config,
diff --git a/libvirt-gconfig/libvirt-gconfig-secret.c b/libvirt-gconfig/libvirt-gconfig-secret.c
index fb268b0..c2dbcff 100644
--- a/libvirt-gconfig/libvirt-gconfig-secret.c
+++ b/libvirt-gconfig/libvirt-gconfig-secret.c
@@ -42,11 +42,11 @@ static void gvir_config_secret_class_init(GVirConfigSecretClass *klass)
}
-static void gvir_config_secret_init(GVirConfigSecret *conn)
+static void gvir_config_secret_init(GVirConfigSecret *secret)
{
- g_debug("Init GVirConfigSecret=%p", conn);
+ g_debug("Init GVirConfigSecret=%p", secret);
- conn->priv = GVIR_CONFIG_SECRET_GET_PRIVATE(conn);
+ secret->priv = GVIR_CONFIG_SECRET_GET_PRIVATE(secret);
}
diff --git a/libvirt-gconfig/libvirt-gconfig-storage-pool.c b/libvirt-gconfig/libvirt-gconfig-storage-pool.c
index b06c24c..87caeb6 100644
--- a/libvirt-gconfig/libvirt-gconfig-storage-pool.c
+++ b/libvirt-gconfig/libvirt-gconfig-storage-pool.c
@@ -44,11 +44,11 @@ static void gvir_config_storage_pool_class_init(GVirConfigStoragePoolClass *klas
}
-static void gvir_config_storage_pool_init(GVirConfigStoragePool *conn)
+static void gvir_config_storage_pool_init(GVirConfigStoragePool *pool)
{
- g_debug("Init GVirConfigStoragePool=%p", conn);
+ g_debug("Init GVirConfigStoragePool=%p", pool);
- conn->priv = GVIR_CONFIG_STORAGE_POOL_GET_PRIVATE(conn);
+ pool->priv = GVIR_CONFIG_STORAGE_POOL_GET_PRIVATE(pool);
}
diff --git a/libvirt-gconfig/libvirt-gconfig-storage-vol.c b/libvirt-gconfig/libvirt-gconfig-storage-vol.c
index e2a0ae8..6690dd7 100644
--- a/libvirt-gconfig/libvirt-gconfig-storage-vol.c
+++ b/libvirt-gconfig/libvirt-gconfig-storage-vol.c
@@ -44,11 +44,11 @@ static void gvir_config_storage_vol_class_init(GVirConfigStorageVolClass *klass)
}
-static void gvir_config_storage_vol_init(GVirConfigStorageVol *conn)
+static void gvir_config_storage_vol_init(GVirConfigStorageVol *vol)
{
- g_debug("Init GVirConfigStorageVol=%p", conn);
+ g_debug("Init GVirConfigStorageVol=%p", vol);
- conn->priv = GVIR_CONFIG_STORAGE_VOL_GET_PRIVATE(conn);
+ vol->priv = GVIR_CONFIG_STORAGE_VOL_GET_PRIVATE(vol);
}
diff --git a/libvirt-gobject/libvirt-gobject-domain-snapshot.c b/libvirt-gobject/libvirt-gobject-domain-snapshot.c
index b2c49a4..d4e9b97 100644
--- a/libvirt-gobject/libvirt-gobject-domain-snapshot.c
+++ b/libvirt-gobject/libvirt-gobject-domain-snapshot.c
@@ -61,8 +61,8 @@ static void gvir_domain_snapshot_get_property(GObject *object,
GValue *value,
GParamSpec *pspec)
{
- GVirDomainSnapshot *conn = GVIR_DOMAIN_SNAPSHOT(object);
- GVirDomainSnapshotPrivate *priv = conn->priv;
+ GVirDomainSnapshot *snapshot = GVIR_DOMAIN_SNAPSHOT(object);
+ GVirDomainSnapshotPrivate *priv = snapshot->priv;
switch (prop_id) {
case PROP_HANDLE:
@@ -80,8 +80,8 @@ static void gvir_domain_snapshot_set_property(GObject *object,
const GValue *value,
GParamSpec *pspec)
{
- GVirDomainSnapshot *conn = GVIR_DOMAIN_SNAPSHOT(object);
- GVirDomainSnapshotPrivate *priv = conn->priv;
+ GVirDomainSnapshot *snapshot = GVIR_DOMAIN_SNAPSHOT(object);
+ GVirDomainSnapshotPrivate *priv = snapshot->priv;
switch (prop_id) {
case PROP_HANDLE:
@@ -98,10 +98,10 @@ static void gvir_domain_snapshot_set_property(GObject *object,
static void gvir_domain_snapshot_finalize(GObject *object)
{
- GVirDomainSnapshot *conn = GVIR_DOMAIN_SNAPSHOT(object);
- GVirDomainSnapshotPrivate *priv = conn->priv;
+ GVirDomainSnapshot *snapshot = GVIR_DOMAIN_SNAPSHOT(object);
+ GVirDomainSnapshotPrivate *priv = snapshot->priv;
- g_debug("Finalize GVirDomainSnapshot=%p", conn);
+ g_debug("Finalize GVirDomainSnapshot=%p", snapshot);
virDomainSnapshotFree(priv->handle);
@@ -132,11 +132,11 @@ static void gvir_domain_snapshot_class_init(GVirDomainSnapshotClass *klass)
}
-static void gvir_domain_snapshot_init(GVirDomainSnapshot *conn)
+static void gvir_domain_snapshot_init(GVirDomainSnapshot *snapshot)
{
- g_debug("Init GVirDomainSnapshot=%p", conn);
+ g_debug("Init GVirDomainSnapshot=%p", snapshot);
- conn->priv = GVIR_DOMAIN_SNAPSHOT_GET_PRIVATE(conn);
+ snapshot->priv = GVIR_DOMAIN_SNAPSHOT_GET_PRIVATE(snapshot);
}
typedef struct virDomainSnapshot GVirDomainSnapshotHandle;
diff --git a/libvirt-gobject/libvirt-gobject-domain.c b/libvirt-gobject/libvirt-gobject-domain.c
index a296144..c6e30e5 100644
--- a/libvirt-gobject/libvirt-gobject-domain.c
+++ b/libvirt-gobject/libvirt-gobject-domain.c
@@ -75,8 +75,8 @@ static void gvir_domain_get_property(GObject *object,
GValue *value,
GParamSpec *pspec)
{
- GVirDomain *conn = GVIR_DOMAIN(object);
- GVirDomainPrivate *priv = conn->priv;
+ GVirDomain *domain = GVIR_DOMAIN(object);
+ GVirDomainPrivate *priv = domain->priv;
switch (prop_id) {
case PROP_HANDLE:
@@ -84,7 +84,7 @@ static void gvir_domain_get_property(GObject *object,
break;
case PROP_PERSISTENT:
- g_value_set_boolean(value, gvir_domain_get_persistent (conn));
+ g_value_set_boolean(value, gvir_domain_get_persistent (domain));
break;
default:
@@ -98,8 +98,8 @@ static void gvir_domain_set_property(GObject *object,
const GValue *value,
GParamSpec *pspec)
{
- GVirDomain *conn = GVIR_DOMAIN(object);
- GVirDomainPrivate *priv = conn->priv;
+ GVirDomain *domain = GVIR_DOMAIN(object);
+ GVirDomainPrivate *priv = domain->priv;
switch (prop_id) {
case PROP_HANDLE:
@@ -116,10 +116,10 @@ static void gvir_domain_set_property(GObject *object,
static void gvir_domain_finalize(GObject *object)
{
- GVirDomain *conn = GVIR_DOMAIN(object);
- GVirDomainPrivate *priv = conn->priv;
+ GVirDomain *domain = GVIR_DOMAIN(object);
+ GVirDomainPrivate *priv = domain->priv;
- g_debug("Finalize GVirDomain=%p", conn);
+ g_debug("Finalize GVirDomain=%p", domain);
virDomainFree(priv->handle);
@@ -129,8 +129,8 @@ static void gvir_domain_finalize(GObject *object)
static void gvir_domain_constructed(GObject *object)
{
- GVirDomain *conn = GVIR_DOMAIN(object);
- GVirDomainPrivate *priv = conn->priv;
+ GVirDomain *domain = GVIR_DOMAIN(object);
+ GVirDomainPrivate *priv = domain->priv;
G_OBJECT_CLASS(gvir_domain_parent_class)->constructed(object);
@@ -232,11 +232,11 @@ static void gvir_domain_class_init(GVirDomainClass *klass)
}
-static void gvir_domain_init(GVirDomain *conn)
+static void gvir_domain_init(GVirDomain *domain)
{
- g_debug("Init GVirDomain=%p", conn);
+ g_debug("Init GVirDomain=%p", domain);
- conn->priv = GVIR_DOMAIN_GET_PRIVATE(conn);
+ domain->priv = GVIR_DOMAIN_GET_PRIVATE(domain);
}
typedef struct virDomain GVirDomainHandle;
diff --git a/libvirt-gobject/libvirt-gobject-interface.c b/libvirt-gobject/libvirt-gobject-interface.c
index aaf81b9..1fc6656 100644
--- a/libvirt-gobject/libvirt-gobject-interface.c
+++ b/libvirt-gobject/libvirt-gobject-interface.c
@@ -61,8 +61,8 @@ static void gvir_interface_get_property(GObject *object,
GValue *value,
GParamSpec *pspec)
{
- GVirInterface *conn = GVIR_INTERFACE(object);
- GVirInterfacePrivate *priv = conn->priv;
+ GVirInterface *iface = GVIR_INTERFACE(object);
+ GVirInterfacePrivate *priv = iface->priv;
switch (prop_id) {
case PROP_HANDLE:
@@ -80,8 +80,8 @@ static void gvir_interface_set_property(GObject *object,
const GValue *value,
GParamSpec *pspec)
{
- GVirInterface *conn = GVIR_INTERFACE(object);
- GVirInterfacePrivate *priv = conn->priv;
+ GVirInterface *iface = GVIR_INTERFACE(object);
+ GVirInterfacePrivate *priv = iface->priv;
switch (prop_id) {
case PROP_HANDLE:
@@ -98,10 +98,10 @@ static void gvir_interface_set_property(GObject *object,
static void gvir_interface_finalize(GObject *object)
{
- GVirInterface *conn = GVIR_INTERFACE(object);
- GVirInterfacePrivate *priv = conn->priv;
+ GVirInterface *iface = GVIR_INTERFACE(object);
+ GVirInterfacePrivate *priv = iface->priv;
- g_debug("Finalize GVirInterface=%p", conn);
+ g_debug("Finalize GVirInterface=%p", iface);
virInterfaceFree(priv->handle);
@@ -132,11 +132,11 @@ static void gvir_interface_class_init(GVirInterfaceClass *klass)
}
-static void gvir_interface_init(GVirInterface *conn)
+static void gvir_interface_init(GVirInterface *iface)
{
- g_debug("Init GVirInterface=%p", conn);
+ g_debug("Init GVirInterface=%p", iface);
- conn->priv = GVIR_INTERFACE_GET_PRIVATE(conn);
+ iface->priv = GVIR_INTERFACE_GET_PRIVATE(iface);
}
typedef struct virInterface GVirInterfaceHandle;
diff --git a/libvirt-gobject/libvirt-gobject-manager.c b/libvirt-gobject/libvirt-gobject-manager.c
index 005b793..e20343e 100644
--- a/libvirt-gobject/libvirt-gobject-manager.c
+++ b/libvirt-gobject/libvirt-gobject-manager.c
@@ -108,13 +108,13 @@ static void gvir_manager_class_init(GVirManagerClass *klass)
}
-static void gvir_manager_init(GVirManager *conn)
+static void gvir_manager_init(GVirManager *manager)
{
GVirManagerPrivate *priv;
- g_debug("Init GVirManager=%p", conn);
+ g_debug("Init GVirManager=%p", manager);
- priv = conn->priv = GVIR_MANAGER_GET_PRIVATE(conn);
+ priv = manager->priv = GVIR_MANAGER_GET_PRIVATE(manager);
priv->lock = g_mutex_new();
}
diff --git a/libvirt-gobject/libvirt-gobject-network-filter.c b/libvirt-gobject/libvirt-gobject-network-filter.c
index c1ba6ac..60756c0 100644
--- a/libvirt-gobject/libvirt-gobject-network-filter.c
+++ b/libvirt-gobject/libvirt-gobject-network-filter.c
@@ -148,11 +148,11 @@ static void gvir_network_filter_class_init(GVirNetworkFilterClass *klass)
}
-static void gvir_network_filter_init(GVirNetworkFilter *conn)
+static void gvir_network_filter_init(GVirNetworkFilter *filter)
{
- g_debug("Init GVirNetworkFilter=%p", conn);
+ g_debug("Init GVirNetworkFilter=%p", filter);
- conn->priv = GVIR_NETWORK_FILTER_GET_PRIVATE(conn);
+ filter->priv = GVIR_NETWORK_FILTER_GET_PRIVATE(filter);
}
typedef struct virNWFilter GVirNetworkFilterHandle;
diff --git a/libvirt-gobject/libvirt-gobject-network.c b/libvirt-gobject/libvirt-gobject-network.c
index 25d89af..b1b38a0 100644
--- a/libvirt-gobject/libvirt-gobject-network.c
+++ b/libvirt-gobject/libvirt-gobject-network.c
@@ -62,8 +62,8 @@ static void gvir_network_get_property(GObject *object,
GValue *value,
GParamSpec *pspec)
{
- GVirNetwork *conn = GVIR_NETWORK(object);
- GVirNetworkPrivate *priv = conn->priv;
+ GVirNetwork *network = GVIR_NETWORK(object);
+ GVirNetworkPrivate *priv = network->priv;
switch (prop_id) {
case PROP_HANDLE:
@@ -81,8 +81,8 @@ static void gvir_network_set_property(GObject *object,
const GValue *value,
GParamSpec *pspec)
{
- GVirNetwork *conn = GVIR_NETWORK(object);
- GVirNetworkPrivate *priv = conn->priv;
+ GVirNetwork *network = GVIR_NETWORK(object);
+ GVirNetworkPrivate *priv = network->priv;
switch (prop_id) {
case PROP_HANDLE:
@@ -99,10 +99,10 @@ static void gvir_network_set_property(GObject *object,
static void gvir_network_finalize(GObject *object)
{
- GVirNetwork *conn = GVIR_NETWORK(object);
- GVirNetworkPrivate *priv = conn->priv;
+ GVirNetwork *network = GVIR_NETWORK(object);
+ GVirNetworkPrivate *priv = network->priv;
- g_debug("Finalize GVirNetwork=%p", conn);
+ g_debug("Finalize GVirNetwork=%p", network);
virNetworkFree(priv->handle);
@@ -145,11 +145,11 @@ static void gvir_network_class_init(GVirNetworkClass *klass)
}
-static void gvir_network_init(GVirNetwork *conn)
+static void gvir_network_init(GVirNetwork *network)
{
- g_debug("Init GVirNetwork=%p", conn);
+ g_debug("Init GVirNetwork=%p", network);
- conn->priv = GVIR_NETWORK_GET_PRIVATE(conn);
+ network->priv = GVIR_NETWORK_GET_PRIVATE(network);
}
typedef struct virNetwork GVirNetworkHandle;
diff --git a/libvirt-gobject/libvirt-gobject-node-device.c b/libvirt-gobject/libvirt-gobject-node-device.c
index 2540795..18394d1 100644
--- a/libvirt-gobject/libvirt-gobject-node-device.c
+++ b/libvirt-gobject/libvirt-gobject-node-device.c
@@ -61,8 +61,8 @@ static void gvir_node_device_get_property(GObject *object,
GValue *value,
GParamSpec *pspec)
{
- GVirNodeDevice *conn = GVIR_NODE_DEVICE(object);
- GVirNodeDevicePrivate *priv = conn->priv;
+ GVirNodeDevice *device = GVIR_NODE_DEVICE(object);
+ GVirNodeDevicePrivate *priv = device->priv;
switch (prop_id) {
case PROP_HANDLE:
@@ -80,8 +80,8 @@ static void gvir_node_device_set_property(GObject *object,
const GValue *value,
GParamSpec *pspec)
{
- GVirNodeDevice *conn = GVIR_NODE_DEVICE(object);
- GVirNodeDevicePrivate *priv = conn->priv;
+ GVirNodeDevice *device = GVIR_NODE_DEVICE(object);
+ GVirNodeDevicePrivate *priv = device->priv;
switch (prop_id) {
case PROP_HANDLE:
@@ -98,10 +98,10 @@ static void gvir_node_device_set_property(GObject *object,
static void gvir_node_device_finalize(GObject *object)
{
- GVirNodeDevice *conn = GVIR_NODE_DEVICE(object);
- GVirNodeDevicePrivate *priv = conn->priv;
+ GVirNodeDevice *device = GVIR_NODE_DEVICE(object);
+ GVirNodeDevicePrivate *priv = device->priv;
- g_debug("Finalize GVirNodeDevice=%p", conn);
+ g_debug("Finalize GVirNodeDevice=%p", device);
virNodeDeviceFree(priv->handle);
@@ -132,11 +132,11 @@ static void gvir_node_device_class_init(GVirNodeDeviceClass *klass)
}
-static void gvir_node_device_init(GVirNodeDevice *conn)
+static void gvir_node_device_init(GVirNodeDevice *device)
{
- g_debug("Init GVirNodeDevice=%p", conn);
+ g_debug("Init GVirNodeDevice=%p", device);
- conn->priv = GVIR_NODE_DEVICE_GET_PRIVATE(conn);
+ device->priv = GVIR_NODE_DEVICE_GET_PRIVATE(device);
}
typedef struct virNodeDevice GVirNodeDeviceHandle;
diff --git a/libvirt-gobject/libvirt-gobject-secret.c b/libvirt-gobject/libvirt-gobject-secret.c
index 8ff17b5..f03b44c 100644
--- a/libvirt-gobject/libvirt-gobject-secret.c
+++ b/libvirt-gobject/libvirt-gobject-secret.c
@@ -62,8 +62,8 @@ static void gvir_secret_get_property(GObject *object,
GValue *value,
GParamSpec *pspec)
{
- GVirSecret *conn = GVIR_SECRET(object);
- GVirSecretPrivate *priv = conn->priv;
+ GVirSecret *secret = GVIR_SECRET(object);
+ GVirSecretPrivate *priv = secret->priv;
switch (prop_id) {
case PROP_HANDLE:
@@ -81,8 +81,8 @@ static void gvir_secret_set_property(GObject *object,
const GValue *value,
GParamSpec *pspec)
{
- GVirSecret *conn = GVIR_SECRET(object);
- GVirSecretPrivate *priv = conn->priv;
+ GVirSecret *secret = GVIR_SECRET(object);
+ GVirSecretPrivate *priv = secret->priv;
switch (prop_id) {
case PROP_HANDLE:
@@ -99,10 +99,10 @@ static void gvir_secret_set_property(GObject *object,
static void gvir_secret_finalize(GObject *object)
{
- GVirSecret *conn = GVIR_SECRET(object);
- GVirSecretPrivate *priv = conn->priv;
+ GVirSecret *secret = GVIR_SECRET(object);
+ GVirSecretPrivate *priv = secret->priv;
- g_debug("Finalize GVirSecret=%p", conn);
+ g_debug("Finalize GVirSecret=%p", secret);
virSecretFree(priv->handle);
@@ -112,8 +112,8 @@ static void gvir_secret_finalize(GObject *object)
static void gvir_secret_constructed(GObject *object)
{
- GVirSecret *conn = GVIR_SECRET(object);
- GVirSecretPrivate *priv = conn->priv;
+ GVirSecret *secret = GVIR_SECRET(object);
+ GVirSecretPrivate *priv = secret->priv;
G_OBJECT_CLASS(gvir_secret_parent_class)->constructed(object);
@@ -147,11 +147,11 @@ static void gvir_secret_class_init(GVirSecretClass *klass)
}
-static void gvir_secret_init(GVirSecret *conn)
+static void gvir_secret_init(GVirSecret *secret)
{
- g_debug("Init GVirSecret=%p", conn);
+ g_debug("Init GVirSecret=%p", secret);
- conn->priv = GVIR_SECRET_GET_PRIVATE(conn);
+ secret->priv = GVIR_SECRET_GET_PRIVATE(secret);
}
typedef struct virSecret GVirSecretHandle;
diff --git a/libvirt-gobject/libvirt-gobject-storage-pool.c b/libvirt-gobject/libvirt-gobject-storage-pool.c
index 282eee1..e02adc8 100644
--- a/libvirt-gobject/libvirt-gobject-storage-pool.c
+++ b/libvirt-gobject/libvirt-gobject-storage-pool.c
@@ -123,8 +123,8 @@ static void gvir_storage_pool_finalize(GObject *object)
static void gvir_storage_pool_constructed(GObject *object)
{
- GVirStoragePool *conn = GVIR_STORAGE_POOL(object);
- GVirStoragePoolPrivate *priv = conn->priv;
+ GVirStoragePool *pool = GVIR_STORAGE_POOL(object);
+ GVirStoragePoolPrivate *priv = pool->priv;
G_OBJECT_CLASS(gvir_storage_pool_parent_class)->constructed(object);
diff --git a/libvirt-gobject/libvirt-gobject-storage-vol.c b/libvirt-gobject/libvirt-gobject-storage-vol.c
index 7e5ac7d..4c0160a 100644
--- a/libvirt-gobject/libvirt-gobject-storage-vol.c
+++ b/libvirt-gobject/libvirt-gobject-storage-vol.c
@@ -65,8 +65,8 @@ static void gvir_storage_vol_get_property(GObject *object,
GValue *value,
GParamSpec *pspec)
{
- GVirStorageVol *conn = GVIR_STORAGE_VOL(object);
- GVirStorageVolPrivate *priv = conn->priv;
+ GVirStorageVol *vol = GVIR_STORAGE_VOL(object);
+ GVirStorageVolPrivate *priv = vol->priv;
switch (prop_id) {
case PROP_HANDLE:
@@ -88,8 +88,8 @@ static void gvir_storage_vol_set_property(GObject *object,
const GValue *value,
GParamSpec *pspec)
{
- GVirStorageVol *conn = GVIR_STORAGE_VOL(object);
- GVirStorageVolPrivate *priv = conn->priv;
+ GVirStorageVol *vol = GVIR_STORAGE_VOL(object);
+ GVirStorageVolPrivate *priv = vol->priv;
switch (prop_id) {
case PROP_HANDLE:
@@ -109,10 +109,10 @@ static void gvir_storage_vol_set_property(GObject *object,
static void gvir_storage_vol_finalize(GObject *object)
{
- GVirStorageVol *conn = GVIR_STORAGE_VOL(object);
- GVirStorageVolPrivate *priv = conn->priv;
+ GVirStorageVol *vol = GVIR_STORAGE_VOL(object);
+ GVirStorageVolPrivate *priv = vol->priv;
- g_debug("Finalize GVirStorageVol=%p", conn);
+ g_debug("Finalize GVirStorageVol=%p", vol);
virStorageVolFree(priv->handle);
@@ -154,11 +154,11 @@ static void gvir_storage_vol_class_init(GVirStorageVolClass *klass)
}
-static void gvir_storage_vol_init(GVirStorageVol *conn)
+static void gvir_storage_vol_init(GVirStorageVol *vol)
{
- g_debug("Init GVirStorageVol=%p", conn);
+ g_debug("Init GVirStorageVol=%p", vol);
- conn->priv = GVIR_STORAGE_VOL_GET_PRIVATE(conn);
+ vol->priv = GVIR_STORAGE_VOL_GET_PRIVATE(vol);
}
typedef struct virStorageVol GVirStorageVolHandle;
--
1.8.1.4
11 years, 6 months
[libvirt] [libvirt-glib] gconfig: Fix gvir_config_domain_graphics_new_from_tree
by Christophe Fergeau
It does not handle the recently added
GVirConfigDomainGraphicsRdp and GVirConfigDomainGraphicsDesktop
classes.
---
libvirt-gconfig/libvirt-gconfig-domain-graphics.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/libvirt-gconfig/libvirt-gconfig-domain-graphics.c b/libvirt-gconfig/libvirt-gconfig-domain-graphics.c
index 2b54b87..e42e0cc 100644
--- a/libvirt-gconfig/libvirt-gconfig-domain-graphics.c
+++ b/libvirt-gconfig/libvirt-gconfig-domain-graphics.c
@@ -67,17 +67,13 @@ gvir_config_domain_graphics_new_from_tree(GVirConfigXmlDoc *doc,
} else if (g_str_equal(type, "spice")) {
gtype = GVIR_CONFIG_TYPE_DOMAIN_GRAPHICS_SPICE;
} else if (g_str_equal(type, "rdp")) {
- goto unimplemented;
+ gtype = GVIR_CONFIG_TYPE_DOMAIN_GRAPHICS_RDP;
} else if (g_str_equal(type, "desktop")) {
- goto unimplemented;
+ gtype = GVIR_CONFIG_TYPE_DOMAIN_GRAPHICS_DESKTOP;
} else {
g_debug("Unknown graphics node: %s", type);
return NULL;
}
return GVIR_CONFIG_DOMAIN_DEVICE(gvir_config_object_new_from_tree(gtype, doc, NULL, tree));
-
-unimplemented:
- g_debug("Parsing of '%s' graphics nodes is unimplemented", type);
- return NULL;
}
--
1.8.1.4
11 years, 6 months
[libvirt] [PATCH] docs: Fix closing tag in snapshot documentation
by Christophe Fergeau
Commit cc6d19f3 added text containing "<code>snapshot<code>" to
formatsnapshot.html.in. The closing tag is missing '/' which causes
the documentation to misrender.
---
Pushed under the trivial rule.
docs/formatsnapshot.html.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/formatsnapshot.html.in b/docs/formatsnapshot.html.in
index b1e259f..2e830f8 100644
--- a/docs/formatsnapshot.html.in
+++ b/docs/formatsnapshot.html.in
@@ -147,7 +147,7 @@
devices</a> specified for the domain at the time of the
snapshot. The attribute <code>snapshot</code> is
optional, and the possible values are the same as the
- <code>snapshot<code> attribute for
+ <code>snapshot</code> attribute for
<a href="formatdomain.html#elementsDisks">disk devices</a>
(<code>no</code>, <code>internal</code>,
or <code>external</code>). Some hypervisors like ESX
--
1.8.1.4
11 years, 6 months