Re: [libvirt] libvirt Hyper-v 2012 r2 fix
by vikhyath reddy
Bringing the discussion back online...
Okay so figured out what was going on (to see what the actual error was,
please read the latest email in the conversation). Classes in
hyperv/hyperv_wmi_generator.input
a) Msvm_MemorySettingData
b) Msvm_ProcessorSettingData
c) Msvm_VirtualSystemSettingData
Have been upgraded to the definitions found at the new v2 doc
http://msdn.microsoft.com/en-us/library/hh850176(v=vs.85).aspx,
I put in this note at the beginning of the
hyperv/hyperv_wmi_generator.input file.
With these changes and a few other minor ones, I can confirm that the
functionality mimics the hyperv 2008 version. That is, we get the same
functionality (supported vs non-supported drivers).
However, this might also mean the end of support of Hyper-V 2008 if it is
just a replace of the existing classes. What do you guys think? Should we
continue to support 2008 (~6 years old) OR is it OK to assume that Hyperv-V
2012 will be the default standard moving forward.
Thanks,
Vik.
On Wed, Apr 16, 2014 at 10:23 AM, vikhyath reddy
<reddy.vikhyath(a)gmail.com>wrote:
> Taking this offline...
>
> Hi Matthias,
>
> Well... from more testing what I found is that openwsman breaks during
> serialization.
>
> When I run against hyper-v 2012 r2
>
> ---------------------------------------------
>
> virsh # list --all
>
> *1984 testing-1 running*
> ---------------------------------------------
>
> virsh # dumpxml testing-1
>
> *2014-04-16 16:53:54.049+0000: 10693: info : libvirt version: 1.2.3*
>
> *2014-04-16 16:53:54.049+0000: 10693: error : hypervDebugHandler:1403 :
> openwsman error: not enough (0 < 1) instances of element SystemName*
>
> *2014-04-16 16:53:54.049+0000: 10693: error : hypervDebugHandler:1403 :
> openwsman error: handling of element "**SystemName**" failed = -3*
>
> *2014-04-16 16:53:54.049+0000: 10693: error : hypervDebugHandler:1403 :
> openwsman error: size of 1 structures "Msvm_VirtualSystemSettingData"
> exceeds stopper (0x7fb86a4c5d18 > (nil))*
>
> *2014-04-16 16:53:54.049+0000: 10693: error : hypervDebugHandler:1403 :
> openwsman error: Error during serialization*
>
> *error: internal error: Could not deserialize pull response item*
>
> *-------------------------------------------------*
>
> I was also looking at
> http://www.redhat.com/archives/libvir-list/2011-July/msg00768.html and
> found that you submitted a patch. It looks like from class
>
>
> class Msvm_VirtualSystemSettingData
>
>
> property *SystemName*
>
>
> is being returned NULL or is is non existent in the pull response. Any pointers as to how can I check what is being returned in the pull response (if any)?
>
>
> Thanks!
>
> Vik.
>
>
>
> On Wed, Apr 16, 2014 at 1:35 AM, Matthias Bolte <
> matthias.bolte(a)googlemail.com> wrote:
>
>> 2014-04-16 3:26 GMT+02:00 vikhyath reddy <reddy.vikhyath(a)gmail.com>:
>> > Update,
>> >
>> > I tried adding root\virtualization\v2 to the namespace in libvirt source
>> > code for hyperv. I ran some tests and it seems to work. I get the same
>> > functionality (supported vs non-supported drivers) as hyper-v 2008.
>> >
>> > Do you guys want me to submit the patch? If yes, what all do I need to
>> > update to get the patch in?
>> >
>> > Thanks,
>> > Vik.
>> >
>> >
>> > On Tue, Apr 15, 2014 at 5:26 PM, vikhyath reddy <
>> reddy.vikhyath(a)gmail.com>
>> > wrote:
>> >>
>> >> Hello everyone,
>> >>
>> >> Thanks for libvirt. I did see on the libvirt page that hyper-v 2008 is
>> >> supported (which it does). So I tried running it on Hyper-v 2012 r2 but
>> >> virsh fails to connect by an error that says
>> >>
>> >> "error: internal error: SOAP fault during enumeration: code 's:Sender',
>> >> subcode 'n:CannotProcessFilter', reason 'The data source could not
>> process
>> >> the filter. The filter might be missing or it might be invalid. Change
>> the
>> >> filter and try the request again. ', detail '500The specified class
>> does
>> >> not exist in the given namespace. HRESULT
>> 0x8033801a0052150858778HRESULTThe
>> >> specified class does not exist in the given namespace. ' "
>> >>
>> >> Upon looking into the Hyper-v 2012 r2 server event logs, I found that
>> this
>> >> is going on
>> >>
>> >> [ Source: WMI-Activity
>> >> Event ID: 5898
>> >> Microsoft-Windows-WMI-Activity/Operational ]
>> >>
>> >>
>> >> Id = {62D480B2-58EF-0000-E580-D462EF58CF01}; ClientMachine =
>> >> VIKHYPERV; User = VIKHYPERV\Administrator; ClientProcessId = 884;
>> >> Component = Unknown; Operation = Start IWbemServices::ExecQuery -
>> >> root\virtualization : select * from Msvm_ComputerSystem where
>> >> Description = "Microsoft Hosting Computer System" ; ResultCode =
>> >> 0x80041010; PossibleCause = Unknown
>> >>
>> >> Note that Msvm_ComputerSystem is missing in the namespace
>> >> root\virtualization. Upon further investigation, I found that the new
>> >> namespace where Msvm_ComputerSystem is located is at
>> root\virtualization\v2
>> >>
>> >> Is (it possible?) there some way I can know where in the source code,
>> >> libvirt is specifying the namespace so that I can try patching it up
>> and see
>> >> if it fixes things?
>> >>
>> >> Thanks for all your help,
>> >> Vik.
>>
>> Yes, send a patch for this.
>>
>> To get your patch in, you need to send it to this list for review.
>> After a successful review it'll be pushed to the git repo by someone
>> with commit access.
>>
>> See http://libvirt.org/hacking.html for more details about working on
>> the source and submitting patches.
>>
>> --
>> Matthias Bolte
>> http://photron.blogspot.com
>>
>
>
10 years, 8 months
[libvirt] [PATCH] Fix typos in src/*
by Nehal J Wani
Fix minor typos in source comments
---
src/esx/esx_driver.c | 2 +-
src/esx/esx_storage_backend_iscsi.c | 2 +-
src/esx/esx_storage_driver.c | 2 +-
src/interface/interface_backend_netcf.c | 2 +-
src/interface/interface_backend_udev.c | 2 +-
src/locking/lock_protocol.x | 2 +-
src/openvz/openvz_conf.c | 4 ++--
src/qemu/qemu_capabilities.c | 2 +-
src/qemu/qemu_command.h | 2 +-
src/qemu/qemu_driver.c | 6 +++---
src/security/security_selinux.c | 2 +-
src/storage/storage_backend_fs.c | 2 +-
src/uml/uml_driver.c | 2 +-
src/util/virstring.c | 2 +-
src/vmware/vmware_conf.c | 2 +-
src/xen/xs_internal.c | 4 ++--
16 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c
index 5b12bd4..d082927 100644
--- a/src/esx/esx_driver.c
+++ b/src/esx/esx_driver.c
@@ -3109,7 +3109,7 @@ esxDomainDefineXML(virConnectPtr conn, const char *xml)
/*
* Build VMX datastore URL. Use the source of the first file-based harddisk
* to deduce the datastore and path for the VMX file. Don't just use the
- * first disk, because it may be CDROM disk and ISO images are normaly not
+ * first disk, because it may be CDROM disk and ISO images are normally not
* located in the virtual machine's directory. This approach to deduce the
* datastore isn't perfect but should work in the majority of cases.
*/
diff --git a/src/esx/esx_storage_backend_iscsi.c b/src/esx/esx_storage_backend_iscsi.c
index 5509429..af516c0 100644
--- a/src/esx/esx_storage_backend_iscsi.c
+++ b/src/esx/esx_storage_backend_iscsi.c
@@ -460,7 +460,7 @@ esxStorageVolLookupByName(virStoragePoolPtr pool,
scsiLun = scsiLun->_next) {
if (STREQ(scsiLun->deviceName, name)) {
/*
- * ScsiLun provides an UUID field that is unique accross
+ * ScsiLun provides an UUID field that is unique across
* multiple servers. But this field length is ~55 characters
* compute MD5 hash to transform it to an acceptable
* libvirt format
diff --git a/src/esx/esx_storage_driver.c b/src/esx/esx_storage_driver.c
index 2cfe939..cae53ed 100644
--- a/src/esx/esx_storage_driver.c
+++ b/src/esx/esx_storage_driver.c
@@ -386,7 +386,7 @@ esxStorageVolLookupByPath(virConnectPtr conn, const char *path)
/*
* FIXME: calling backends blindly may set unwanted error codes
*
- * VMFS Datastore path follows cannonical format i.e.:
+ * VMFS Datastore path follows canonical format i.e.:
* [<datastore_name>] <file_path>
* WHEREAS
* iSCSI LUNs device path follows normal linux path convention
diff --git a/src/interface/interface_backend_netcf.c b/src/interface/interface_backend_netcf.c
index 36a50bd..1b9ace5 100644
--- a/src/interface/interface_backend_netcf.c
+++ b/src/interface/interface_backend_netcf.c
@@ -151,7 +151,7 @@ netcfStateReload(void)
/*
* Get a minimal virInterfaceDef containing enough metadata
* for access control checks to be performed. Currently
- * this implies existance of name and mac address attributes
+ * this implies existence of name and mac address attributes
*/
static virInterfaceDef * ATTRIBUTE_NONNULL(1)
netcfGetMinimalDefForDevice(struct netcf_if *iface)
diff --git a/src/interface/interface_backend_udev.c b/src/interface/interface_backend_udev.c
index 4fb8eab..b05ac0e 100644
--- a/src/interface/interface_backend_udev.c
+++ b/src/interface/interface_backend_udev.c
@@ -66,7 +66,7 @@ virUdevStatusString(virUdevStatus status)
/*
* Get a minimal virInterfaceDef containing enough metadata
* for access control checks to be performed. Currently
- * this implies existance of name and mac address attributes
+ * this implies existence of name and mac address attributes
*/
static virInterfaceDef * ATTRIBUTE_NONNULL(1)
udevGetMinimalDefForDevice(struct udev_device *dev)
diff --git a/src/locking/lock_protocol.x b/src/locking/lock_protocol.x
index 354d51a..a77a784 100644
--- a/src/locking/lock_protocol.x
+++ b/src/locking/lock_protocol.x
@@ -77,7 +77,7 @@ const VIR_LOCK_SPACE_PROTOCOL_PROGRAM = 0xEA7BEEF;
const VIR_LOCK_SPACE_PROTOCOL_PROGRAM_VERSION = 1;
enum virLockSpaceProtocolProcedure {
- /* Each function must be preceeded by a comment providing one or
+ /* Each function must be preceded by a comment providing one or
* more annotations:
*
* - @generate: none|client|server|both
diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c
index 85dd100..5bc5cb1 100644
--- a/src/openvz/openvz_conf.c
+++ b/src/openvz/openvz_conf.c
@@ -215,7 +215,7 @@ openvzReadNetworkConf(virDomainDefPtr def,
/*parse routing network configuration*
* Sample from config:
* IP_ADDRESS="1.1.1.1 1.1.1.2"
- * splited IPs by space
+ * splitted IPs by space
*/
ret = openvzReadVPSConfigParam(veid, "IP_ADDRESS", &temp);
if (ret < 0) {
@@ -243,7 +243,7 @@ openvzReadNetworkConf(virDomainDefPtr def,
/*parse bridge devices*/
/*Sample from config:
*NETIF="ifname=eth10,mac=00:18:51:C1:05:EE,host_ifname=veth105.10,host_mac=00:18:51:8F:D9:F3"
- *devices splited by ';'
+ *devices splitted by ';'
*/
ret = openvzReadVPSConfigParam(veid, "NETIF", &temp);
if (ret < 0) {
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 889e614..a5c6879 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -2296,7 +2296,7 @@ virQEMUCapsProbeQMPKVMState(virQEMUCapsPtr qemuCaps,
/* The QEMU_CAPS_KVM flag was initially set according to the QEMU
* reporting the recognition of 'query-kvm' QMP command. That merely
- * indicates existance of the command though, not whether KVM support
+ * indicates existence of the command though, not whether KVM support
* is actually available, nor whether it is enabled by default.
*
* If it is not present we need to clear the flag, and if it is
diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h
index bad6ac0..0866c6b 100644
--- a/src/qemu/qemu_command.h
+++ b/src/qemu/qemu_command.h
@@ -39,7 +39,7 @@
# define QEMU_FSDEV_HOST_PREFIX "fsdev-"
/* These are only defaults, they can be changed now in qemu.conf and
- * explicitely specified port is checked against these two (makes
+ * explicitly specified port is checked against these two (makes
* sense to limit the values).
*
* This limitation is mentioned in qemu.conf, so bear in mind that the
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index e58fa3f..5970585 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -1304,7 +1304,7 @@ qemuGetProcessInfo(unsigned long long *cpuTime, int *lastCpu, long *vm_rss,
/* We got jiffies
* We want nanoseconds
* _SC_CLK_TCK is jiffies per second
- * So calulate thus....
+ * So calculate thus....
*/
if (cpuTime)
*cpuTime = 1000ull * 1000ull * 1000ull * (usertime + systime) / (unsigned long long)sysconf(_SC_CLK_TCK);
@@ -2934,7 +2934,7 @@ qemuDomainSaveMemory(virQEMUDriverPtr driver,
* we don't have an explicit offset in the header, so we fake
* it by padding the XML string with NUL bytes. Additionally,
* we want to ensure that virDomainSaveImageDefineXML can supply
- * slightly larger XML, so we add a miminum padding prior to
+ * slightly larger XML, so we add a minimum padding prior to
* rounding out to page boundaries.
*/
pad = 1024;
@@ -12509,7 +12509,7 @@ qemuDomainSnapshotPrepareDiskInternal(virConnectPtr conn,
{
int actualType;
- /* active disks are handeled by qemu itself so no need to worry about those */
+ /* active disks are handled by qemu itself so no need to worry about those */
if (active)
return 0;
diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c
index bfac11c..01a384a 100644
--- a/src/security/security_selinux.c
+++ b/src/security/security_selinux.c
@@ -178,7 +178,7 @@ virSecuritySELinuxMCSFind(virSecurityManagerPtr mgr,
* the category part, since that's what we're really
* interested in. This won't work in Enforcing mode,
* but will prevent libvirtd breaking in Permissive
- * mode when run with a wierd process label.
+ * mode when run with a weird process label.
*/
static int
virSecuritySELinuxMCSGetProcessRange(char **sens,
diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend_fs.c
index fa5eba1..3694c26 100644
--- a/src/storage/storage_backend_fs.c
+++ b/src/storage/storage_backend_fs.c
@@ -1196,7 +1196,7 @@ virStorageBackendFileSystemVolRefresh(virConnectPtr conn,
if (ret < 0)
return ret;
- /* Load any secrets if posible */
+ /* Load any secrets if possible */
if (vol->target.encryption &&
vol->target.encryption->format == VIR_STORAGE_ENCRYPTION_FORMAT_QCOW &&
vol->target.encryption->nsecrets == 0) {
diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c
index 69f6c11..1e0ec0e 100644
--- a/src/uml/uml_driver.c
+++ b/src/uml/uml_driver.c
@@ -1337,7 +1337,7 @@ static int umlGetProcessInfo(unsigned long long *cpuTime, pid_t pid)
/* We got jiffies
* We want nanoseconds
* _SC_CLK_TCK is jiffies per second
- * So calulate thus....
+ * So calculate thus....
*/
*cpuTime = 1000ull * 1000ull * 1000ull * (usertime + systime) / (unsigned long long)sysconf(_SC_CLK_TCK);
diff --git a/src/util/virstring.c b/src/util/virstring.c
index b2184f3..64c7259 100644
--- a/src/util/virstring.c
+++ b/src/util/virstring.c
@@ -758,7 +758,7 @@ virStringSearch(const char *str,
* @oldneedle: the substring to locate
* @newneedle: the substring to insert
*
- * Search @haystack and replace all occurences of @oldneedle with @newneedle.
+ * Search @haystack and replace all occurrences of @oldneedle with @newneedle.
*
* Returns: a new string with all the replacements, or NULL on error
*/
diff --git a/src/vmware/vmware_conf.c b/src/vmware/vmware_conf.c
index 5ff6396..29ca322 100644
--- a/src/vmware/vmware_conf.c
+++ b/src/vmware/vmware_conf.c
@@ -392,7 +392,7 @@ vmwareVmxPath(virDomainDefPtr vmdef, char **vmxPath)
/*
* Build VMX URL. Use the source of the first file-based harddisk
* to deduce the path for the VMX file. Don't just use the
- * first disk, because it may be CDROM disk and ISO images are normaly not
+ * first disk, because it may be CDROM disk and ISO images are normally not
* located in the virtual machine's directory. This approach
* isn't perfect but should work in the majority of cases.
*/
diff --git a/src/xen/xs_internal.c b/src/xen/xs_internal.c
index 0f7b7d2..8702b1a 100644
--- a/src/xen/xs_internal.c
+++ b/src/xen/xs_internal.c
@@ -355,7 +355,7 @@ xenStoreDomainGetVNCPort(virConnectPtr conn, int domid)
* serial console is attached.
*
* Returns the path to the serial console. It is the callers
- * responsibilty to free() the return string. Returns NULL
+ * responsibility to free() the return string. Returns NULL
* on error
*
* The caller must hold the lock on the privateData
@@ -376,7 +376,7 @@ xenStoreDomainGetConsolePath(virConnectPtr conn, int domid)
* serial console is attached.
*
* Returns the path to the serial console. It is the callers
- * responsibilty to free() the return string. Returns NULL
+ * responsibility to free() the return string. Returns NULL
* on error
*
* The caller must hold the lock on the privateData
--
1.7.1
10 years, 8 months
[libvirt] [PATCHv2 0/9] RelaxNG improvements for virStorageSource
by Eric Blake
changes since v1:
ack'd patch pushed
new patches 2-4 are a better rewrite of old patch 3/6
new patches 8 and 9
patch 9 is incomplete - I know where I want to be headed, but
changing 400+ tests is taking a while. I tried:
$ git grep -l '<driver.*type=' tests/*data/ | \
xargs sed '
/<driver .*type=\(\(.\)[a-zA-Z0-9]*\2\)/ h;
/<source /{
x;
s/<driver.*type=\(\(.\)[a-zA-Z0-9]*\2\).*>/<format type=\1>/;
G;
}'
as a way to automate the majority of the tedium, with some limited
success (it has false positives in the lxc <filesystem> elements,
when we really only want to affect <disk> elements>), but have not
completed the efforts. I'm posting the patches now, in the hopes
that 1-8 can be approved, and 9 picked up by someone else if I'm
unresponsive for a while (I'll be offline for much of this week due
to the birth of my fourth child).
Eric Blake (9):
conf: better <disk> interleaving in schema
conf: move storage formats to common RNG file
conf: restrict external snapshots to backing store formats
conf: set up for per-grammar overrides in schemas
conf: split <disk> schema into more pieces
conf: move storage source details to common RNG file
conf: move <auth> and <encryption> to disk source
conf: fix omission of <driver> in domain dumpxml
RFC: conf: introduce <format> as synonym of <driver type=...>
docs/formatdomain.html.in | 19 +-
docs/schemas/domain.rng | 14 +-
docs/schemas/domaincommon.rng | 288 ++------------------
docs/schemas/domainsnapshot.rng | 74 ++----
docs/schemas/storagecommon.rng | 293 +++++++++++++++++++++
docs/schemas/storagevol.rng | 13 +-
src/conf/domain_conf.c | 36 ++-
src/conf/snapshot_conf.c | 7 +-
src/util/virstoragefile.c | 51 ++--
src/util/virstoragefile.h | 15 +-
.../qemuxml2argv-disk-drive-copy-on-read.args | 5 +
.../qemuxml2argv-disk-drive-copy-on-read.xml | 28 ++
.../qemuxml2argv-disk-drive-discard.xml | 10 +-
.../qemuxml2argv-disk-source-pool.xml | 12 +-
tests/qemuxml2argvtest.c | 3 +
.../qemuxml2xmlout-disk-drive-discard.xml | 37 +++
.../qemuxml2xmlout-disk-source-pool.xml | 44 ++++
tests/qemuxml2xmltest.c | 5 +-
18 files changed, 574 insertions(+), 380 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-drive-copy-on-read.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-drive-copy-on-read.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-drive-discard.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-source-pool.xml
--
1.9.0
10 years, 8 months
[libvirt] Fwd: Start contributing with Libvirt (Finding a mentor or helpful tips)
by Julio Faracco
Hi everybody!
I sent an e-mail to Daniel asking about contributing to the libvirt
community for free.
So, I copied the e-mail to the libvirt mailing list as Daniel suggested me.
If anyone can help me I'd be pleased.
Thanks very much!
*--*
*Julio Cesar Faracco*
*University of São Paulo - Brazil*
---------- Forwarded message ----------
From: Julio Faracco <jcfaracco(a)gmail.com>
Date: 2014-03-29 13:45 GMT-03:00
Subject: Start contributing with Libvirt (Finding a mentor or helpful tips)
To: dan(a)berrange.com
Hi Daniel.
My name is Julio and I sent this e-mail because I would like to contribute
with libvirt. Moreover, I follow the libvirt mailing list for a long time
and have read the ideas page of libvirt, qemu and KVM of Google Summer of
Code program. I thought the ideas very interesting but I didn't have time
to propose my ideais or submit a patch. But I don't know a good way to
start doing that.
I want to contribute with libvirt for free (not like GSoC who pays a
paycheck for it). I think that contributing with a project like libvirt
enhances some of my programming skills. Today I work with Linux
distribution management and not with programing itself. However, I'm
finding some troubles to start. For example:
- Can I fix a random open bug?
- How to understand which bug can be easier to solve?
- How to follow the conversation of the mailing list? Sometimes I feel so
lost.
I was looking for a mentor (if you know someone who could help me) or a
person who can help me to follow the right way to start it.
Thanks very much.
*--*
*Julio Cesar Faracco*
*University of São Paulo - Brazil*
10 years, 8 months
[libvirt] [PATCH] maint: update to latest gnulib
by Eric Blake
Among other patches, Natanael Copa contributed a fix for
pyshmem_available when using musl libc that directly affects
libvirt.
* .gnulib: Update to latest, in part for musl libc compat.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
Pushing under the gnulib rule, since we are not in release freeze.
* .gnulib ce457d6...e8e0eb6 (18):
> gitlog-to-changelog: revert inclusion of git-log-fix file
> maint.mk: Relax the copyright check to cater for non FSF projects
> physmem: use sysinfo if _SC_PHYS_PAGES unavailable
> exclude: port to strict C99
> regex: do not depend on malloc-gnu
> autoupdate
> expl: avoid incorrect expl(small_value) on OpenBSD 5.4
> xalloc: allow x2nrealloc (P, PN, S) where P && !*PN
> fts: avoid unnecessary strlen calls
> fts: avoid unnecessary strlen calls
> fts: avoid unnecessary strlen calls
> autoupdate
> autoupdate
> obstack: Remove ancient NeXTSTEP gcc support conditional
> obstack: merge with glibc changes
> strftime: wrap macros in "do {...} while(0)"
> modechange: avoid memory leaks for invalid octal modes
> autoupdate
.gnulib | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.gnulib b/.gnulib
index ce457d6..e8e0eb6 160000
--- a/.gnulib
+++ b/.gnulib
@@ -1 +1 @@
-Subproject commit ce457d622d947d8aa3e325d98a2818d097e7fec9
+Subproject commit e8e0eb6bfb728685ec8d5afd924e41b18e9d928d
--
1.9.0
10 years, 8 months
[libvirt] [PATCH v2] virsh: Separate 'create'/'modify' message for secret-define
by Li Yang
The current message of secret-define always be:
Secret 09a9736f-eedb-449c-9983-80d0ab67393f created
even you just modify the secret, perhaps this may puzzle uses. Now
this patch make the modify action output message like this:
Secret f2d1bafc-ac58-4a47-93e4-47723686fef5 modified
Signed-off-by: Li Yang <liyang.fnst(a)cn.fujitsu.com>
---
tools/virsh-secret.c | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/tools/virsh-secret.c b/tools/virsh-secret.c
index 10d5db3..47974fe 100644
--- a/tools/virsh-secret.c
+++ b/tools/virsh-secret.c
@@ -96,6 +96,8 @@ cmdSecretDefine(vshControl *ctl, const vshCmd *cmd)
char *buffer;
virSecretPtr res;
char uuid[VIR_UUID_STRING_BUFLEN];
+ virSecretDefPtr new_attrs;
+ virSecretPtr new_res;
bool ret = false;
if (vshCommandOptStringReq(ctl, cmd, "file", &from) < 0)
@@ -104,6 +106,14 @@ cmdSecretDefine(vshControl *ctl, const vshCmd *cmd)
if (virFileReadAll(from, VSH_MAX_XML_FILE, &buffer) < 0)
return false;
+ if (!(new_attrs = virSecretDefParseString(buffer))) {
+ VIR_FREE(buffer);
+ return false;
+ }
+
+ new_res = virSecretLookupByUUID(ctl->conn, new_attrs->uuid);
+ new_attrs = NULL;
+
if (!(res = virSecretDefineXML(ctl->conn, buffer, 0))) {
vshError(ctl, _("Failed to set attributes from %s"), from);
goto cleanup;
@@ -114,13 +124,19 @@ cmdSecretDefine(vshControl *ctl, const vshCmd *cmd)
goto cleanup;
}
- vshPrint(ctl, _("Secret %s created\n"), uuid);
+ if (new_res == NULL)
+ vshPrint(ctl, _("Secret %s created\n"), uuid);
+ else
+ vshPrint(ctl, _("Secret %s modified\n"), uuid);
ret = true;
cleanup:
VIR_FREE(buffer);
+ virSecretDefFree(new_attrs);
if (res)
virSecretFree(res);
+ if (new_res)
+ virSecretFree(new_res);
return ret;
}
--
1.7.1
10 years, 8 months
Re: [libvirt] [PATCH] virsh: Separate 'create'/'modify' message for secret-define
by Li, Yang
> On Fri, Apr 18, 2014 at 12:20:26 +0200, Martin Kletzander wrote:
> > On Fri, Apr 18, 2014 at 04:27:10AM -0400, Li Yang wrote:
> > >The current message of secret-define always be:
> > >Secret 09a9736f-eedb-449c-9983-80d0ab67393f created
> >
> > >even you just modify the secret, perhaps this may puzzle
> > >uses. Now this patch make the modify action output message
> > >like this:
> > >Secret f2d1bafc-ac58-4a47-93e4-47723686fef5 modified
> > >
> > >Signed-off-by: Li Yang <liyang.fnst(a)cn.fujitsu.com>
> > >---
> > > tools/virsh-secret.c | 16 +++++++++++++++-
> > > 1 files changed, 15 insertions(+), 1 deletions(-)
> > >
> > >diff --git a/tools/virsh-secret.c b/tools/virsh-secret.c
> > >index 10d5db3..d1cbe04 100644
> > >--- a/tools/virsh-secret.c
> > >+++ b/tools/virsh-secret.c
> > >@@ -39,6 +39,7 @@
> > > #include "virutil.h"
> > > #include "virxml.h"
> > > #include "conf/secret_conf.h"
> > >+#include "viruuid.h"
> > >
> > > static virSecretPtr
> > > vshCommandOptSecret(vshControl *ctl, const vshCmd *cmd, const char **name)
> > >@@ -96,6 +97,7 @@ cmdSecretDefine(vshControl *ctl, const vshCmd *cmd)
> > > char *buffer;
> > > virSecretPtr res;
> > > char uuid[VIR_UUID_STRING_BUFLEN];
> > >+ virSecretDefPtr new_attrs;
> > > bool ret = false;
> > >
> > > if (vshCommandOptStringReq(ctl, cmd, "file", &from) < 0)
> > >@@ -104,6 +106,12 @@ cmdSecretDefine(vshControl *ctl, const vshCmd *cmd)
> > > if (virFileReadAll(from, VSH_MAX_XML_FILE, &buffer) < 0)
> > > return false;
> > >
> > >+ new_attrs = virSecretDefParseString(buffer);
> > >+ if (new_attrs == NULL){
> > >+ VIR_FREE(buffer);
> > >+ return false;
> > >+ }
> > >+
> > > if (!(res = virSecretDefineXML(ctl->conn, buffer, 0))) {
> > > vshError(ctl, _("Failed to set attributes from %s"), from);
> > > goto cleanup;
> > >@@ -114,10 +122,16 @@ cmdSecretDefine(vshControl *ctl, const vshCmd *cmd)
> > > goto cleanup;
> > > }
> > >
> > >- vshPrint(ctl, _("Secret %s created\n"), uuid);
> > >+ char uuidstr[VIR_UUID_STRING_BUFLEN];
> > >+ virUUIDFormat(new_attrs->uuid, uuidstr);
> > >+ if (memcmp(uuid, uuidstr, VIR_UUID_BUFLEN) == 0)
> > >+ vshPrint(ctl, _("Secret %s modified\n"), uuid);
> > >+ else
> > >+ vshPrint(ctl, _("Secret %s created\n"), uuid);
> > > ret = true;
> >
> > You'll still print 'modified' if the new created secret has an uuid in
> > the file already, plus it does more parsing, etc. Wouldn't it be
> > easier to just do s/created/defined/ ?
>
> Also you compare just the first VIR_UUID_BUFLEN characters in UUID
> string. I agree with Martin.
>
> Jirka
Oh, yes, you are right, I didn't notice that. I will try another way to cover this situation.
If I cannot find an easy way to solve this problem, I think we'd better leave it at that,
Modify "created" to "defined" seems not enough useful for uses...
After all, secret-undefine command's output is "Secret *** deleted", it's correspond
to secret-define command's output "Secret *** created".
10 years, 8 months
Re: [libvirt] [PATCH] virsh: Make secret's usage can be modified if the usage isn't used
by Li, Yang
Ping!
> When a secret's usage is specified, for example:
> <secret ephemeral='no' private='no'>
> <uuid>540c56d1-f4b3-5031-b76d-33e99e9b5c64</uuid>
> <usage type='volume'>
> <volume>/tmp/test</volume>
> </usage>
> </secret>
> If another volume '/tmp/test1' isn't used, the current secret's usage can bo modified to '/tmp/test1'.
> If '/tmp/test1' has been used for another secret, error message will be outputed.
>
> Signed-off-by: Li Yang <liyang.fnst(a)cn.fujitsu.com>
> ---
> src/secret/secret_driver.c | 18 +++++++++++-------
> 1 files changed, 11 insertions(+), 7 deletions(-)
10 years, 8 months
[libvirt] [PATCH v2] bhyve: implement PCI address allocation
by Roman Bogorodskiy
Changes from v1:
- Reserve slot 1 for LPC PCI-ISA bridge, used by console device
- Respect addresses provided by user in domain xml file
- Fix tests so 'make check' passes
Roman Bogorodskiy (1):
bhyve: implement PCI address allocation
po/POTFILES.in | 1 +
src/Makefile.am | 4 +
src/bhyve/bhyve_command.c | 131 ++++-----
src/bhyve/bhyve_device.c | 308 +++++++++++++++++++++
src/bhyve/bhyve_device.h | 41 +++
src/bhyve/bhyve_domain.c | 75 +++++
src/bhyve/bhyve_domain.h | 41 +++
src/bhyve/bhyve_driver.c | 9 +-
.../bhyvexml2argvdata/bhyvexml2argv-acpiapic.args | 2 +-
tests/bhyvexml2argvdata/bhyvexml2argv-acpiapic.xml | 2 +
tests/bhyvexml2argvdata/bhyvexml2argv-base.args | 2 +-
tests/bhyvexml2argvdata/bhyvexml2argv-base.xml | 2 +
tests/bhyvexml2argvdata/bhyvexml2argv-console.args | 4 +-
tests/bhyvexml2argvdata/bhyvexml2argv-console.xml | 2 +
.../bhyvexml2argv-disk-virtio.args | 2 +-
.../bhyvexml2argv-disk-virtio.xml | 2 +
tests/bhyvexml2argvdata/bhyvexml2argv-macaddr.args | 2 +-
tests/bhyvexml2argvdata/bhyvexml2argv-macaddr.xml | 2 +
tests/bhyvexml2argvdata/bhyvexml2argv-serial.args | 4 +-
tests/bhyvexml2argvdata/bhyvexml2argv-serial.xml | 2 +
20 files changed, 559 insertions(+), 79 deletions(-)
create mode 100644 src/bhyve/bhyve_device.c
create mode 100644 src/bhyve/bhyve_device.h
create mode 100644 src/bhyve/bhyve_domain.c
create mode 100644 src/bhyve/bhyve_domain.h
--
1.9.0
10 years, 8 months