On 03/05/2013 05:44 PM, Laszlo Ersek wrote:
>
> Anyway I'd prefer to avoid direct write()s with nbyte > 1 as I'd have to
> handle partial transfers, if for nothing else than principle. (IIRC
> avoiding that loop was my main motivation for stdio.)
Fair enough - this code is not a hotspot, so stdio
> On 03/06/13 00:37, Eric Blake wrote:
>
> > I guess I had in my mind %c instead of %u; still, I can't help but
> > wonder if fprintf() and buffering is overkill, compared to just
> > doing
> > something like this:
> > write(fd, &"01"[vcpu->online], 1);
> >
> > (okay, I hope you would favor read
On 03/06/13 00:37, Eric Blake wrote:
> I guess I had in my mind %c instead of %u; still, I can't help but
> wonder if fprintf() and buffering is overkill, compared to just doing
> something like this:
> write(fd, &"01"[vcpu->online], 1);
>
> (okay, I hope you would favor readability over my comp
On 03/05/2013 04:23 PM, Laszlo Ersek wrote:
> For an already online CPU:
>
> # dd of=/sys/devices/system/cpu/cpu1/online bs=1 count=1 <<<1
> dd: writing `/sys/devices/system/cpu/cpu1/online': Invalid argument
> [...]
So we really do have to read existing state to avoid an error when the
user didn
On 03/05/13 22:19, Eric Blake wrote:
> On 03/04/2013 03:19 PM, Laszlo Ersek wrote:
>> +} else {
>> +unsigned online;
>> +
>> +if (fscanf(f, "%u", &online) != 1) {
>> +error_setg(&local_err, "failed to read or parse \"%s\"",
>> +
On 03/04/2013 03:19 PM, Laszlo Ersek wrote:
> Signed-off-by: Laszlo Ersek
> ---
> qga/commands-posix.c | 51
> ++
> 1 files changed, 51 insertions(+), 0 deletions(-)
>
> diff --git a/qga/commands-posix.c b/qga/commands-posix.c
> index d4b6bdc..1
On 03/05/13 21:09, mdroth wrote:
> Similar to comments in patch 2: is this supposed to be similar to the
> /sys/devices/system/cpu/{probe,release} entries currently documented?
I don't have those on RHEL-6, and they aren't mentioned in upstream
"Documentation/cpu-hotplug.txt".
"Documentation/ABI
On Mon, Mar 04, 2013 at 11:19:57PM +0100, Laszlo Ersek wrote:
>
> Signed-off-by: Laszlo Ersek
> ---
> qga/commands-posix.c | 51
> ++
> 1 files changed, 51 insertions(+), 0 deletions(-)
>
> diff --git a/qga/commands-posix.c b/qga/commands-posix
Signed-off-by: Laszlo Ersek
---
qga/commands-posix.c | 51 ++
1 files changed, 51 insertions(+), 0 deletions(-)
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index d4b6bdc..1848df8 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-