Re: [libvirt] [PATCH 11/17] Add functions for adding USB controllers to addrs
Hi, > +case VIR_DOMAIN_CONTROLLER_MODEL_USB_NEC_XHCI: > +return 4; That one is configurable via "ports=...": cheers, Gerd -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 14/17] Assign addresses to USB devices
On Fr, 2016-06-17 at 20:07 +0200, Ján Tomko wrote: > Automatically assign addresses to USB devices. > > Just like reserving, this is only done for newly defined domains. What happens if I add a device to a guest (using virsh edit)? cheers, Gerd -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH] vz: handle gracefully races on undefining domain
This patch is not critical but nice to have. The original motivation was error message in logs on undefining domain thru vz driver. Undefine procedure drops domain lock while waiting for detaching disks vz sdk call. Meanwhile vz sdk event domain-config-changed arrives, its handler finds domain and is blocked waiting for job condition. After undefine API call finishes event processing procedes and tries to refreshes domain config thru existing vz sdk domain handle. Domain does not exists anymore and event processing fails. Everything is fine we just don't want to see error message in log for this particular case. Fortunately domain has flag that domain is removed from list. This also imply that vz sdk domain is also undefined. Thus if we check for this flag right after domain is locked again on accuiring job condition we gracefully handle this situation. Actually the race can happen in other situations too. Any time we wait for job condition in mutualy exclusive job in time when we acquire it vz sdk domain can cease to exist. So instead of general internal error we can return domain not found which is easier to handle. We don't need to patch other places in mutually exclusive jobs where domain lock is dropped as if job is started domain can't be undefine by mutually exclusive undefine job. In case of API calls that are not jobs (load snapshots etc) we'd better to check if domain exists every time domain lock is reacquired. Fortunately these calls drop domain lock only once to call appropriate vz sdk API call. The code of this patch is quite similar to qemu driver checks for is domain is active after acquiring a job. The difference only while qemu domain is operational while process is active vz domain is operational while domain exists. Signed-off-by: Nikolay Shirokovskiy --- src/vz/vz_driver.c | 46 ++ src/vz/vz_sdk.c| 32 +--- 2 files changed, 75 insertions(+), 3 deletions(-) diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c index 6a508b3..67db2d9 100644 --- a/src/vz/vz_driver.c +++ b/src/vz/vz_driver.c @@ -716,6 +716,22 @@ vzDomainGetAutostart(virDomainPtr domain, int *autostart) return 0; } +static bool +vzDomainObjIsExist(virDomainObjPtr dom) +{ +char uuidstr[VIR_UUID_STRING_BUFLEN]; + +if (!dom->removing) +return true; + +virUUIDFormat(dom->def->uuid, uuidstr); +virReportError(VIR_ERR_NO_DOMAIN, + _("no domain with matching uuid '%s' (%s)"), + uuidstr, dom->def->name); + +return false; +} + static virDomainPtr vzDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flags) { @@ -782,6 +798,9 @@ vzDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flags) goto cleanup; job = true; +if (!vzDomainObjIsExist(dom)) +goto cleanup; + if (prlsdkApplyConfig(driver, dom, def)) goto cleanup; @@ -1012,6 +1031,9 @@ vzDomainUndefineFlags(virDomainPtr domain, goto cleanup; job = true; +if (!vzDomainObjIsExist(dom)) +goto cleanup; + ret = prlsdkUnregisterDomain(privconn->driver, dom, flags); cleanup: @@ -1069,6 +1091,9 @@ vzDomainManagedSave(virDomainPtr domain, unsigned int flags) goto cleanup; job = true; +if (!vzDomainObjIsExist(dom)) +goto cleanup; + state = virDomainObjGetState(dom, &reason); if (state == VIR_DOMAIN_RUNNING && (flags & VIR_DOMAIN_SAVE_PAUSED)) { @@ -1159,6 +1184,9 @@ static int vzDomainAttachDeviceFlags(virDomainPtr domain, const char *xml, goto cleanup; job = true; +if (!vzDomainObjIsExist(dom)) +goto cleanup; + switch (dev->type) { case VIR_DOMAIN_DEVICE_DISK: ret = prlsdkAttachVolume(privconn->driver, dom, dev->data.disk); @@ -1227,6 +1255,9 @@ static int vzDomainDetachDeviceFlags(virDomainPtr domain, const char *xml, goto cleanup; job = true; +if (!vzDomainObjIsExist(dom)) +goto cleanup; + switch (dev->type) { case VIR_DOMAIN_DEVICE_DISK: ret = prlsdkDetachVolume(dom, dev->data.disk); @@ -1284,6 +1315,9 @@ vzDomainSetUserPassword(virDomainPtr domain, goto cleanup; job = true; +if (!vzDomainObjIsExist(dom)) +goto cleanup; + ret = prlsdkDomainSetUserPassword(dom, user, password); cleanup: @@ -1617,6 +1651,9 @@ static int vzDomainSetMemoryFlagsImpl(virDomainPtr domain, unsigned long memory, goto cleanup; job = true; +if (!vzDomainObjIsExist(dom)) +goto cleanup; + ret = prlsdkSetMemsize(dom, memory >> 10); cleanup: @@ -2101,6 +2138,9 @@ vzDomainSnapshotCreateXML(virDomainPtr domain, goto cleanup; job = true; +if (!vzDomainObjIsExist(dom)) +goto cleanup; + /* snaphot name is ignored, it will be set to auto generated by sdk uu
Re: [libvirt] [PATCH] qemu: Don't use legacy USB for aarch64 mach-virt guests
On Sat, 2016-06-18 at 10:12 +0200, Andrew Jones wrote: > > > ACK from me. > > > > Great, thanks! I'll wait for Drew's thumbs up before > > actually pushing this, though. > > Thumbs up. > > -usb should probably even be removed from QEMU. The help > text says > > -usbenable the USB driver (will be the default soon) > > I got tired of trying to hunt down the commit that added > the 'default soon' stuff since it's so old... Cool, I just pushed it. Thanks! -- Andrea Bolognani Software Engineer - Virtualization Team -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH] virsh migrate: Fix positional parameters
Thanks to our smart option parser which automatically assigns positional parameters the following (previously working) command fails: virsh migrate test qemu+ssh://1.2.3.4/system tcp://1.2.3.4/ error: invalid argument: Unsupported compression method 'tcp://1.2.3.4/' We need to make sure new options are added at the end of the list rather than where they logically belong. Reported by Brian Rak. Signed-off-by: Jiri Denemark --- tools/virsh-domain.c | 40 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 02be58f..19c40b3 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -9792,26 +9792,6 @@ static const vshCmdOptDef opts_migrate[] = { .type = VSH_OT_BOOL, .help = N_("compress repeated pages during live migration") }, -{.name = "comp-methods", - .type = VSH_OT_STRING, - .help = N_("comma separated list of compression methods to be used") -}, -{.name = "comp-mt-level", - .type = VSH_OT_INT, - .help = N_("compress level for multithread compression") -}, -{.name = "comp-mt-threads", - .type = VSH_OT_INT, - .help = N_("number of compression threads for multithread compression") -}, -{.name = "comp-mt-dthreads", - .type = VSH_OT_INT, - .help = N_("number of decompression threads for multithread compression") -}, -{.name = "comp-xbzrle-cache", - .type = VSH_OT_INT, - .help = N_("page cache size for xbzrle compression") -}, {.name = "auto-converge", .type = VSH_OT_BOOL, .help = N_("force convergence during live migration") @@ -9873,6 +9853,26 @@ static const vshCmdOptDef opts_migrate[] = { .type = VSH_OT_INT, .help = N_("port to use by target server for incoming disks migration") }, +{.name = "comp-methods", + .type = VSH_OT_STRING, + .help = N_("comma separated list of compression methods to be used") +}, +{.name = "comp-mt-level", + .type = VSH_OT_INT, + .help = N_("compress level for multithread compression") +}, +{.name = "comp-mt-threads", + .type = VSH_OT_INT, + .help = N_("number of compression threads for multithread compression") +}, +{.name = "comp-mt-dthreads", + .type = VSH_OT_INT, + .help = N_("number of decompression threads for multithread compression") +}, +{.name = "comp-xbzrle-cache", + .type = VSH_OT_INT, + .help = N_("page cache size for xbzrle compression") +}, {.name = NULL} }; -- 2.9.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v2 1/7] domain_conf: Validate redirdev after parsing
On Fri, Jun 10, 2016 at 05:32:55PM +0200, Michal Privoznik wrote: There's currently just one limitation: redirdevs that want to go on USB bus require a USB controller, surprisingly. At the same time, since I'm using virDomainDefHasUSB() in this new validator function, it has to be moved a few lines up and also its header needed to be changed a bit: it is now taking a const pointer to domain def since it's not changing anything in there. Signed-off-by: Michal Privoznik --- src/conf/domain_conf.c | 56 -- 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 85f6e31..c75279d 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -4567,14 +4567,45 @@ virDomainDiskDefValidate(const virDomainDiskDef *disk) return 0; } +static bool +virDomainDefHasUSB(const virDomainDef *def) +{ +size_t i; + +for (i = 0; i < def->ncontrollers; i++) { +if (def->controllers[i]->type == VIR_DOMAIN_CONTROLLER_TYPE_USB && +def->controllers[i]->model != VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE) +return true; +} This function returns false either if there is a model='none' USB controller or if there is none at all, + +return false; +} + @@ -17060,14 +17090,6 @@ virDomainDefParseXML(xmlDocPtr xml, if (!redirdev) goto error; -if (redirdev->bus == VIR_DOMAIN_REDIRDEV_BUS_USB && usb_none) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", -_("Can't add redirected USB device: " - "USB is disabled for this domain")); -virDomainRedirdevDefFree(redirdev); but this error was only reported for model="none'. This broke virt-manager's test: https://ci.centos.org/job/virt-manager-test/systems=libvirt-fedora-rawhide/1363/console Jan -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v2] maint: Switch to xz compressed PAX release archives
On Wed, Jun 15, 2016 at 10:31:16AM -0400, Laine Stump wrote: On 06/15/2016 09:03 AM, Andrea Bolognani wrote: This allows us to produce releases that are roughly a third in size, have no limitation on path length, and are still readable by all supported platforms. --- I just want to point out that the tarfile is built every time you run "make rpm" (which I do quite a lot - I prefer installing rpms to the carnage created by make install), and this increases the time for make rpm on my system by 1min38sec. (jtomko may have something to say about that, since he's been interested in shaving fractions of a second off the build time in the last few days :-O) Use: XZ_OPT="-3 --threads=0" make rpm The most important speedup comes from dropping the '-e' option which automake uses by default. (-1 is faster than -0 in my testing, -2 and -3 take a few seconds more but drop megabytes off the size. All of them are faster and result in a smaller size than gz --best we used before) On my RHEL, rpmbuild does not recompress sources by default, so this will leave you with a larger srpm. For binary data, the default level is 2: %_binary_payload w2.xzdio but even then the *rpms made with lower compression leves were marginally larger than the default ones. I did not find out why. Jan -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] vz: handle gracefully races on undefining domain
On 20.06.2016 10:40, Nikolay Shirokovskiy wrote: > This patch is not critical but nice to have. The original motivation > was error message in logs on undefining domain thru vz driver. > Undefine procedure drops domain lock while waiting for detaching > disks vz sdk call. Meanwhile vz sdk event domain-config-changed > arrives, its handler finds domain and is blocked waiting for job > condition. After undefine API call finishes event processing procedes > and tries to refreshes domain config thru existing vz sdk domain handle. > Domain does not exists anymore and event processing fails. Everything > is fine we just don't want to see error message in log for this > particular case. > > Fortunately domain has flag that domain is removed from list. This > also imply that vz sdk domain is also undefined. Thus if we check > for this flag right after domain is locked again on accuiring > job condition we gracefully handle this situation. > > Actually the race can happen in other situations too. Any > time we wait for job condition in mutualy exclusive job in > time when we acquire it vz sdk domain can cease to exist. > So instead of general internal error we can return domain > not found which is easier to handle. We don't need to patch > other places in mutually exclusive jobs where domain lock > is dropped as if job is started domain can't be undefine > by mutually exclusive undefine job. > > In case of API calls that are not jobs (load snapshots etc) we'd > better to check if domain exists every time domain lock is > reacquired. Fortunately these calls drop domain lock only > once to call appropriate vz sdk API call. > > The code of this patch is quite similar to qemu driver checks > for is domain is active after acquiring a job. The difference > only while qemu domain is operational while process is active > vz domain is operational while domain exists. > > Signed-off-by: Nikolay Shirokovskiy > --- > src/vz/vz_driver.c | 46 ++ > src/vz/vz_sdk.c| 32 +--- > 2 files changed, 75 insertions(+), 3 deletions(-) > [snip] Another case of hindsight is 20/20 )) I think the below changes are not good and should be dropped from the patch. We can't rely on 'removing' flag in case other then mutually exclusive jobs. > > +static void > +vzDomainObjCheckExist(virDomainObjPtr dom) > +{ > +char uuidstr[VIR_UUID_STRING_BUFLEN]; > + > +if (!dom->removing) > +return; > + > +virUUIDFormat(dom->def->uuid, uuidstr); > +virReportError(VIR_ERR_NO_DOMAIN, > + _("no domain with matching uuid '%s' (%s)"), > + uuidstr, dom->def->name); > +} > + > int > prlsdkDomainManagedSaveRemove(virDomainObjPtr dom) > { > @@ -3959,8 +3979,10 @@ prlsdkDomainManagedSaveRemove(virDomainObjPtr dom) > PRL_HANDLE job; > > job = PrlVm_DropSuspendedState(privdom->sdkdom); > -if (PRL_FAILED(waitDomainJob(job, dom))) > +if (PRL_FAILED(waitDomainJob(job, dom))) { > +vzDomainObjCheckExist(dom); > return -1; > +} > > return 0; > } > @@ -4394,8 +4416,10 @@ prlsdkLoadSnapshots(virDomainObjPtr dom) > char *treexml = NULL; > > job = PrlVm_GetSnapshotsTreeEx(privdom->sdkdom, > PGST_WITHOUT_SCREENSHOTS); > -if (PRL_FAILED(getDomainJobResult(job, dom, &result))) > +if (PRL_FAILED(getDomainJobResult(job, dom, &result))) { > +vzDomainObjCheckExist(dom); > goto cleanup; > +} > > if (!(treexml = prlsdkGetStringParamVar(PrlResult_GetParamAsString, > result))) > goto cleanup; > @@ -4427,8 +4451,10 @@ int prlsdkDeleteSnapshot(virDomainObjPtr dom, const > char *uuid, bool children) > PRL_HANDLE job; > > job = PrlVm_DeleteSnapshot(privdom->sdkdom, uuid, children); > -if (PRL_FAILED(waitDomainJob(job, dom))) > +if (PRL_FAILED(waitDomainJob(job, dom))) { > +vzDomainObjCheckExist(dom); > return -1; > +} > > return 0; > } > -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH 0/7] *** Add VirtualBox 5 support to libvirt ***
*** BLURB HERE *** Martin Pietsch (7): add VirtualBox 5 C API to libvirt add VirtualBox 5 support to vbox_tmpl.c add VirtualBox5 support to vbox_uniformed_api.h add vbox_V5_0.c for libvirt support of VirtualBox 5 append vbox_V5_0.c and vbox_CAPI_v5_0.h to src/Makefile.am add VirtualBox 5 support to vbox_common.h add VirtualBox 5 support to vbox_storage.c src/Makefile.am | 1 + src/vbox/vbox_CAPI_v5_0.h | 25550 src/vbox/vbox_V5_0.c |13 + src/vbox/vbox_common.h| 2 + src/vbox/vbox_storage.c | 2 + src/vbox/vbox_tmpl.c |84 +- src/vbox/vbox_uniformed_api.h | 1 + 7 files changed, 25647 insertions(+), 6 deletions(-) create mode 100644 src/vbox/vbox_CAPI_v5_0.h create mode 100644 src/vbox/vbox_V5_0.c -- 2.7.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH 0/2] vz: add getting job info for migration
Nikolay Shirokovskiy (2): vz: add getting job info for migration vz: add vzDomainGetJobStats src/vz/vz_driver.c | 113 + src/vz/vz_sdk.c| 31 +++ src/vz/vz_utils.c | 42 src/vz/vz_utils.h | 17 +++- 4 files changed, 194 insertions(+), 9 deletions(-) -- 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH 1/2] vz: add getting job info for migration
Unfortunately vz sdk do not provide detail information on migration progress, only progress percentage. Thus vz driver provides percents instead of bytes in data fields of virDomainJobInfoPtr. Signed-off-by: Nikolay Shirokovskiy --- src/vz/vz_driver.c | 42 ++ src/vz/vz_sdk.c| 31 +++ src/vz/vz_utils.c | 42 +++--- src/vz/vz_utils.h | 17 +++-- 4 files changed, 123 insertions(+), 9 deletions(-) diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c index b35469a..7be2a5a 100644 --- a/src/vz/vz_driver.c +++ b/src/vz/vz_driver.c @@ -2539,6 +2539,7 @@ vzDomainMigratePerformStep(virDomainPtr domain, { int ret = -1; virDomainObjPtr dom = NULL; +vzDomObjPtr privdom; virURIPtr vzuri = NULL; vzConnPtr privconn = domain->conn->privateData; const char *miguri = NULL; @@ -2573,6 +2574,8 @@ vzDomainMigratePerformStep(virDomainPtr domain, if (vzDomainObjBeginJob(dom) < 0) goto cleanup; job = true; +privdom = dom->privateData; +privdom->job.hasProgress = true; if (!vzDomainObjIsExist(dom)) goto cleanup; @@ -2794,6 +2797,44 @@ vzDomainMigrateConfirm3Params(virDomainPtr domain ATTRIBUTE_UNUSED, return 0; } +static int +vzDomainGetJobInfoImpl(virDomainObjPtr dom, virDomainJobInfoPtr info) +{ +vzDomObjPtr privdom = dom->privateData; +vzDomainJobObjPtr job = &privdom->job; + +memset(info, 0, sizeof(*info)); + +if (!job->active || !job->hasProgress) +return 0; + +if (vzDomainJobUpdateTime(job) < 0) +return -1; + +info->type = VIR_DOMAIN_JOB_UNBOUNDED; +info->dataTotal = 100; +info->dataProcessed = job->progress; +info->dataRemaining = 100 - job->progress; +info->timeElapsed = job->elapsed; + +return 0; +} + +static int +vzDomainGetJobInfo(virDomainPtr domain, virDomainJobInfoPtr info) +{ +virDomainObjPtr dom; +int ret; + +if (!(dom = vzDomObjFromDomain(domain))) +return -1; + +ret = vzDomainGetJobInfoImpl(dom, info); + +virObjectUnlock(dom); +return ret; +} + static virHypervisorDriver vzHypervisorDriver = { .name = "vz", .connectOpen = vzConnectOpen,/* 0.10.0 */ @@ -2884,6 +2925,7 @@ static virHypervisorDriver vzHypervisorDriver = { .domainMigratePerform3Params = vzDomainMigratePerform3Params, /* 1.3.5 */ .domainMigrateFinish3Params = vzDomainMigrateFinish3Params, /* 1.3.5 */ .domainMigrateConfirm3Params = vzDomainMigrateConfirm3Params, /* 1.3.5 */ +.domainGetJobInfo = vzDomainGetJobInfo, /* 2.0.0 */ }; static virConnectDriver vzConnectDriver = { diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c index 8abe223..bd67b21 100644 --- a/src/vz/vz_sdk.c +++ b/src/vz/vz_sdk.c @@ -1885,6 +1885,34 @@ prlsdkHandlePerfEvent(vzDriverPtr driver, virObjectUnlock(dom); } +static void +prlsdkHandleMigrationProgress(vzDriverPtr driver, + PRL_HANDLE event, + unsigned char *uuid) +{ +virDomainObjPtr dom = NULL; +vzDomObjPtr privdom = NULL; +PRL_UINT32 progress; +PRL_HANDLE param = PRL_INVALID_HANDLE; +PRL_RESULT pret; + +if (!(dom = virDomainObjListFindByUUID(driver->domains, uuid))) +return; + +pret = PrlEvent_GetParam(event, 0, ¶m); +prlsdkCheckRetGoto(pret, cleanup); + +pret = PrlEvtPrm_ToUint32(param, &progress); +prlsdkCheckRetGoto(pret, cleanup); + +privdom = dom->privateData; +privdom->job.progress = progress; + + cleanup: +PrlHandle_Free(param); +virObjectUnlock(dom); +} + static PRL_RESULT prlsdkEventsHandler(PRL_HANDLE prlEvent, PRL_VOID_PTR opaque) { @@ -1940,6 +1968,9 @@ prlsdkEventsHandler(PRL_HANDLE prlEvent, PRL_VOID_PTR opaque) case PET_DSP_EVT_DISP_CONNECTION_CLOSED: vzDestroyDriverConnection(); break; +case PET_DSP_EVT_VM_MIGRATE_PROGRESS_CHANGED: +prlsdkHandleMigrationProgress(driver, prlEvent, uuid); +break; default: VIR_DEBUG("Skipping event of type %d", prlEventType); } diff --git a/src/vz/vz_utils.c b/src/vz/vz_utils.c index dc8dbf3..92af4da 100644 --- a/src/vz/vz_utils.c +++ b/src/vz/vz_utils.c @@ -459,7 +459,7 @@ vzDomObjAlloc(void) if (VIR_ALLOC(pdom) < 0) return NULL; -if (virCondInit(&pdom->jobCond) < 0) +if (virCondInit(&pdom->job.cond) < 0) goto error; pdom->stats = PRL_INVALID_HANDLE; @@ -482,7 +482,7 @@ vzDomObjFree(void* p) PrlHandle_Free(pdom->sdkdom); PrlHandle_Free(pdom->stats); -virCondDestroy(&pdom->jobCond); +virCondDestroy(&pdom->job.cond); VIR_FREE(pdom); }; @@ -499,12 +499,19 @@ vzDomainObjBeginJob(virDomainObjPtr dom) return -1; then = now + VZ_JOB_WAIT_TIME; -while (pdom->job) { -if (virCondWaitUntil(&pdom->jobCond, &dom->parent.lock, then) < 0) +while (pdom->job.active) { +
[libvirt] [PATCH 2/2] vz: add vzDomainGetJobStats
Signed-off-by: Nikolay Shirokovskiy --- src/vz/vz_driver.c | 71 ++ 1 file changed, 71 insertions(+) diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c index 7be2a5a..8141a90 100644 --- a/src/vz/vz_driver.c +++ b/src/vz/vz_driver.c @@ -2835,6 +2835,76 @@ vzDomainGetJobInfo(virDomainPtr domain, virDomainJobInfoPtr info) return ret; } +static int +vzDomainJobInfoToParams(virDomainJobInfoPtr info, +int *type, +virTypedParameterPtr *params, +int *nparams) +{ +virTypedParameterPtr par = NULL; +int maxpar = 0; +int npar = 0; + +if (virTypedParamsAddULLong(&par, &npar, &maxpar, +VIR_DOMAIN_JOB_TIME_ELAPSED, +info->timeElapsed) < 0 || +virTypedParamsAddULLong(&par, &npar, &maxpar, +VIR_DOMAIN_JOB_DATA_TOTAL, +info->dataTotal) < 0 || +virTypedParamsAddULLong(&par, &npar, &maxpar, +VIR_DOMAIN_JOB_DATA_PROCESSED, +info->dataProcessed) < 0 || +virTypedParamsAddULLong(&par, &npar, &maxpar, +VIR_DOMAIN_JOB_DATA_REMAINING, +info->dataRemaining) < 0) +goto error; + + +*type = info->type; +*params = par; +*nparams = npar; +return 0; + + error: +virTypedParamsFree(par, npar); +return -1; +} + +static int +vzDomainGetJobStats(virDomainPtr domain, +int *type, +virTypedParameterPtr *params, +int *nparams, +unsigned int flags) +{ +virDomainJobInfo info; +virDomainObjPtr dom; +int ret = -1; + +virCheckFlags(0, -1); + +if (!(dom = vzDomObjFromDomain(domain))) +return -1; + +if (vzDomainGetJobInfoImpl(dom, &info) < 0) +goto cleanup; + +if (info.type == VIR_DOMAIN_JOB_NONE) { +*type = VIR_DOMAIN_JOB_NONE; +*params = NULL; +*nparams = 0; +ret = 0; +goto cleanup; +} + +ret = vzDomainJobInfoToParams(&info, type, params, nparams); + + cleanup: +virObjectUnlock(dom); + +return ret; +} + static virHypervisorDriver vzHypervisorDriver = { .name = "vz", .connectOpen = vzConnectOpen,/* 0.10.0 */ @@ -2926,6 +2996,7 @@ static virHypervisorDriver vzHypervisorDriver = { .domainMigrateFinish3Params = vzDomainMigrateFinish3Params, /* 1.3.5 */ .domainMigrateConfirm3Params = vzDomainMigrateConfirm3Params, /* 1.3.5 */ .domainGetJobInfo = vzDomainGetJobInfo, /* 2.0.0 */ +.domainGetJobStats = vzDomainGetJobStats, /* 2.0.0 */ }; static virConnectDriver vzConnectDriver = { -- 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 1/6] Remove virsh-all
On Fri, Jun 17, 2016 at 20:04:36 +0200, Ján Tomko wrote: > Since e8ac4a7 this test wastes some CPU cycles by blindly trying to > run almost every virsh command, blindly throwing away the output > and the return value and returning success if 'virsh help' successfully > returned at least one command. > > Drop it completely. > --- > tests/Makefile.am | 1 - > tests/virsh-all | 52 > 2 files changed, 53 deletions(-) > delete mode 100755 tests/virsh-all [...] > diff --git a/tests/virsh-all b/tests/virsh-all > deleted file mode 100755 > index 4a91e4e..000 > --- a/tests/virsh-all > +++ /dev/null > @@ -1,52 +0,0 @@ > -counter=0 > -for i in $cmds; do > -counter=`eval "expr $counter + 1"` > - > -# For now, just run the command and ignore output > -$abs_top_builddir/tools/virsh -c $test_url $i < /dev/null > /dev/null > 2>&1 > -# Temporarily ignoring exit status > -#status=$? > -status=0 Lol! > -test_result $counter $i $status ACK -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] virsh migrate: Fix positional parameters
On Mon, 2016-06-20 at 10:31 +0200, Jiri Denemark wrote: > Thanks to our smart option parser which automatically assigns positional > parameters the following (previously working) command fails: > > virsh migrate test qemu+ssh://1.2.3.4/system tcp://1.2.3.4/ > error: invalid argument: Unsupported compression method > 'tcp://1.2.3.4/' > > We need to make sure new options are added at the end of the list rather > than where they logically belong. > > Reported by Brian Rak. > > Signed-off-by: Jiri Denemark > --- > tools/virsh-domain.c | 40 > 1 file changed, 20 insertions(+), 20 deletions(-) ACK -- Andrea Bolognani Software Engineer - Virtualization Team -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] virsh migrate: Fix positional parameters
On Mon, Jun 20, 2016 at 10:31:32AM +0200, Jiri Denemark wrote: > Thanks to our smart option parser which automatically assigns positional > parameters the following (previously working) command fails: > > virsh migrate test qemu+ssh://1.2.3.4/system tcp://1.2.3.4/ > error: invalid argument: Unsupported compression method > 'tcp://1.2.3.4/' > > We need to make sure new options are added at the end of the list rather > than where they logically belong. > > Reported by Brian Rak. > > Signed-off-by: Jiri Denemark > --- > tools/virsh-domain.c | 40 > 1 file changed, 20 insertions(+), 20 deletions(-) ACK -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] virsh: introduce name-uuid for list command
At 2016-06-15 17:36:05, "Chen Hanxiao" wrote: >From: Chen Hanxiao > >This patch will show both name and UUID of domain: > > IdName State UUID > --- > 3 f23running > 918f1dd6-b19f-412b-ba17-d113bad89af8 > >Signed-off-by: Chen Hanxiao >--- ping? Regards, - Chen -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH] docs: virsh: Added note for the dump command
From: Jaroslav Suchanek Crash dump in a old kvmdump format is being obsolete and cannot be loaded and processed by crash utility since its version 6.1.0. A --memory-only option is required in order to produce valid ELF file which can be later processed by the crash utility. A new note is added to the dump command description. --- tools/virsh.pod | 5 + 1 file changed, 5 insertions(+) diff --git a/tools/virsh.pod b/tools/virsh.pod index 98fed76..8e3ba69 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -1355,6 +1355,11 @@ B command. I<--verbose> displays the progress of dump. NOTE: Some hypervisors may require the user to manually ensure proper permissions on file and path specified by argument I. +NOTE: Crash dump in a old kvmdump format is being obsolete and cannot be loaded +and processed by crash utility since its version 6.1.0. A --memory-only option +is required in order to produce valid ELF file which can be later processed by +the crash utility. + =item B I [I<--inactive>] [I<--security-info>] [I<--update-cpu>] [I<--migratable>] -- 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] gnulib and 32-bit libvirt build, rpl_canonicalize_file_name
The Xen Project's automated test (CI) system has reported a build failure in libvirt; libvirt uses gnulib. osstest has bisected it to a specific gnulib commit. (Email from osstest is quoted below.) The error message is: ../gnulib/lib/.libs/libgnu.a(canonicalize-lgpl.o): In function `rpl_canonicalize_file_name': /home/osstest/build.95966.build-i386-libvirt/libvirt/gnulib/lib/canonicalize-lgpl.c:400: multiple definition of `rpl_canonicalize_file_name' .libs/virpcimock_la-virpcimock.o:/home/osstest/build.95966.build-i386-libvirt/libvirt/tests/virpcimock.c:954: first defined here collect2: error: ld returned 1 exit status Do you already know about this ? Would you like us to submit a patch to gnulib ? Thanks, Ian. osstest service owner writes ("[qemu-upstream-4.3-testing bisection] complete build-i386-libvirt"): > branch xen-4.3-testing > xenbranch xen-4.3-testing > job build-i386-libvirt > testid libvirt-build > > Tree: libvirt git://xenbits.xen.org/libvirt.git > Tree: libvirt_gnulib git://git.sv.gnu.org/gnulib.git > Tree: qemu git://xenbits.xen.org/qemu-xen-traditional.git > Tree: qemuu git://xenbits.xen.org/qemu-xen.git > Tree: xen git://xenbits.xen.org/xen.git > > *** Found and reproduced problem changeset *** > > Bug is in tree: libvirt_gnulib git://git.sv.gnu.org/gnulib.git > Bug introduced: 54615b95ff238e235e806855efc46a9abad09f2e > Bug not present: e78f894d0bdc770101bc040613f4ea94e45f38f7 > Last fail repro: http://logs.test-lab.xenproject.org/osstest/logs/95966/ > > > commit 54615b95ff238e235e806855efc46a9abad09f2e > Author: Paul Eggert > Date: Sat Feb 6 18:11:48 2016 -0800 > > misc: port better to gcc -fsanitize=address > > Without these patches, ./configure CFLAGS='-fsanitize=address' > would compute incorrect values. This patch fixes some (but not all) > test failures with recent glibc, with this configuration. > * m4/acl.m4 (gl_ACL_GET_FILE): > * m4/calloc.m4 (_AC_FUNC_CALLOC_IF): > * m4/canonicalize.m4 (gl_FUNC_REALPATH_WORKS): > * m4/d-ino.m4 (gl_CHECK_TYPE_STRUCT_DIRENT_D_INO): > * m4/duplocale.m4 (gl_FUNC_DUPLOCALE): > * m4/getcwd.m4 (gl_FUNC_GETCWD_NULL): > * m4/getdelim.m4 (gl_FUNC_GETDELIM): > * m4/getgroups.m4 (gl_FUNC_GETGROUPS): > * m4/getline.m4 (gl_FUNC_GETLINE): > * m4/malloc.m4 (_AC_FUNC_MALLOC_IF): > * m4/realloc.m4 (_AC_FUNC_REALLOC_IF): > * m4/regex.m4 (gl_REGEX): > * m4/strndup.m4 (gl_FUNC_STRNDUP): > * tests/test-calloc-gnu.c (main): > * tests/test-duplocale.c (main): > * tests/test-getgroups.c (main): > * tests/test-getline.c (main): > * tests/test-inttostr.c (main): > * tests/test-localename.c (test_locale_name) > (test_locale_name_thread, test_locale_name_environ) > (test_locale_name_default): > * tests/test-regex.c (main): > * tests/test-setlocale1.c (main): > * tests/test-stat.h (test_stat_func): > Free heap-allocated storage before exiting. > * m4/asm-underscore.m4 (gl_ASM_SYMBOL_PREFIX): > Don't match *_foo symbols inserted by AddressSanitizer. > * tests/test-regex.c, tests/test-stat.c: Include stdlib.h, for 'free'. > > > For bisection revision-tuple graph see: > > http://logs.test-lab.xenproject.org/osstest/results/bisect/qemu-upstream-4.3-testing/build-i386-libvirt.libvirt-build.html > Revision IDs in each graph node refer, respectively, to the Trees above. > > > Running cs-bisection-step > --graph-out=/home/logs/results/bisect/qemu-upstream-4.3-testing/build-i386-libvirt.libvirt-build > --summary-out=tmp/95966.bisection-summary --basis-template=80927 > --blessings=real,real-bisect qemu-upstream-4.3-testing build-i386-libvirt > libvirt-build > Searching for failure / basis pass: > 95930 fail [host=fiano0] / 80927 [host=pinot1] 80730 [host=baroque0] 77983 > [host=pinot0] 77930 [host=italia0] 77853 [host=italia1] 62112 [host=nocera1] > 62045 [host=nocera1] 61805 [host=nocera1] 61729 [host=nocera0] 61620 > [host=pinot1] 60903 [host=nocera1] 60700 [host=nocera0] 60676 [host=nocera0] > 60159 [host=italia1] 58381 [host=pinot1] 57828 [host=nocera0] 56721 > [host=nocera1] 56679 [host=nocera0] 56637 [host=nocera1] 56604 [host=nocera1] > 56583 [host=italia1] 56556 [host=nocera0] 56506 [host=nocera1] 56427 > [host=nocera1] 56373 [host=nocera0] 55875 [host=nocera1] 50282 [host=fiano1] > 36518 [host=scape-moth] 31652 [host=lace-bug] template as basis? using > template as basis. > Failure / basis pass flights: 95930 / 80927 > (tree with no url: seabios) > Tree: libvirt git://xenbits.xen.org/libvirt.git > Tree: libvirt_gnulib git://git.sv.gnu.org/gnulib.git > Tree: qemu git://xenbits.xen.org/qemu-xen-traditional.git > Tree: qemuu git://xenbits.xen.org/qemu-xen.git > Tree: xen git://xenbits.xen.org/xen.git > Latest eac167e2610d3e59b32f7ec7ba78cbc8c420a425 > 246b3b28808ee5f46
Re: [libvirt] gnulib and 32-bit libvirt build, rpl_canonicalize_file_name
On Mon, Jun 20, 2016 at 12:37:23PM +0100, Ian Jackson wrote: The Xen Project's automated test (CI) system has reported a build failure in libvirt; libvirt uses gnulib. osstest has bisected it to a specific gnulib commit. (Email from osstest is quoted below.) The error message is: ../gnulib/lib/.libs/libgnu.a(canonicalize-lgpl.o): In function `rpl_canonicalize_file_name': /home/osstest/build.95966.build-i386-libvirt/libvirt/gnulib/lib/canonicalize-lgpl.c:400: multiple definition of `rpl_canonicalize_file_name' .libs/virpcimock_la-virpcimock.o:/home/osstest/build.95966.build-i386-libvirt/libvirt/tests/virpcimock.c:954: first defined here collect2: error: ld returned 1 exit status Do you already know about this ? Would you like us to submit a patch to gnulib ? Thanks, Ian. osstest service owner writes ("[qemu-upstream-4.3-testing bisection] complete build-i386-libvirt"): branch xen-4.3-testing xenbranch xen-4.3-testing job build-i386-libvirt testid libvirt-build Tree: libvirt git://xenbits.xen.org/libvirt.git Tree: libvirt_gnulib git://git.sv.gnu.org/gnulib.git Tree: qemu git://xenbits.xen.org/qemu-xen-traditional.git Tree: qemuu git://xenbits.xen.org/qemu-xen.git Tree: xen git://xenbits.xen.org/xen.git *** Found and reproduced problem changeset *** Bug is in tree: libvirt_gnulib git://git.sv.gnu.org/gnulib.git Bug introduced: 54615b95ff238e235e806855efc46a9abad09f2e Bug not present: e78f894d0bdc770101bc040613f4ea94e45f38f7 Last fail repro: http://logs.test-lab.xenproject.org/osstest/logs/95966/ commit 54615b95ff238e235e806855efc46a9abad09f2e Author: Paul Eggert Date: Sat Feb 6 18:11:48 2016 -0800 misc: port better to gcc -fsanitize=address Without these patches, ./configure CFLAGS='-fsanitize=address' would compute incorrect values. This patch fixes some (but not all) test failures with recent glibc, with this configuration. This has been fixed in gnulib already: http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commitdiff;h=246b3b2 commit 246b3b28808ee5f4664be674dce573af9497fc7a Author: Eric Blake CommitDate: 2016-05-27 14:04:35 -0600 canonicalize: Fix broken probe for realpath. Pulled into libvirt by: commit 0ebd0b19d35b93eeea9d49318d7a69e147da Author: Eric Blake CommitDate: 2016-05-27 14:06:45 -0600 maint: update to latest gnulib Fix a regression in checking for realpath (which caused link failures regarding duplicate rpl_canonicalize_file_name), and fix the mingw build regarding unsetenv. * .gnulib: Update to latest. Signed-off-by: Eric Blake git describe: v1.3.5-rc1 contains: v1.3.5-rc1^0 The osstest service seems to be building libvirt commit: commit 6ec319b84f67d72bf59fe7e0fd41d88ee9c393c7 Author: John Ferlan logical: Clean up allocation when building regex on the fly git describe: v1.3.1-92-g6ec319b contains: v1.3.2-rc1~262 which used gnulib from before the commit that broke it. Jan -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v3 4/4] util: Make failure to get supplementary group list for a uid non-fatal
On 06/17/2016 09:44 AM, Peter Krempa wrote: > Since introduction of the DAC security driver we've documented that > seclabels with a leading + can be used with numerical uid. This would > not work though with the rest of libvirt if the uid was not actually > used in the system as we'd fail when trying to get a list of > supplementary groups for the given uid. Since a uid without entry in > /etc/passwd (or other user database) will not have any supplementary > groups we can treat the failure to obtain them as such. > > This patch modifies virGetGroupList to not report the error for missing > users and makes it return an empty list or just the group specified in > @gid. > > All callers will grand less permissions in case of failure and thus this > change is safe. "grand less"? did you mean "gain less"? ACK series (just typed out loud below) John > --- > src/util/virutil.c | 31 --- > 1 file changed, 16 insertions(+), 15 deletions(-) > > diff --git a/src/util/virutil.c b/src/util/virutil.c > index 392091b..60da17b 100644 > --- a/src/util/virutil.c > +++ b/src/util/virutil.c > @@ -1120,29 +1120,30 @@ virGetGroupID(const char *group, gid_t *gid) > > /* Compute the list of primary and supplementary groups associated > * with @uid, and including @gid in the list (unless it is -1), > - * storing a malloc'd result into @list. Return the size of the list > - * on success, or -1 on failure with error reported and errno set. May > - * not be called between fork and exec. */ > + * storing a malloc'd result into @list. If uid is -1 or doesn't exist in the > + * system database querying of the supplementary groups is skipped. > + * > + * Returns the size of the list on success, or -1 on failure with error > + * reported and errno set. May not be called between fork and exec. > + * */ > int > virGetGroupList(uid_t uid, gid_t gid, gid_t **list) > { > -int ret = -1; > +int ret = 0; > char *user = NULL; > gid_t primary; > > *list = NULL; > -if (uid == (uid_t)-1) > -return 0; > > -if (virGetUserEnt(uid, &user, &primary, NULL, NULL, false) < 0) > -return -1; > - > -ret = mgetgroups(user, primary, list); > -if (ret < 0) { > -sa_assert(!*list); > -virReportSystemError(errno, > - _("cannot get group list for '%s'"), user); > -goto cleanup; > +/* invalid users have no supplementary groups */ > +if (uid != (uid_t)-1 && > +virGetUserEnt(uid, &user, &primary, NULL, NULL, true) >= 0) { > +if ((ret = mgetgroups(user, primary, list)) < 0) { > +virReportSystemError(errno, > + _("cannot get group list for '%s'"), user); > +ret = -1; > +goto cleanup; > +} > } Playing the "what if" game here. If for some reason uid == -1 OR virGetUserEnt fails, then gid - still to be determined ret = 0 > > if (gid != (gid_t)-1) { > If we enter this "if", then the for loop will exit immediately and the VIR_APPEND_ELEMENT will append that gid onto *list which is IIRC what we want. Then ret will be set to 1 (i) and we return. Otherwise if gid == -1, then we return 0, which is still fine. -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v3 1/4] tools: virt-login-shell: Fix group list bounds checking
On Fri, Jun 17, 2016 at 03:44:09PM +0200, Peter Krempa wrote: > The list certainly isn't zero terminated and it would isallow usage of s/isallow/disallow/ > group 'root'. Pass in the array size and match against it. > --- > tools/virt-login-shell.c | 7 --- > 1 file changed, 4 insertions(+), 3 deletions(-) ACK -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v3 2/4] tools: virt-login-shell: Fix cut'n'paste mistake in error message
On Fri, Jun 17, 2016 at 03:44:10PM +0200, Peter Krempa wrote: > Whine about 'allowed_users' having wrong format rather than 'shell' > --- > tools/virt-login-shell.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) ACK -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH] util: fix a typo
From: Chen Hanxiao s/succcess/success Signed-off-by: Chen Hanxiao --- src/util/virfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/virfile.c b/src/util/virfile.c index 9d460b9..f47bf39 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -406,7 +406,7 @@ int virFileLock(int fd, bool shared, off_t start, off_t len, bool waitForLock) * NB the lock will also be released if any open file descriptor * pointing to the same file as @fd is closed * - * Returns 0 on succcess, or -errno on error + * Returns 0 on success, or -errno on error */ int virFileUnlock(int fd, off_t start, off_t len) { -- 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] docs: virsh: Added note for the dump command
On Mon, Jun 20, 2016 at 01:34:28PM +0200, jsuch...@redhat.com wrote: From: Jaroslav Suchanek Feel free to fix your git send-email settings if you used that to send the patch, or otherwise fix your MUA or whatever you used. Crash dump in a old kvmdump format is being obsolete and cannot be loaded and s/a old/an old/ or just remove the 'a'. processed by crash utility since its version 6.1.0. A --memory-only option is required in order to produce valid ELF file which can be later processed by the crash utility. A new note is added to the dump command description. --- tools/virsh.pod | 5 + 1 file changed, 5 insertions(+) diff --git a/tools/virsh.pod b/tools/virsh.pod index 98fed76..8e3ba69 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -1355,6 +1355,11 @@ B command. I<--verbose> displays the progress of dump. NOTE: Some hypervisors may require the user to manually ensure proper permissions on file and path specified by argument I. +NOTE: Crash dump in a old kvmdump format is being obsolete and cannot be loaded Same here. Since that is trivial, I'll fix that and push the patch. Congratulations on your first libvirt patch! +and processed by crash utility since its version 6.1.0. A --memory-only option +is required in order to produce valid ELF file which can be later processed by +the crash utility. + =item B I [I<--inactive>] [I<--security-info>] [I<--update-cpu>] [I<--migratable>] -- 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list signature.asc Description: Digital signature -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] util: fix a typo
On Mon, 2016-06-20 at 19:52 +0800, Chen Hanxiao wrote: > From: Chen Hanxiao > > s/succcess/success > > Signed-off-by: Chen Hanxiao > --- > src/util/virfile.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/util/virfile.c b/src/util/virfile.c > index 9d460b9..f47bf39 100644 > --- a/src/util/virfile.c > +++ b/src/util/virfile.c > @@ -406,7 +406,7 @@ int virFileLock(int fd, bool shared, off_t start, off_t > len, bool waitForLock) > * NB the lock will also be released if any open file descriptor > * pointing to the same file as @fd is closed > * > - * Returns 0 on succcess, or -errno on error > + * Returns 0 on success, or -errno on error > */ > int virFileUnlock(int fd, off_t start, off_t len) > { ACK and pushed, thanks! :) -- Andrea Bolognani Software Engineer - Virtualization Team -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 0/4] Move ccwaddrs and pciaddrs to domainDef
On 06/19/2016 08:18 PM, Tomasz Flendrich wrote: > This patch depends on another one, because it was created on top > of the changes in the other one. Link to the dependency: > https://www.redhat.com/archives/libvir-list/2016-June/msg01227.html > > This is the next patch of the ongoing process of abstracting device > address generation. > > In this patch, addres sets are moved from QEMU's (ccw and pci) > and bhyve's (pci only) private data to domainDef. In the future, > it's likely that more hypervisors will add the feature of explicitly > specifying the device addresses, so handling the addresses should be > made more generic. > Apologies if I'm missing something, I didn't look too closely at this series, however have you seen this thread? http://www.redhat.com/archives/libvir-list/2016-May/msg01071.html My understanding of the current code is that the cached vioserial/ccw/pciaddrs lists in qemu aren't actually required... they were at one point to handle older qemu, but we dropped that support. Maybe you can pick up my patches and finish off dropping of pciaddrs and ccwaddrs? I suspect the pciaddrs cache in bhyve can be dropped as well, I don't think it was ever strictly required, the code just followed the qemu example That said I think it makes sense in general to move this generic stuff out of qemu since it's generic code as you say, but better to remove the obsolete stuff first IMO Thanks, Cole -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH 2/2] conf: Fix label name in virDomainGraphicsListensParseXML
Use 'cleanup' since it's also used on success. --- src/conf/domain_conf.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 0b642a1..f208682 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -11136,20 +11136,20 @@ virDomainGraphicsListensParseXML(virDomainGraphicsDefPtr def, /* parse the subelements for graphics types that support it */ nListens = virXPathNodeSet("./listen", ctxt, &listenNodes); if (nListens < 0) -goto error; +goto cleanup; if (nListens > 0) { size_t i; if (VIR_ALLOC_N(def->listens, nListens) < 0) -goto error; +goto cleanup; for (i = 0; i < nListens; i++) { if (virDomainGraphicsListenDefParseXML(&def->listens[i], def, listenNodes[i], i == 0 ? node : NULL, flags) < 0) -goto error; +goto cleanup; def->nListens++; } @@ -11177,7 +11177,7 @@ virDomainGraphicsListensParseXML(virDomainGraphicsDefPtr def, * element. */ if (def->nListens == 0) { if (VIR_APPEND_ELEMENT(def->listens, def->nListens, newListen) < 0) -goto error; +goto cleanup; } else { virDomainGraphicsListenDefPtr glisten = &def->listens[0]; @@ -11195,7 +11195,7 @@ virDomainGraphicsListensParseXML(virDomainGraphicsDefPtr def, } ret = 0; - error: + cleanup: virDomainGraphicsListenDefClear(&newListen); VIR_FREE(listenNodes); VIR_FREE(socketPath); -- 2.8.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH 0/2] Fix leak and labels in virDomainGraphicsListensParseXML
Peter Krempa (2): conf: Fix memory leak in graphics XML parser conf: Fix label name in virDomainGraphicsListensParseXML src/conf/domain_conf.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) -- 2.8.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH 1/2] conf: Fix memory leak in graphics XML parser
When loading status XMLs with following graphics definition: libvirtd would leak a few bytes: 10 bytes in 1 blocks are definitely lost in loss record 71 of 1,127 at 0x4C2C000: malloc (vg_replace_malloc.c:299) by 0x6789298: xmlStrndup (in /usr/lib64/libxml2.so.2.9.4) by 0x552AB0A: virXMLPropString (virxml.c:479) by 0x5539536: virDomainGraphicsListensParseXML (domain_conf.c:11171) by 0x553DD5E: virDomainGraphicsDefParseXMLSpice (domain_conf.c:11414) by 0x553DD5E: virDomainGraphicsDefParseXML (domain_conf.c:11749) by 0x5566061: virDomainDefParseXML (domain_conf.c:16939) by 0x556953F: virDomainObjParseXML (domain_conf.c:17348) by 0x556953F: virDomainObjParseNode (domain_conf.c:17513) by 0x5569902: virDomainObjParseFile (domain_conf.c:17532) by 0x5571E02: virDomainObjListLoadStatus (virdomainobjlist.c:514) by 0x5571E02: virDomainObjListLoadAllConfigs (virdomainobjlist.c:596) by 0x26E0BDC8: qemuStateInitialize (qemu_driver.c:911) by 0x55B1FDB: virStateInitialize (libvirt.c:770) by 0x122039: daemonRunStateInit (libvirtd.c:960) --- There might be some other for me invisible bug in the logic of handling of the glisten definition which might make this disappear too, but I'm not really into this code. src/conf/domain_conf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index fb6f58d..0b642a1 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -11190,13 +11190,13 @@ virDomainGraphicsListensParseXML(virDomainGraphicsDefPtr def, newListen.type == VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_SOCKET) { virDomainGraphicsListenDefClear(glisten); *glisten = newListen; +memset(&newListen, 0, sizeof(newListen)); } } ret = 0; error: -if (ret < 0) -virDomainGraphicsListenDefClear(&newListen); +virDomainGraphicsListenDefClear(&newListen); VIR_FREE(listenNodes); VIR_FREE(socketPath); ctxt->node = save; -- 2.8.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] virsh: introduce name-uuid for list command
On Mon, Jun 20, 2016 at 19:22:45 +0800, Chen Hanxiao wrote: > > At 2016-06-15 17:36:05, "Chen Hanxiao" wrote: > >From: Chen Hanxiao > > > >This patch will show both name and UUID of domain: > > > > IdName State UUID > > --- > > 3 f23running > > 918f1dd6-b19f-412b-ba17-d113bad89af8 > > > >Signed-off-by: Chen Hanxiao > >--- > > ping? Jan already provided a review. I agree with his view. Allowing both --name --uuid is better than the new argument. -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] gnulib and 32-bit libvirt build, rpl_canonicalize_file_name
Ján Tomko writes ("Re: [libvirt] gnulib and 32-bit libvirt build, rpl_canonicalize_file_name"): > This has been fixed in gnulib already: > http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commitdiff;h=246b3b2 > commit 246b3b28808ee5f4664be674dce573af9497fc7a > Author: Eric Blake > CommitDate: 2016-05-27 14:04:35 -0600 > > canonicalize: Fix broken probe for realpath. Great, thanks. > Pulled into libvirt by: > commit 0ebd0b19d35b93eeea9d49318d7a69e147da > Author: Eric Blake > CommitDate: 2016-05-27 14:06:45 -0600 > > maint: update to latest gnulib > > Fix a regression in checking for realpath (which caused link > failures regarding duplicate rpl_canonicalize_file_name), and > fix the mingw build regarding unsetenv. > > * .gnulib: Update to latest. > > Signed-off-by: Eric Blake Right. > The osstest service seems to be building libvirt commit: > commit 6ec319b84f67d72bf59fe7e0fd41d88ee9c393c7 > Author: John Ferlan > > logical: Clean up allocation when building regex on the fly > > git describe: v1.3.1-92-g6ec319b contains: v1.3.2-rc1~262 > > which used gnulib from before the commit that broke it. OK, great. Sorry for the noise. Thanks, Ian. -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v2 1/7] domain_conf: Validate redirdev after parsing
On 20.06.2016 10:32, Ján Tomko wrote: > On Fri, Jun 10, 2016 at 05:32:55PM +0200, Michal Privoznik wrote: >> There's currently just one limitation: redirdevs that want to go >> on USB bus require a USB controller, surprisingly. >> At the same time, since I'm using virDomainDefHasUSB() in this >> new validator function, it has to be moved a few lines up and >> also its header needed to be changed a bit: it is now taking a >> const pointer to domain def since it's not changing anything in >> there. >> >> Signed-off-by: Michal Privoznik >> --- >> src/conf/domain_conf.c | 56 >> -- >> 1 file changed, 32 insertions(+), 24 deletions(-) >> >> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c >> index 85f6e31..c75279d 100644 >> --- a/src/conf/domain_conf.c >> +++ b/src/conf/domain_conf.c >> @@ -4567,14 +4567,45 @@ virDomainDiskDefValidate(const >> virDomainDiskDef *disk) >> return 0; >> } >> >> +static bool >> +virDomainDefHasUSB(const virDomainDef *def) >> +{ >> +size_t i; >> + >> +for (i = 0; i < def->ncontrollers; i++) { >> +if (def->controllers[i]->type == >> VIR_DOMAIN_CONTROLLER_TYPE_USB && >> +def->controllers[i]->model != >> VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE) >> +return true; >> +} > > This function returns false either if there is a model='none' USB > controller or if there is none at all, But there's an implicit controlled being added after domain XML is parsed (if none was provided in the XML), unless this behaviour has been suppressed by model='none'. > >> + >> +return false; >> +} >> + > >> @@ -17060,14 +17090,6 @@ virDomainDefParseXML(xmlDocPtr xml, >> if (!redirdev) >> goto error; >> >> -if (redirdev->bus == VIR_DOMAIN_REDIRDEV_BUS_USB && usb_none) { >> - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", >> -_("Can't add redirected USB device: " >> - "USB is disabled for this domain")); >> -virDomainRedirdevDefFree(redirdev); > > but this error was only reported for model="none'. > > This broke virt-manager's test: > https://ci.centos.org/job/virt-manager-test/systems=libvirt-fedora-rawhide/1363/console I don't see the problem. Virt-manager relied on a bug and I've fixed it. I mean, what is happening here is: virt-manager tries to open a test connection whilst providing its own test driver state XML. This big XML has domain XMLs too. These are missing usb controllers and since we are not adding implicit ones in post parse callback (there are none defined for the test driver), domains really are missing USB controllers and thus USB bus. It's just our buggy behaviour that caused virt-manager to work by chance. Michal -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 0/2] Fix leak and labels in virDomainGraphicsListensParseXML
ACK series -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH 4/7] virnetsockettest: fix error messages
--- tests/virnetsockettest.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/virnetsockettest.c b/tests/virnetsockettest.c index 8cd8ede..4d78d27 100644 --- a/tests/virnetsockettest.c +++ b/tests/virnetsockettest.c @@ -271,7 +271,7 @@ static int testSocketUNIXAddrs(const void *data ATTRIBUTE_UNUSED) } if (STRNEQ(virNetSocketRemoteAddrString(csock), "127.0.0.1;0")) { -VIR_DEBUG("Unexpected local address"); +VIR_DEBUG("Unexpected remote address"); goto cleanup; } @@ -293,7 +293,7 @@ static int testSocketUNIXAddrs(const void *data ATTRIBUTE_UNUSED) } if (STRNEQ(virNetSocketRemoteAddrString(ssock), "127.0.0.1;0")) { -VIR_DEBUG("Unexpected local address"); +VIR_DEBUG("Unexpected remote address"); goto cleanup; } -- 2.7.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH 0/7] Fix SASL authentication regression
Introduced by commit 9b45c9f, released in v1.3.5. https://bugzilla.redhat.com/show_bug.cgi?id=1345743 Ján Tomko (7): Revert "virnetsocket: Provide socket address format in a more standard form" Introduce virNetSocketRemoteAddrStringURI Introduce virNetServerClientRemoteAddrStringURI virnetsockettest: fix error messages virNetSocket: rename AddrStr to AddrStrSASL Add SASL to virNetSocket{Local,Remote}AddrString Rename virNetServerClient*AddrString daemon/remote.c | 13 ++--- src/libvirt_remote.syms | 10 ++ src/remote/remote_driver.c | 7 --- src/rpc/virnetclient.c | 14 ++ src/rpc/virnetclient.h | 2 -- src/rpc/virnetserver.c | 2 +- src/rpc/virnetserverclient.c | 21 +++-- src/rpc/virnetserverclient.h | 7 +++ src/rpc/virnetsocket.c | 41 +++-- src/rpc/virnetsocket.h | 7 +++ tests/virnetsockettest.c | 26 ++ 11 files changed, 61 insertions(+), 89 deletions(-) -- 2.7.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH 2/7] Introduce virNetSocketRemoteAddrStringURI
Add a test case to virnetsockettest. --- src/libvirt_remote.syms | 1 + src/rpc/virnetsocket.c | 10 ++ src/rpc/virnetsocket.h | 1 + tests/virnetsockettest.c | 10 ++ 4 files changed, 22 insertions(+) diff --git a/src/libvirt_remote.syms b/src/libvirt_remote.syms index 1a88fff..f3cf65d 100644 --- a/src/libvirt_remote.syms +++ b/src/libvirt_remote.syms @@ -227,6 +227,7 @@ virNetSocketPreExecRestart; virNetSocketRead; virNetSocketRecvFD; virNetSocketRemoteAddrString; +virNetSocketRemoteAddrStringURI; virNetSocketRemoveIOCallback; virNetSocketSendFD; virNetSocketSetBlocking; diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c index d909b94..f10b62b 100644 --- a/src/rpc/virnetsocket.c +++ b/src/rpc/virnetsocket.c @@ -87,6 +87,7 @@ struct _virNetSocket { virSocketAddr remoteAddr; char *localAddrStr; char *remoteAddrStr; +char *remoteAddrStrURI; #if WITH_GNUTLS virNetTLSSessionPtr tlsSession; @@ -269,6 +270,10 @@ static virNetSocketPtr virNetSocketNew(virSocketAddrPtr localAddr, !(sock->remoteAddrStr = virSocketAddrFormatFull(remoteAddr, true, ";"))) goto error; +if (remoteAddr && +!(sock->remoteAddrStrURI = virSocketAddrFormatFull(remoteAddr, true, NULL))) +goto error; + sock->client = isClient; PROBE(RPC_SOCKET_NEW, @@ -1204,6 +1209,7 @@ void virNetSocketDispose(void *obj) VIR_FREE(sock->localAddrStr); VIR_FREE(sock->remoteAddrStr); +VIR_FREE(sock->remoteAddrStrURI); } @@ -1465,6 +1471,10 @@ const char *virNetSocketRemoteAddrString(virNetSocketPtr sock) return sock->remoteAddrStr; } +const char *virNetSocketRemoteAddrStringURI(virNetSocketPtr sock) +{ +return sock->remoteAddrStrURI; +} #if WITH_GNUTLS static ssize_t virNetSocketTLSSessionWrite(const char *buf, diff --git a/src/rpc/virnetsocket.h b/src/rpc/virnetsocket.h index 5de3d92..25ca14e 100644 --- a/src/rpc/virnetsocket.h +++ b/src/rpc/virnetsocket.h @@ -150,6 +150,7 @@ bool virNetSocketHasPendingData(virNetSocketPtr sock); const char *virNetSocketLocalAddrString(virNetSocketPtr sock); const char *virNetSocketRemoteAddrString(virNetSocketPtr sock); +const char *virNetSocketRemoteAddrStringURI(virNetSocketPtr sock); int virNetSocketListen(virNetSocketPtr sock, int backlog); int virNetSocketAccept(virNetSocketPtr sock, diff --git a/tests/virnetsockettest.c b/tests/virnetsockettest.c index 9df90a9..8cd8ede 100644 --- a/tests/virnetsockettest.c +++ b/tests/virnetsockettest.c @@ -275,6 +275,11 @@ static int testSocketUNIXAddrs(const void *data ATTRIBUTE_UNUSED) goto cleanup; } +if (STRNEQ(virNetSocketRemoteAddrStringURI(csock), "127.0.0.1:0")) { +VIR_DEBUG("Unexpected remote address"); +goto cleanup; +} + if (virNetSocketAccept(lsock, &ssock) < 0) { VIR_DEBUG("Unexpected client socket missing"); @@ -292,6 +297,11 @@ static int testSocketUNIXAddrs(const void *data ATTRIBUTE_UNUSED) goto cleanup; } +if (STRNEQ(virNetSocketRemoteAddrStringURI(ssock), "127.0.0.1:0")) { +VIR_DEBUG("Unexpected remote address"); +goto cleanup; +} + ret = 0; -- 2.7.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH 7/7] Rename virNetServerClient*AddrString
Add SASL at the end to make the format obvious. --- daemon/remote.c | 4 ++-- src/libvirt_remote.syms | 4 ++-- src/rpc/virnetserverclient.c | 4 ++-- src/rpc/virnetserverclient.h | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/daemon/remote.c b/daemon/remote.c index ea4753f..5ee82bb 100644 --- a/daemon/remote.c +++ b/daemon/remote.c @@ -3028,8 +3028,8 @@ remoteDispatchAuthSaslInit(virNetServerPtr server ATTRIBUTE_UNUSED, sasl = virNetSASLSessionNewServer(saslCtxt, "libvirt", - virNetServerClientLocalAddrString(client), - virNetServerClientRemoteAddrString(client)); + virNetServerClientLocalAddrStringSASL(client), + virNetServerClientRemoteAddrStringSASL(client)); if (!sasl) goto authfail; diff --git a/src/libvirt_remote.syms b/src/libvirt_remote.syms index 3858f4d..a6192ef 100644 --- a/src/libvirt_remote.syms +++ b/src/libvirt_remote.syms @@ -139,12 +139,12 @@ virNetServerClientInitKeepAlive; virNetServerClientIsClosed; virNetServerClientIsLocal; virNetServerClientIsSecure; -virNetServerClientLocalAddrString; +virNetServerClientLocalAddrStringSASL; virNetServerClientNeedAuth; virNetServerClientNew; virNetServerClientNewPostExecRestart; virNetServerClientPreExecRestart; -virNetServerClientRemoteAddrString; +virNetServerClientRemoteAddrStringSASL; virNetServerClientRemoteAddrStringURI; virNetServerClientRemoveFilter; virNetServerClientSendMessage; diff --git a/src/rpc/virnetserverclient.c b/src/rpc/virnetserverclient.c index 5aa7634..39fe860 100644 --- a/src/rpc/virnetserverclient.c +++ b/src/rpc/virnetserverclient.c @@ -903,7 +903,7 @@ void virNetServerClientSetDispatcher(virNetServerClientPtr client, } -const char *virNetServerClientLocalAddrString(virNetServerClientPtr client) +const char *virNetServerClientLocalAddrStringSASL(virNetServerClientPtr client) { if (!client->sock) return NULL; @@ -911,7 +911,7 @@ const char *virNetServerClientLocalAddrString(virNetServerClientPtr client) } -const char *virNetServerClientRemoteAddrString(virNetServerClientPtr client) +const char *virNetServerClientRemoteAddrStringSASL(virNetServerClientPtr client) { if (!client->sock) return NULL; diff --git a/src/rpc/virnetserverclient.h b/src/rpc/virnetserverclient.h index bb9c937..c243a68 100644 --- a/src/rpc/virnetserverclient.h +++ b/src/rpc/virnetserverclient.h @@ -138,8 +138,8 @@ bool virNetServerClientCheckKeepAlive(virNetServerClientPtr client, virNetMessagePtr msg); int virNetServerClientStartKeepAlive(virNetServerClientPtr client); -const char *virNetServerClientLocalAddrString(virNetServerClientPtr client); -const char *virNetServerClientRemoteAddrString(virNetServerClientPtr client); +const char *virNetServerClientLocalAddrStringSASL(virNetServerClientPtr client); +const char *virNetServerClientRemoteAddrStringSASL(virNetServerClientPtr client); const char *virNetServerClientRemoteAddrStringURI(virNetServerClientPtr client); int virNetServerClientSendMessage(virNetServerClientPtr client, -- 2.7.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH 5/7] virNetSocket: rename AddrStr to AddrStrSASL
Make it more obvious that these are in the SASL format. --- src/rpc/virnetsocket.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c index f10b62b..00dc417 100644 --- a/src/rpc/virnetsocket.c +++ b/src/rpc/virnetsocket.c @@ -85,8 +85,8 @@ struct _virNetSocket { virSocketAddr localAddr; virSocketAddr remoteAddr; -char *localAddrStr; -char *remoteAddrStr; +char *localAddrStrSASL; +char *remoteAddrStrSASL; char *remoteAddrStrURI; #if WITH_GNUTLS @@ -263,11 +263,11 @@ static virNetSocketPtr virNetSocketNew(virSocketAddrPtr localAddr, if (localAddr && -!(sock->localAddrStr = virSocketAddrFormatFull(localAddr, true, ";"))) +!(sock->localAddrStrSASL = virSocketAddrFormatFull(localAddr, true, ";"))) goto error; if (remoteAddr && -!(sock->remoteAddrStr = virSocketAddrFormatFull(remoteAddr, true, ";"))) +!(sock->remoteAddrStrSASL = virSocketAddrFormatFull(remoteAddr, true, ";"))) goto error; if (remoteAddr && @@ -279,7 +279,7 @@ static virNetSocketPtr virNetSocketNew(virSocketAddrPtr localAddr, PROBE(RPC_SOCKET_NEW, "sock=%p fd=%d errfd=%d pid=%lld localAddr=%s, remoteAddr=%s", sock, fd, errfd, (long long) pid, - NULLSTR(sock->localAddrStr), NULLSTR(sock->remoteAddrStr)); + NULLSTR(sock->localAddrStrSASL), NULLSTR(sock->remoteAddrStrSASL)); return sock; @@ -1207,8 +1207,8 @@ void virNetSocketDispose(void *obj) virProcessAbort(sock->pid); -VIR_FREE(sock->localAddrStr); -VIR_FREE(sock->remoteAddrStr); +VIR_FREE(sock->localAddrStrSASL); +VIR_FREE(sock->remoteAddrStrSASL); VIR_FREE(sock->remoteAddrStrURI); } @@ -1463,12 +1463,12 @@ int virNetSocketSetBlocking(virNetSocketPtr sock, const char *virNetSocketLocalAddrString(virNetSocketPtr sock) { -return sock->localAddrStr; +return sock->localAddrStrSASL; } const char *virNetSocketRemoteAddrString(virNetSocketPtr sock) { -return sock->remoteAddrStr; +return sock->remoteAddrStrSASL; } const char *virNetSocketRemoteAddrStringURI(virNetSocketPtr sock) -- 2.7.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH 1/7] Revert "virnetsocket: Provide socket address format in a more standard form"
This partially reverts commit 9b45c9f049a7e9b6c1abfa6988b63b760714e169. It changed the default format of socket address from the one SASL requires, but did not adjust all the callers. It also removed the test coverage for it. Revert most of the changes except the virSocketAddrFormatFull support for URI-formatted strings. This fixes https://bugzilla.redhat.com/show_bug.cgi?id=1345743 while reverting the format used by virt-admin's client-info command from the URI one to the SASL one. https://bugzilla.redhat.com/show_bug.cgi?id=1345743 --- daemon/remote.c | 13 ++--- src/remote/remote_driver.c | 7 --- src/rpc/virnetclient.c | 10 -- src/rpc/virnetclient.h | 2 -- src/rpc/virnetserverclient.c | 13 - src/rpc/virnetserverclient.h | 2 -- src/rpc/virnetsocket.c | 17 ++--- src/rpc/virnetsocket.h | 2 -- tests/virnetsockettest.c | 10 +- 9 files changed, 9 insertions(+), 67 deletions(-) diff --git a/daemon/remote.c b/daemon/remote.c index 4e2aff8..ea4753f 100644 --- a/daemon/remote.c +++ b/daemon/remote.c @@ -3016,8 +3016,6 @@ remoteDispatchAuthSaslInit(virNetServerPtr server ATTRIBUTE_UNUSED, virNetSASLSessionPtr sasl = NULL; struct daemonClientPrivate *priv = virNetServerClientGetPrivateData(client); -char *localAddr = NULL; -char *remoteAddr = NULL; virMutexLock(&priv->lock); @@ -3028,17 +3026,10 @@ remoteDispatchAuthSaslInit(virNetServerPtr server ATTRIBUTE_UNUSED, goto authfail; } -localAddr = virNetServerClientLocalAddrFormatSASL(client); -remoteAddr = virNetServerClientRemoteAddrFormatSASL(client); - sasl = virNetSASLSessionNewServer(saslCtxt, "libvirt", - localAddr, - remoteAddr); - -VIR_FREE(localAddr); -VIR_FREE(remoteAddr); - + virNetServerClientLocalAddrString(client), + virNetServerClientRemoteAddrString(client)); if (!sasl) goto authfail; diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index 84b6d58..0315c6e 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -3809,8 +3809,6 @@ remoteAuthSASL(virConnectPtr conn, struct private_data *priv, sasl_callback_t *saslcb = NULL; int ret = -1; const char *mechlist; -char *localAddr = NULL; -char *remoteAddr = NULL; virNetSASLContextPtr saslCtxt; virNetSASLSessionPtr sasl = NULL; struct remoteAuthInteractState state; @@ -3829,9 +3827,6 @@ remoteAuthSASL(virConnectPtr conn, struct private_data *priv, saslcb = NULL; } -localAddr = virNetClientLocalAddrFormatSASL(priv->client); -remoteAddr = virNetClientRemoteAddrFormatSASL(priv->client); - /* Setup a handle for being a client */ if (!(sasl = virNetSASLSessionNewClient(saslCtxt, "libvirt", @@ -4019,8 +4014,6 @@ remoteAuthSASL(virConnectPtr conn, struct private_data *priv, cleanup: VIR_FREE(serverin); -VIR_FREE(localAddr); -VIR_FREE(remoteAddr); remoteAuthInteractStateClear(&state, true); VIR_FREE(saslcb); diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c index 3d59990..9c0d190 100644 --- a/src/rpc/virnetclient.c +++ b/src/rpc/virnetclient.c @@ -954,16 +954,6 @@ const char *virNetClientRemoteAddrString(virNetClientPtr client) return virNetSocketRemoteAddrString(client->sock); } -char *virNetClientLocalAddrFormatSASL(virNetClientPtr client) -{ -return virNetSocketLocalAddrFormatSASL(client->sock); -} - -char *virNetClientRemoteAddrFormatSASL(virNetClientPtr client) -{ -return virNetSocketRemoteAddrFormatSASL(client->sock); -} - #if WITH_GNUTLS int virNetClientGetTLSKeySize(virNetClientPtr client) { diff --git a/src/rpc/virnetclient.h b/src/rpc/virnetclient.h index 4b78677..38f929c 100644 --- a/src/rpc/virnetclient.h +++ b/src/rpc/virnetclient.h @@ -123,8 +123,6 @@ bool virNetClientIsOpen(virNetClientPtr client); const char *virNetClientLocalAddrString(virNetClientPtr client); const char *virNetClientRemoteAddrString(virNetClientPtr client); -char *virNetClientLocalAddrFormatSASL(virNetClientPtr client); -char *virNetClientRemoteAddrFormatSASL(virNetClientPtr client); # ifdef WITH_GNUTLS int virNetClientGetTLSKeySize(virNetClientPtr client); diff --git a/src/rpc/virnetserverclient.c b/src/rpc/virnetserverclient.c index ef83507..2bc058c 100644 --- a/src/rpc/virnetserverclient.c +++ b/src/rpc/virnetserverclient.c @@ -918,19 +918,6 @@ const char *virNetServerClientRemoteAddrString(virNetServerClientPtr client) return virNetSocketRemoteAddrString(client->sock); } -char *virNetServerClientLocalAddrFormatSASL(virNetServerClientPtr client) -{ -if (!client->sock) -return NULL; -return virNe
[libvirt] [PATCH 3/7] Introduce virNetServerClientRemoteAddrStringURI
Use it in virNetServerClientGetInfo to switch back to using the URI-format (separated by ':') instead of the SASL format (separated by ';'). Also use it in the error message reported byvirNetServerAddClient. --- src/libvirt_remote.syms | 1 + src/rpc/virnetserver.c | 2 +- src/rpc/virnetserverclient.c | 8 +++- src/rpc/virnetserverclient.h | 1 + 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/libvirt_remote.syms b/src/libvirt_remote.syms index f3cf65d..fd80e46 100644 --- a/src/libvirt_remote.syms +++ b/src/libvirt_remote.syms @@ -145,6 +145,7 @@ virNetServerClientNew; virNetServerClientNewPostExecRestart; virNetServerClientPreExecRestart; virNetServerClientRemoteAddrString; +virNetServerClientRemoteAddrStringURI; virNetServerClientRemoveFilter; virNetServerClientSendMessage; virNetServerClientSetAuth; diff --git a/src/rpc/virnetserver.c b/src/rpc/virnetserver.c index 4c4b144..8c8af97 100644 --- a/src/rpc/virnetserver.c +++ b/src/rpc/virnetserver.c @@ -243,7 +243,7 @@ int virNetServerAddClient(virNetServerPtr srv, if (srv->nclients >= srv->nclients_max) { virReportError(VIR_ERR_RPC, _("Too many active clients (%zu), dropping connection from %s"), - srv->nclients_max, virNetServerClientRemoteAddrString(client)); + srv->nclients_max, virNetServerClientRemoteAddrStringURI(client)); goto error; } diff --git a/src/rpc/virnetserverclient.c b/src/rpc/virnetserverclient.c index 2bc058c..15715a9 100644 --- a/src/rpc/virnetserverclient.c +++ b/src/rpc/virnetserverclient.c @@ -918,6 +918,12 @@ const char *virNetServerClientRemoteAddrString(virNetServerClientPtr client) return virNetSocketRemoteAddrString(client->sock); } +const char *virNetServerClientRemoteAddrStringURI(virNetServerClientPtr client) +{ +if (!client->sock) +return NULL; +return virNetSocketRemoteAddrStringURI(client->sock); +} void virNetServerClientDispose(void *obj) { @@ -1608,7 +1614,7 @@ virNetServerClientGetInfo(virNetServerClientPtr client, virObjectLock(client); *readonly = client->readonly; -if (!(*sock_addr = virNetServerClientRemoteAddrString(client))) { +if (!(*sock_addr = virNetServerClientRemoteAddrStringURI(client))) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("No network socket associated with client")); goto cleanup; diff --git a/src/rpc/virnetserverclient.h b/src/rpc/virnetserverclient.h index c8b8dc1..bb9c937 100644 --- a/src/rpc/virnetserverclient.h +++ b/src/rpc/virnetserverclient.h @@ -140,6 +140,7 @@ int virNetServerClientStartKeepAlive(virNetServerClientPtr client); const char *virNetServerClientLocalAddrString(virNetServerClientPtr client); const char *virNetServerClientRemoteAddrString(virNetServerClientPtr client); +const char *virNetServerClientRemoteAddrStringURI(virNetServerClientPtr client); int virNetServerClientSendMessage(virNetServerClientPtr client, virNetMessagePtr msg); -- 2.7.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH 6/7] Add SASL to virNetSocket{Local, Remote}AddrString
Rename them to virNetSocket{Local,Remote}AddrStringSASL to make their format more obvious. --- src/libvirt_remote.syms | 4 ++-- src/rpc/virnetclient.c | 4 ++-- src/rpc/virnetserverclient.c | 4 ++-- src/rpc/virnetsocket.c | 4 ++-- src/rpc/virnetsocket.h | 4 ++-- tests/virnetsockettest.c | 12 ++-- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/libvirt_remote.syms b/src/libvirt_remote.syms index fd80e46..3858f4d 100644 --- a/src/libvirt_remote.syms +++ b/src/libvirt_remote.syms @@ -212,7 +212,7 @@ virNetSocketHasPassFD; virNetSocketHasPendingData; virNetSocketIsLocal; virNetSocketListen; -virNetSocketLocalAddrString; +virNetSocketLocalAddrStringSASL; virNetSocketNewConnectCommand; virNetSocketNewConnectExternal; virNetSocketNewConnectLibSSH2; @@ -227,7 +227,7 @@ virNetSocketNewPostExecRestart; virNetSocketPreExecRestart; virNetSocketRead; virNetSocketRecvFD; -virNetSocketRemoteAddrString; +virNetSocketRemoteAddrStringSASL; virNetSocketRemoteAddrStringURI; virNetSocketRemoveIOCallback; virNetSocketSendFD; diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c index 9c0d190..c43cd08 100644 --- a/src/rpc/virnetclient.c +++ b/src/rpc/virnetclient.c @@ -946,12 +946,12 @@ void virNetClientRemoveStream(virNetClientPtr client, const char *virNetClientLocalAddrString(virNetClientPtr client) { -return virNetSocketLocalAddrString(client->sock); +return virNetSocketLocalAddrStringSASL(client->sock); } const char *virNetClientRemoteAddrString(virNetClientPtr client) { -return virNetSocketRemoteAddrString(client->sock); +return virNetSocketRemoteAddrStringSASL(client->sock); } #if WITH_GNUTLS diff --git a/src/rpc/virnetserverclient.c b/src/rpc/virnetserverclient.c index 15715a9..5aa7634 100644 --- a/src/rpc/virnetserverclient.c +++ b/src/rpc/virnetserverclient.c @@ -907,7 +907,7 @@ const char *virNetServerClientLocalAddrString(virNetServerClientPtr client) { if (!client->sock) return NULL; -return virNetSocketLocalAddrString(client->sock); +return virNetSocketLocalAddrStringSASL(client->sock); } @@ -915,7 +915,7 @@ const char *virNetServerClientRemoteAddrString(virNetServerClientPtr client) { if (!client->sock) return NULL; -return virNetSocketRemoteAddrString(client->sock); +return virNetSocketRemoteAddrStringSASL(client->sock); } const char *virNetServerClientRemoteAddrStringURI(virNetServerClientPtr client) diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c index 00dc417..405f5ba 100644 --- a/src/rpc/virnetsocket.c +++ b/src/rpc/virnetsocket.c @@ -1461,12 +1461,12 @@ int virNetSocketSetBlocking(virNetSocketPtr sock, } -const char *virNetSocketLocalAddrString(virNetSocketPtr sock) +const char *virNetSocketLocalAddrStringSASL(virNetSocketPtr sock) { return sock->localAddrStrSASL; } -const char *virNetSocketRemoteAddrString(virNetSocketPtr sock) +const char *virNetSocketRemoteAddrStringSASL(virNetSocketPtr sock) { return sock->remoteAddrStrSASL; } diff --git a/src/rpc/virnetsocket.h b/src/rpc/virnetsocket.h index 25ca14e..ec064bb 100644 --- a/src/rpc/virnetsocket.h +++ b/src/rpc/virnetsocket.h @@ -148,8 +148,8 @@ void virNetSocketSetSASLSession(virNetSocketPtr sock, bool virNetSocketHasCachedData(virNetSocketPtr sock); bool virNetSocketHasPendingData(virNetSocketPtr sock); -const char *virNetSocketLocalAddrString(virNetSocketPtr sock); -const char *virNetSocketRemoteAddrString(virNetSocketPtr sock); +const char *virNetSocketLocalAddrStringSASL(virNetSocketPtr sock); +const char *virNetSocketRemoteAddrStringSASL(virNetSocketPtr sock); const char *virNetSocketRemoteAddrStringURI(virNetSocketPtr sock); int virNetSocketListen(virNetSocketPtr sock, int backlog); diff --git a/tests/virnetsockettest.c b/tests/virnetsockettest.c index 4d78d27..cafdca9 100644 --- a/tests/virnetsockettest.c +++ b/tests/virnetsockettest.c @@ -249,12 +249,12 @@ static int testSocketUNIXAddrs(const void *data ATTRIBUTE_UNUSED) if (virNetSocketNewListenUNIX(path, 0700, -1, getegid(), &lsock) < 0) goto cleanup; -if (STRNEQ(virNetSocketLocalAddrString(lsock), "127.0.0.1;0")) { +if (STRNEQ(virNetSocketLocalAddrStringSASL(lsock), "127.0.0.1;0")) { VIR_DEBUG("Unexpected local address"); goto cleanup; } -if (virNetSocketRemoteAddrString(lsock) != NULL) { +if (virNetSocketRemoteAddrStringSASL(lsock) != NULL) { VIR_DEBUG("Unexpected remote address"); goto cleanup; } @@ -265,12 +265,12 @@ static int testSocketUNIXAddrs(const void *data ATTRIBUTE_UNUSED) if (virNetSocketNewConnectUNIX(path, false, NULL, &csock) < 0) goto cleanup; -if (STRNEQ(virNetSocketLocalAddrString(csock), "127.0.0.1;0")) { +if (STRNEQ(virNetSocketLocalAddrStringSASL(csock), "127.0.0.1;0")) { VIR_DEBUG("Unexpected local address"); goto cleanup; } -if (
[libvirt] [PATCH 5/7] qemu: agent: Make setting of vcpus more robust
Documentation for the "guest-set-vcpus" command describes a proper algorithm how to set vcpus. This patch makes the following changes: - state of cpus that has not changed is not updated - if the command was partially successful the command is re-tried with the rest of the arguments to get a proper error message - code is more robust against mailicious guest agent - fix testsuite to the new semantics --- src/qemu/qemu_agent.c | 83 ++ src/qemu/qemu_agent.h | 2 ++ src/qemu/qemu_driver.c | 13 tests/qemuagenttest.c | 44 -- 4 files changed, 92 insertions(+), 50 deletions(-) diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c index cbc0995..5bd767a 100644 --- a/src/qemu/qemu_agent.c +++ b/src/qemu/qemu_agent.c @@ -1523,16 +1523,13 @@ qemuAgentGetVCPUs(qemuAgentPtr mon, return ret; } -/** - * Set the VCPU state using guest agent. - * - * Returns -1 on error, ninfo in case everything was successful and less than - * ninfo on a partial failure. - */ -int -qemuAgentSetVCPUs(qemuAgentPtr mon, - qemuAgentCPUInfoPtr info, - size_t ninfo) + +/* returns the value provided by the guest agent or -1 on internal error */ +static int +qemuAgentSetVCPUsCommand(qemuAgentPtr mon, + qemuAgentCPUInfoPtr info, + size_t ninfo, + int *nmodified) { int ret = -1; virJSONValuePtr cmd = NULL; @@ -1541,6 +1538,8 @@ qemuAgentSetVCPUs(qemuAgentPtr mon, virJSONValuePtr cpu = NULL; size_t i; +*nmodified = 0; + /* create the key data array */ if (!(cpus = virJSONValueNewArray())) goto cleanup; @@ -1552,6 +1551,12 @@ qemuAgentSetVCPUs(qemuAgentPtr mon, if (!(cpu = virJSONValueNewObject())) goto cleanup; +/* don't set state for cpus that were not touched */ +if (!in->modified) +continue; + +(*nmodified)++; + if (virJSONValueObjectAppendNumberInt(cpu, "logical-id", in->id) < 0) goto cleanup; @@ -1564,6 +1569,11 @@ qemuAgentSetVCPUs(qemuAgentPtr mon, cpu = NULL; } +if (*nmodified == 0) { +ret = 0; +goto cleanup; +} + if (!(cmd = qemuAgentMakeCommand("guest-set-vcpus", "a:vcpus", cpus, NULL))) @@ -1575,9 +1585,17 @@ qemuAgentSetVCPUs(qemuAgentPtr mon, VIR_DOMAIN_QEMU_AGENT_COMMAND_BLOCK) < 0) goto cleanup; -if (virJSONValueObjectGetNumberInt(reply, "return", &ret) < 0) { +if (qemuAgentCheckError(cmd, reply) < 0) +goto cleanup; + +/* All negative values are invalid. Return of 0 is bougs since we wouldn't + * call the guest agent so that 0 cpus would be set successfully. Reporting + * more successfuly set vcpus that we've asked for is invalid */ +if (virJSONValueObjectGetNumberInt(reply, "return", &ret) < 0 || +ret <= 0 || ret > *nmodified) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("malformed return value")); + _("guest agent returned malformed or invalid return value")); +ret = -1; } cleanup: @@ -1589,6 +1607,45 @@ qemuAgentSetVCPUs(qemuAgentPtr mon, } +/** + * Set the VCPU state using guest agent. + * + * Attempts to set the guest agent state for all cpus or until a proper error is + * reported by the guest agent. This may require multiple calls. + * + * Returns -1 on error, 0 on success. + */ +int +qemuAgentSetVCPUs(qemuAgentPtr mon, + qemuAgentCPUInfoPtr info, + size_t ninfo) +{ +int rv; +int nmodified; +size_t i; + +do { +if ((rv = qemuAgentSetVCPUsCommand(mon, info, ninfo, &nmodified)) < 0) +return -1; + +/* all vcpus were set successfully */ +if (rv == nmodified) +return 0; + +/* un-mark vcpus that were already set */ +for (i = 0; i < ninfo && rv > 0; i++) { +if (!info[i].modified) +continue; + +info[i].modified = false; +rv--; +} +} while (1); + +return 0; +} + + /* modify the cpu info structure to set the correct amount of cpus */ int qemuAgentUpdateCPUInfo(unsigned int nvcpus, @@ -1647,12 +1704,14 @@ qemuAgentUpdateCPUInfo(unsigned int nvcpus, /* unplug */ if (cpuinfo[i].offlinable && cpuinfo[i].online) { cpuinfo[i].online = false; +cpuinfo[i].modified = true; nonline--; } } else if (nvcpus > nonline) { /* plug */ if (!cpuinfo[i].online) { cpuinfo[i].online = true; +cpuinfo[i].modified = true; nonline++; } } else { diff --git a/src/qemu/qemu_agent.h b/src/qem
[libvirt] [PATCH 1/7] rpcgen: Add support for generating funcs returning alloc'd typed params
Since it's rather tedious to write the dispatchers for functions that return an array of typed parameters (which are rather common) let's add some rpcgen code to generate them. --- src/remote/remote_protocol.x | 5 + src/rpc/gendispatch.pl | 45 +++- 2 files changed, 49 insertions(+), 1 deletion(-) diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x index 0170c0c..cec6bd2 100644 --- a/src/remote/remote_protocol.x +++ b/src/remote/remote_protocol.x @@ -414,6 +414,11 @@ struct remote_domain_disk_error { * insert@ comment to indicate the offset in the parameter list of * the function to be called. * + * For cases where the API allocates memory and fills the arguments (mostly + * typed parameters) a similar comment indicates the type and offset + * of the variable to be filled with the count of returned elements. + * alloc@@unsigned int@ + * * Dynamic opaque and remote_nonnull_string arrays can be annotated with an * optional typecast */ diff --git a/src/rpc/gendispatch.pl b/src/rpc/gendispatch.pl index 5564b2e..173189c 100755 --- a/src/rpc/gendispatch.pl +++ b/src/rpc/gendispatch.pl @@ -862,6 +862,25 @@ elsif ($mode eq "server") { $single_ret_var = $2; $single_ret_by_ref = 0; $single_ret_check = " == NULL"; +} elsif ($ret_member =~ m/^remote_typed_param (\S+)<(\S+)>;\s*\/\*\s*alloc@(\d+)@([^@]+)@(\d+)\s*\*\//) { +push(@vars_list, "virTypedParameterPtr $1 = NULL"); +push(@vars_list, "$4 $1_len = 0"); + +$single_ret_by_ref = 1; +$single_ret_var = undef; + +splice(@args_list, int($3), 0, "&$1"); +splice(@args_list, int($5), 0, "&$1_len"); + +push(@ret_list, "if (virTypedParamsSerialize($1, $1_len,\n" . +" (virTypedParameterRemotePtr *) &ret->$1.$1_val,\n" . +" &ret->$1.$1_len,\n" . +" VIR_TYPED_PARAM_STRING_OKAY) < 0)\n" . +"goto cleanup;\n"); + +push(@free_list, "virTypedParamsFree($1, $1_len);"); +push(@free_list_on_error, "virTypedParamsRemoteFree((virTypedParameterRemotePtr) ret->params.params_val,\n" . + " ret->params.params_len);\n"); } elsif ($ret_member =~ m/^(\/)?\*/) { # ignore comments } else { @@ -1422,6 +1441,7 @@ elsif ($mode eq "client") { my $modern_ret_as_list = 0; my $modern_ret_struct_name = "undefined"; my $modern_ret_var_type = "undefined"; +my @custom_error_cleanup = (); if ($rettype ne "void" and scalar(@{$call->{ret_members}}) > 1) { @@ -1519,6 +1539,23 @@ elsif ($mode eq "client") { $single_ret_var = "vir${type_name}Ptr rv = NULL"; $single_ret_type = "vir${type_name}Ptr"; } +} elsif ($ret_member =~ m/^remote_typed_param (\S+)<(\S+)>;\s*\/\*\s*alloc@(\d+)@([^@]+)@(\d+)\s*\*\//) { +# handle self allocating arrays of typed parameters +splice(@args_list, int($3), 0, ("virTypedParameterPtr *$1")); +splice(@args_list, int($5), 0, ("$4 *n$1")); +push(@vars_list, "virTypedParameterPtr ret_params = NULL"); +push(@vars_list, "int ret_nparams = 0"); +# virTypedParamsDeserialize allocates the array if @params is null +push(@ret_list2, "if (virTypedParamsDeserialize((virTypedParameterRemotePtr) ret.$1.$1_val,\n" . + " ret.$1.$1_len,\n" . + " $2,\n" . + " &ret_params,\n" . + " &ret_nparams) < 0)\n" . + "goto cleanup;\n"); +push(@ret_list2, "*$1 = ret_params;"); +push(@ret_list2, "*n$1 = ret_nparams;"); +push(@custom_error_cleanup, "virTypedParamsFree(ret_params, ret_nparams);\n"); +$single_ret_cleanup = 1; } elsif ($ret_member =~ m/^remote_typed_param (\S+)<(\S+)>;\s*\/\*\s*insert@(\d+)\s*\*\//) { splice(@args_list, int($3), 0, ("virTypedParameterPtr $1")); push(@ret_list2, "if (virTypedParamsDeserialize((virTypedParameterRemotePtr) ret.$1.$
[libvirt] [PATCH 0/7] Add APIs for individual vCPU state modification using the guest agent
As a first step, add the guest-agent part. The real hotplug stuff will follow shortly. Please note that the setter API will be used as template for the real stuff too. Peter Krempa (7): rpcgen: Add support for generating funcs returning alloc'd typed params lib: Add API to query guest vcpu info using guest agent lib: Add API to set individual vcpu usage in the guest via guest agent virsh: Add command 'guestvcpus' implementing virDomain(GS)etGuestVcpus qemu: agent: Make setting of vcpus more robust qemu: Implement virDomainGetGuestVcpus qemu: Implement virDomainSetGuestVcpus include/libvirt/libvirt-domain.h | 10 ++ src/driver-hypervisor.h | 14 +++ src/libvirt-domain.c | 105 src/libvirt_public.syms | 2 + src/qemu/qemu_agent.c| 83 +--- src/qemu/qemu_agent.h| 2 + src/qemu/qemu_driver.c | 210 --- src/remote/remote_driver.c | 2 + src/remote/remote_protocol.x | 39 +++- src/remote_protocol-structs | 18 src/rpc/gendispatch.pl | 45 - tests/qemuagenttest.c| 44 tools/virsh-domain.c | 93 + tools/virsh.pod | 10 ++ 14 files changed, 625 insertions(+), 52 deletions(-) -- 2.8.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH 4/7] virsh: Add command 'guestvcpus' implementing virDomain(GS)etGuestVcpus
Add a straightforward implementation for using the new APIs. --- tools/virsh-domain.c | 93 tools/virsh.pod | 10 ++ 2 files changed, 103 insertions(+) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index bd6db47..ff2305f 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -6762,6 +6762,93 @@ cmdSetvcpus(vshControl *ctl, const vshCmd *cmd) return ret; } + +/* + * "guestvcpus" command + */ +static const vshCmdInfo info_guestvcpus[] = { +{.name = "help", + .data = N_("query or modify state of vcpu in the guest (via agent)") +}, +{.name = "desc", + .data = N_("Use the guest agent to query or set cpu state from guest's " +"point of view") +}, +{.name = NULL} +}; + +static const vshCmdOptDef opts_guestvcpus[] = { +VIRSH_COMMON_OPT_DOMAIN_FULL, +{.name = "cpumap", + .type = VSH_OT_STRING, + .help = N_("number of virtual CPUs") +}, +{.name = "enable", + .type = VSH_OT_BOOL, + .help = N_("enable cpus specified by cpumap") +}, +{.name = "disable", + .type = VSH_OT_BOOL, + .help = N_("disable cpus specified by cpumap") +}, +{.name = NULL} +}; + +static bool +cmdGuestvcpus(vshControl *ctl, const vshCmd *cmd) +{ +virDomainPtr dom; +bool enable = vshCommandOptBool(cmd, "enable"); +bool disable = vshCommandOptBool(cmd, "disable"); +virTypedParameterPtr params = NULL; +unsigned int nparams = 0; +const char *cpumap = NULL; +int state = 0; +size_t i; +bool ret = false; + +VSH_EXCLUSIVE_OPTIONS_VAR(enable, disable); +VSH_REQUIRE_OPTION("enable", "cpumap"); +VSH_REQUIRE_OPTION("disable", "cpumap"); + +if (vshCommandOptStringReq(ctl, cmd, "cpumap", &cpumap)) +return false; + +if (cpumap && !(enable | disable)) { +vshError(ctl, _("One of options --enable or --disable is required by " +"option --cpumap")); +return false; +} + +if (!(dom = virshCommandOptDomain(ctl, cmd, NULL))) +return false; + +if (enable) +state = 1; + +if (cpumap) { +if (virDomainSetGuestVcpus(dom, cpumap, state, 0) < 0) +goto cleanup; +} else { +if (virDomainGetGuestVcpus(dom, ¶ms, &nparams, 0) < 0) +goto cleanup; + +for (i = 0; i < nparams; i++) { +char *str = vshGetTypedParamValue(ctl, ¶ms[i]); +vshPrint(ctl, "%-15s: %s\n", params[i].field, str); +VIR_FREE(str); +} +} + +ret = true; + + cleanup: +virTypedParamsFree(params, nparams); +virDomainFree(dom); +return ret; +} + + /* * "iothreadinfo" command */ @@ -13602,5 +13689,11 @@ const vshCmdDef domManagementCmds[] = { .info = info_vncdisplay, .flags = 0 }, +{.name = "guestvcpus", + .handler = cmdGuestvcpus, + .opts = opts_guestvcpus, + .info = info_guestvcpus, + .flags = 0 +}, {.name = NULL} }; diff --git a/tools/virsh.pod b/tools/virsh.pod index 8e3ba69..6af1328 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -2501,6 +2501,16 @@ Both I<--live> and I<--config> flags may be given if I is present, but I<--current> is exclusive. If no flag is specified, behavior is different depending on hypervisor. +=item B I [[I<--enable>] | [I<--disable>]] [I] + +Query or change state of vCPUs from guest's point of view using the guest agent. +When invoked without I the guest is queried for available guest vCPUs, +their state and possibility to be offlined. + +If I is provided then one of I<--enable> or I<--disable> must be +provided too. The desired operation is then executed on the domain. + +See B for I (as I). =item B I -- 2.8.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH 7/7] qemu: Implement virDomainSetGuestVcpus
Allow modification of specific vCPU states via the guest agent. --- src/qemu/qemu_driver.c | 83 ++ 1 file changed, 83 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 5b96ad8..4bd8c92 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -19837,6 +19837,88 @@ qemuDomainGetGuestVcpus(virDomainPtr dom, } +static int +qemuDomainSetGuestVcpus(virDomainPtr dom, +const char *cpumap, +int state, +unsigned int flags) +{ +virQEMUDriverPtr driver = dom->conn->privateData; +virDomainObjPtr vm = NULL; +virBitmapPtr map = NULL; +qemuAgentCPUInfoPtr info = NULL; +int ninfo = 0; +size_t i; +int ret = -1; + +virCheckFlags(0, -1); + +if (state != 0 && state != 1) { +virReportInvalidArg(state, "%s", _("unsupported state value")); +return -1; +} + +if (virBitmapParse(cpumap, &map, 4096) < 0) +goto cleanup; + +if (!(vm = qemuDomObjFromDomain(dom))) +goto cleanup; + +if (virDomainSetGuestVcpusEnsureACL(dom->conn, vm->def) < 0) +goto cleanup; + +if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) +goto cleanup; + +if (!qemuDomainAgentAvailable(vm, true)) +goto endjob; + +qemuDomainObjEnterAgent(vm); +ninfo = qemuAgentGetVCPUs(qemuDomainGetAgent(vm), &info); +qemuDomainObjExitAgent(vm); + +if (ninfo < 0) +goto endjob; + +for (i = 0; i < ninfo; i++) { +if (!virBitmapIsBitSet(map, info[i].id)) +continue; + +if (!state && !info[i].offlinable) { +virReportError(VIR_ERR_OPERATION_UNSUPPORTED, + _("vCPU '%u' is not offlinable"), info[i].id); +goto endjob; +} + +info[i].online = !!state; +info[i].modified = true; + +ignore_value(virBitmapClearBit(map, info[i].id)); +} + +if (!virBitmapIsAllClear(map)) { +char *tmp = virBitmapFormat(map); +virReportError(VIR_ERR_INVALID_ARG, + _("guest is missing vCPUs '%s'"), NULLSTR(tmp)); +VIR_FREE(tmp); +goto endjob; +} + +qemuDomainObjEnterAgent(vm); +ret = qemuAgentSetVCPUs(qemuDomainGetAgent(vm), info, ninfo); +qemuDomainObjExitAgent(vm); + + endjob: +qemuDomainObjEndJob(driver, vm); + + cleanup: +VIR_FREE(info); +virBitmapFree(map); +virDomainObjEndAPI(&vm); +return ret; +} + + static virHypervisorDriver qemuHypervisorDriver = { .name = QEMU_DRIVER_NAME, .connectOpen = qemuConnectOpen, /* 0.2.0 */ @@ -20049,6 +20131,7 @@ static virHypervisorDriver qemuHypervisorDriver = { .domainRename = qemuDomainRename, /* 1.2.19 */ .domainMigrateStartPostCopy = qemuDomainMigrateStartPostCopy, /* 1.3.3 */ .domainGetGuestVcpus = qemuDomainGetGuestVcpus, /* 2.0.0 */ +.domainSetGuestVcpus = qemuDomainSetGuestVcpus, /* 2.0.0 */ }; -- 2.8.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH 3/7] lib: Add API to set individual vcpu usage in the guest via guest agent
To allow finer-grained control of vcpu state using guest agent this API can be used to individually set the state of the vCPU. This will allow to better control NUMA enabled guests and/or test various vCPU configurations. --- include/libvirt/libvirt-domain.h | 5 src/driver-hypervisor.h | 7 ++ src/libvirt-domain.c | 49 src/libvirt_public.syms | 1 + src/remote/remote_driver.c | 1 + src/remote/remote_protocol.x | 15 +++- src/remote_protocol-structs | 7 ++ 7 files changed, 84 insertions(+), 1 deletion(-) diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h index 5605a94..5b80b85 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -4102,4 +4102,9 @@ int virDomainGetGuestVcpus(virDomainPtr domain, unsigned int *nparams, unsigned int flags); +int virDomainSetGuestVcpus(virDomainPtr domain, + const char *cpumap, + int state, + unsigned int flags); + #endif /* __VIR_LIBVIRT_DOMAIN_H__ */ diff --git a/src/driver-hypervisor.h b/src/driver-hypervisor.h index 93af2b6..5cd1fdf 100644 --- a/src/driver-hypervisor.h +++ b/src/driver-hypervisor.h @@ -1245,6 +1245,12 @@ typedef int unsigned int *nparams, unsigned int flags); +typedef int +(*virDrvDomainSetGuestVcpus)(virDomainPtr domain, + const char *cpumap, + int state, + unsigned int flags); + typedef struct _virHypervisorDriver virHypervisorDriver; typedef virHypervisorDriver *virHypervisorDriverPtr; @@ -1482,6 +1488,7 @@ struct _virHypervisorDriver { virDrvConnectUnregisterCloseCallback connectUnregisterCloseCallback; virDrvDomainMigrateStartPostCopy domainMigrateStartPostCopy; virDrvDomainGetGuestVcpus domainGetGuestVcpus; +virDrvDomainSetGuestVcpus domainSetGuestVcpus; }; diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index 0971a96..11f20af 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -11891,3 +11891,52 @@ virDomainGetGuestVcpus(virDomainPtr domain, virDispatchError(domain->conn); return -1; } + + +/** + * virDomainSetGuestVcpus: + * @domain: pointer to domain object + * @cpumap: text representation of a bitmap of vcpus to set + * @state: 0 to disable/1 to enable cpus described by @cpumap + * @flags: currently unused, callers shall pass 0 + * + * Sets state of individual vcpus described by @cpumap via guest agent. Other + * vcpus are not modified. + * + * This API requires the VM to run. Various hypervisors or guest agent + * implementation may limit to operate on just 1 vCPU per call. + * + * Note that OSes (notably Linux) may require vCPU 0 to stay online to support + * low-level features a S3 sleep. + * + * Returns 0 on success, -1 on error. + */ +int +virDomainSetGuestVcpus(virDomainPtr domain, + const char *cpumap, + int state, + unsigned int flags) +{ +VIR_DOMAIN_DEBUG(domain, "cpumap='%s' state=%x flags=%x", + NULLSTR(cpumap), state, flags); + +virResetLastError(); + +virCheckDomainReturn(domain, -1); +virCheckNonNullArgGoto(cpumap, error); + +if (domain->conn->driver->domainSetGuestVcpus) { +int ret; +ret = domain->conn->driver->domainSetGuestVcpus(domain, cpumap, state, +flags); +if (ret < 0) +goto error; +return ret; +} + +virReportUnsupportedError(); + + error: +virDispatchError(domain->conn); +return -1; +} diff --git a/src/libvirt_public.syms b/src/libvirt_public.syms index 30801c5..b6d2dfd 100644 --- a/src/libvirt_public.syms +++ b/src/libvirt_public.syms @@ -737,6 +737,7 @@ LIBVIRT_2.0.0 { virConnectStoragePoolEventRegisterAny; virConnectStoragePoolEventDeregisterAny; virDomainGetGuestVcpus; +virDomainSetGuestVcpus; } LIBVIRT_1.3.3; # define new API here using predicted next version number diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index 6a580c6..3f9d812 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -7982,6 +7982,7 @@ static virHypervisorDriver hypervisor_driver = { .connectUnregisterCloseCallback = remoteConnectUnregisterCloseCallback, /* 1.3.2 */ .domainMigrateStartPostCopy = remoteDomainMigrateStartPostCopy, /* 1.3.3 */ .domainGetGuestVcpus = remoteDomainGetGuestVcpus, /* 2.0.0 */ +.domainSetGuestVcpus = remoteDomainSetGuestVcpus, /* 2.0.0 */ }; static virNetworkDriver network_driver = { diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x index f72918d..d11bfdf 1006
[libvirt] [PATCH 2/7] lib: Add API to query guest vcpu info using guest agent
Add a rather universal API implemented via typed params that will allow to query the guest agent for the state and possibly other aspects of guest vcpus. --- include/libvirt/libvirt-domain.h | 5 src/driver-hypervisor.h | 7 + src/libvirt-domain.c | 56 src/libvirt_public.syms | 1 + src/remote/remote_driver.c | 1 + src/remote/remote_protocol.x | 21 ++- src/remote_protocol-structs | 11 7 files changed, 101 insertions(+), 1 deletion(-) diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h index cba4fa5..5605a94 100644 --- a/include/libvirt/libvirt-domain.h +++ b/include/libvirt/libvirt-domain.h @@ -4097,4 +4097,9 @@ int virDomainRename(virDomainPtr dom, const char *new_name, unsigned int flags); +int virDomainGetGuestVcpus(virDomainPtr domain, + virTypedParameterPtr *params, + unsigned int *nparams, + unsigned int flags); + #endif /* __VIR_LIBVIRT_DOMAIN_H__ */ diff --git a/src/driver-hypervisor.h b/src/driver-hypervisor.h index 5ab5775..93af2b6 100644 --- a/src/driver-hypervisor.h +++ b/src/driver-hypervisor.h @@ -1239,6 +1239,12 @@ typedef int (*virDrvConnectUnregisterCloseCallback)(virConnectPtr conn, virConnectCloseFunc cb); +typedef int +(*virDrvDomainGetGuestVcpus)(virDomainPtr domain, + virTypedParameterPtr *params, + unsigned int *nparams, + unsigned int flags); + typedef struct _virHypervisorDriver virHypervisorDriver; typedef virHypervisorDriver *virHypervisorDriverPtr; @@ -1475,6 +1481,7 @@ struct _virHypervisorDriver { virDrvConnectRegisterCloseCallback connectRegisterCloseCallback; virDrvConnectUnregisterCloseCallback connectUnregisterCloseCallback; virDrvDomainMigrateStartPostCopy domainMigrateStartPostCopy; +virDrvDomainGetGuestVcpus domainGetGuestVcpus; }; diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index 73ae369..0971a96 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -11835,3 +11835,59 @@ virDomainInterfaceFree(virDomainInterfacePtr iface) VIR_FREE(iface); } + + +/** + * virDomainGetGuestVcpus: + * @domain: pointer to domain object + * @params: Pointer that will be filled with an array of typed parameters + * @nparams: pointer filled with number of elements in @params + * @flags: currently unused, callers shall pass 0 + * + * Queries the guest agent for state and information regarding vCPUs from + * guest's perspective. The reported data depends on the guest agent + * implementation. + * + * Reported fields stored in @params: + * 'vcpus': string containing bitmap representing vCPU ids as reported by the + * guest + * 'online': string containing bitmap representing online vCPUs as reported + * by the guest agent. + * 'offlinable': string containing bitmap representing ids of vCPUs that can be + * offlined + * + * This API requires the VM to run. The caller is responsible for calling + * virTypedParamsFree to free memory returned in @params. + * + * Returns 0 on success, -1 on error. + */ +int +virDomainGetGuestVcpus(virDomainPtr domain, + virTypedParameterPtr *params, + unsigned int *nparams, + unsigned int flags) +{ +VIR_DOMAIN_DEBUG(domain, "params=%p, nparams=%p, flags=%x", + params, nparams, flags); + +virResetLastError(); + +virCheckDomainReturn(domain, -1); +virCheckNonNullArgGoto(params, error); +virCheckNonNullArgGoto(nparams, error); + +if (domain->conn->driver->domainGetGuestVcpus) { +int ret; +ret = domain->conn->driver->domainGetGuestVcpus(domain, params, nparams, +flags); +if (ret < 0) +goto error; +return ret; +} + +virReportUnsupportedError(); + + error: +virDispatchError(domain->conn); +return -1; +} diff --git a/src/libvirt_public.syms b/src/libvirt_public.syms index 06011ce..30801c5 100644 --- a/src/libvirt_public.syms +++ b/src/libvirt_public.syms @@ -736,6 +736,7 @@ LIBVIRT_2.0.0 { global: virConnectStoragePoolEventRegisterAny; virConnectStoragePoolEventDeregisterAny; +virDomainGetGuestVcpus; } LIBVIRT_1.3.3; # define new API here using predicted next version number diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index 84b6d58..6a580c6 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -7981,6 +7981,7 @@ static virHypervisorDriver hypervisor_driver = { .connectRegisterCloseCallback = remoteConnectRegisterCloseCallback, /* 1.3.2 */ .connectUnregisterCloseCallback =
[libvirt] [PATCH 6/7] qemu: Implement virDomainGetGuestVcpus
Allow gathering available vcpu ids, their state and offlinability via the qemu guest agent. The maximum id was chosen arbitrarily and ought to be enough for everybody. --- src/qemu/qemu_driver.c | 114 + 1 file changed, 114 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 098840f..5b96ad8 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -122,6 +122,8 @@ VIR_LOG_INIT("qemu.qemu_driver"); #define QEMU_SCHED_MIN_QUOTA 1000LL #define QEMU_SCHED_MAX_QUOTA 18446744073709551LL +#define QEMU_GUEST_VCPU_MAX_ID 4096 + #if HAVE_LINUX_KVM_H # include #endif @@ -19724,6 +19726,117 @@ static int qemuDomainRename(virDomainPtr dom, return ret; } + +static int +qemuDomainGetGuestVcpusParams(virTypedParameterPtr *params, + unsigned int *nparams, + qemuAgentCPUInfoPtr info, + int ninfo) +{ +virTypedParameterPtr par = NULL; +int npar = 0; +int maxpar = 0; +virBitmapPtr vcpus = NULL; +virBitmapPtr online = NULL; +virBitmapPtr offlinable = NULL; +char *tmp = NULL; +size_t i; +int ret = -1; + +if (!(vcpus = virBitmapNew(QEMU_GUEST_VCPU_MAX_ID)) || +!(online = virBitmapNew(QEMU_GUEST_VCPU_MAX_ID)) || +!(offlinable = virBitmapNew(QEMU_GUEST_VCPU_MAX_ID))) +goto cleanup; + +for (i = 0; i < ninfo; i++) { +if (virBitmapSetBit(vcpus, info[i].id) < 0) { +virReportError(VIR_ERR_INTERNAL_ERROR, + _("vcpu id '%u' reported by guest agent is out of " + "range"), info[i].id); +goto cleanup; +} + +if (info[i].online) +ignore_value(virBitmapSetBit(online, info[i].id)); + +if (info[i].offlinable) +ignore_value(virBitmapSetBit(offlinable, info[i].id)); +} + +#define ADD_BITMAP(name) \ +if (!(tmp = virBitmapFormat(name))) \ +goto cleanup; \ +if (virTypedParamsAddString(&par, &npar, &maxpar, #name, tmp) < 0) \ +goto cleanup; \ +VIR_FREE(tmp) + +ADD_BITMAP(vcpus); +ADD_BITMAP(online); +ADD_BITMAP(offlinable); + +#undef ADD_BITMAP + +*params = par; +*nparams = npar; +ret = 0; + + cleanup: +VIR_FREE(tmp); +virBitmapFree(vcpus); +virBitmapFree(online); +virBitmapFree(offlinable); +return ret; +} + + +static int +qemuDomainGetGuestVcpus(virDomainPtr dom, +virTypedParameterPtr *params, +unsigned int *nparams, +unsigned int flags) +{ +virQEMUDriverPtr driver = dom->conn->privateData; +virDomainObjPtr vm = NULL; +qemuAgentCPUInfoPtr info = NULL; +int ninfo = 0; +int ret = -1; + +virCheckFlags(0, ret); + +if (!(vm = qemuDomObjFromDomain(dom))) +goto cleanup; + +if (virDomainGetGuestVcpusEnsureACL(dom->conn, vm->def) < 0) +goto cleanup; + +if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) +goto cleanup; + +if (!qemuDomainAgentAvailable(vm, true)) +goto endjob; + +qemuDomainObjEnterAgent(vm); +ninfo = qemuAgentGetVCPUs(qemuDomainGetAgent(vm), &info); +qemuDomainObjExitAgent(vm); + +if (ninfo < 0) +goto endjob; + +if (qemuDomainGetGuestVcpusParams(params, nparams, info, ninfo) < 0) +goto endjob; + +ret = 0; + + endjob: +qemuDomainObjEndJob(driver, vm); + + cleanup: +VIR_FREE(info); +virDomainObjEndAPI(&vm); +return ret; +} + + static virHypervisorDriver qemuHypervisorDriver = { .name = QEMU_DRIVER_NAME, .connectOpen = qemuConnectOpen, /* 0.2.0 */ @@ -19935,6 +20048,7 @@ static virHypervisorDriver qemuHypervisorDriver = { .domainSetUserPassword = qemuDomainSetUserPassword, /* 1.2.16 */ .domainRename = qemuDomainRename, /* 1.2.19 */ .domainMigrateStartPostCopy = qemuDomainMigrateStartPostCopy, /* 1.3.3 */ +.domainGetGuestVcpus = qemuDomainGetGuestVcpus, /* 2.0.0 */ }; -- 2.8.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] virsh: introduce name-uuid for list command
At 2016-06-20 21:38:42, "Peter Krempa" wrote: >On Mon, Jun 20, 2016 at 19:22:45 +0800, Chen Hanxiao wrote: >> >> At 2016-06-15 17:36:05, "Chen Hanxiao" wrote: >> >From: Chen Hanxiao >> > >> >This patch will show both name and UUID of domain: >> > >> > IdName State UUID >> > --- >> > 3 f23running >> > 918f1dd6-b19f-412b-ba17-d113bad89af8 >> > >> >Signed-off-by: Chen Hanxiao >> >--- >> >> ping? > >Jan already provided a review. I agree with his view. Allowing both >--name --uuid is better than the new argument. Hi, My only concern is that why we forbid --uuid with --name at the same time at the begining. If we let them come together, does that bring some backcompat issues? Regards, - Chen -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH 1/7] add VirtualBox 5 C API to libvirt
add VirtualBox 5 C API to libvirt ý7zXZ æÖ´F ! ÏXÌë×Qð] #æöß(vã C{ôö D£xÔ<¨ ,}{ôBa}(ÈÝV"~[Fd xDø¯3`Y9ö©¹.¹nJ> 8.ÔGrá3£ð*1²× Êáfl³[¤¶m· SÆ¿ÄïÀlúAû|mGÞÉf¾OWÁ§W«mV,:7 ÚAà|'äàß)ÇLîøuT5}1sóîñJ¾¥³ÿ¸Ï8_ó(ÍSxЮu8@%¤»Ênl<¥k[ãÄg(·cºX¡TF"Cã_,äü7ê~»Rm½¼äáêª A(m - ²ÙT! jÅZiÄÙÏEQè¦ÕE]WöÚ*÷b2¸ ÛÔâ öI%7 ¤fy@5«¿×äìJÀ?m©ÁI¿R²¥¥Zßëÿ,ÇLøG¡Cv"} Tò/ªx¤T\5ÖôýÕBÞrÙ"¤sÊÅ«':7>{Hê®Ôác_~/«±~°AÄbökGñ@R§KøüB/ÁÞÑ9sG© ])|纲¨ðqá3þvà½Ðeÿà &