<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Jan 24, 2014, at 12:24 PM, Eric Blake <<a href="mailto:eblake@redhat.com">eblake@redhat.com</a>> wrote:</div><blockquote type="cite"><div style="font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Thanks.  You may also want to wrap long lines, and/or use 'git<br>send-email' to make the patches easier to use, but for a first time<br>submission, this is enough to let us start review.<br></div></blockquote><div><br></div><div>Thanks, I’ll keep that in mind for next time.</div><br><blockquote type="cite"><div style="font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">I'd rather see us check both limits and reject the operation up front if<br>we can't meet both limits, than to lower the checks down into the<br>live/persistent branches but risk failure with live modified when the<br>persistent branch finally detects failure.<br><br>It also has the benefit of being a smaller diffstat:<br><br>diff --git i/src/qemu/qemu_driver.c w/src/qemu/qemu_driver.c<br>index a7ef209..82d29c4 100644<br>--- i/src/qemu/qemu_driver.c<br>+++ w/src/qemu/qemu_driver.c<br>@@ -2242,8 +2242,16 @@ static int qemuDomainSetMemoryFlags(virDomainPtr<br>dom, unsigned long newmem,<br><br>    } else {<br>        /* resize the current memory */<br>+        unsigned long oldmax = 0;<br><br>-        if (newmem > vm->def->mem.max_balloon) {<br>+        if (flags & VIR_DOMAIN_AFFECT_LIVE)<br>+            oldmax = vm->def->mem.max_balloon;<br>+        if (flags & VIR_DOMAIN_AFFECT_CONFIG) {<br>+            if (!oldmax || oldmax > persistentDef->mem.max_balloon)<br>+                oldmax = persistentDef->mem.max_balloon;<br>+        }<br>+<br>+        if (newmem > oldmax) {<br>            virReportError(VIR_ERR_INVALID_ARG, "%s",<br>                           _("cannot set memory higher than max memory"));<br>            goto endjob;<br><br><blockquote type="cite">@@ -4207,11 +4214,12 @@ qemuDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,<br>        goto endjob;<br>    }<br><br>-    if (!maximum && nvcpus > vm->def->maxvcpus) {<br>+    maxvcpus = (flags & VIR_DOMAIN_AFFECT_LIVE) ? vm->def->maxvcpus : persistentDef->maxvcpus;<br></blockquote><br>Long line.  Also, I think it suffers from the same problem - if both<br>_LIVE and _CONFIG are given at once, then we want to cap things at the<br>lower of the two limits, rather than using just the live max as the limit.<br></div></blockquote></div><br><div>This looks like it would work for my purposes.</div><div><br></div></body></html>